googlearchive / core-component-page

Vulcanized version of https://github.com/Polymer/core-component-page-dev
8 stars 10 forks source link

core-component-page doesn't work with external scripts #7

Open wrumsby opened 10 years ago

wrumsby commented 10 years ago

Right now core-component-page only works with inline scripts.

It would be nice if it also supported external scripts because then it's easier to lint these scripts and run other transformations and analysis over external script files.

e.g.

Documentation will be generated from the script comments if it is inline:

<link rel="import" href="/components/polymer/polymer.html">

<polymer-element name="my-element">
    <template>
        ...
    </template>
    <script>
        // convenience wrapper for document.registerElement
        Polymer('my-element', {
            ...
        });
    </script>
 </polymer-element>

but not if it is external

<link rel="import" href="/components/polymer/polymer.html">

<polymer-element name="my-element">
    <template>
        ...
    </template>
    <!-- core-component-page doesn't know how to work with this file -->
    <script src="my-element.js"></script>
 </polymer-element>
liamcurry commented 9 years ago

+1

kgryte commented 9 years ago

+1

jeffschwartz commented 9 years ago

+1 Come on Polymer. Forcing the use of inline scripts is bad:

Editor tooling doesn't work because of multiple media types in one file (e.g. jslint, jshint, etc.)

rnarasap commented 9 years ago

Hello Polymer team,

Is there a plan to address this?

We have already created our components with external scripts and it could save a lot of effort in moving them back inline now.

jeffschwartz commented 9 years ago

@rnarasap I had to do exactly that, merge all my stand alone scripts back into inline. It is ironic that Polymer supports separation of concerns yet forces us to combine markup and code :( I'm sure they'll get around to it and just have bigger fish to fry at the moment.