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

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

@addyosmani

Description

@addyosmani

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions