Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Is patch-dom.html recommended for data-binding/library interop? #2

Open
addyosmani opened this issue Aug 28, 2015 · 0 comments
Open

Comments

@addyosmani
Copy link

patch-dom.html patches DOM methods to work with shady dom, however it's phrased as an experiment that can trade performance for library interop. The alternative to using it is writing patches around the library you're targeting (e.g some folks have tried doing this with virtual-dom, incremental DOM or React).

Does Polymer have a preference for developers using patch-dom over monkey-patching other libraries? I understand this question is a little nuanced as the promise of Web Components is that interop becomes less complex, but was interested in thoughts on this.

I think it's also fine for the answer to be YMMV :)

  <script src="bower_components/webcomponentsjs/webcomponents-lite.js"></script>
    <script src="bower_components/react/JSXTransformer.js"></script>
    <script src="bower_components/react/react.min.js"></script>
    <link rel="import" href="bower_components/polymer/polymer.html">
    <link rel="import" href="bower_components/polymer-experiments/patch-dom.html">
    <!-- some imports -->
    <!-- React app that uses Polymer Element -->
    <script src="app.js" type="text/jsx"></script>
    <div id="app"></div>
    <script type="text/jsx">
      function render() {
        React.render(
          <App></App>,
          document.getElementById("app")
        );
      }
      render();
    </script>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant