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

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

Open
wrumsby opened this issue Aug 31, 2014 · 5 comments
Open

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

wrumsby opened this issue Aug 31, 2014 · 5 comments

Comments

@wrumsby
Copy link

wrumsby commented Aug 31, 2014

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
Copy link

+1

1 similar comment
@kgryte
Copy link

kgryte commented Dec 15, 2014

+1

@jeffschwartz
Copy link

+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
Copy link

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
Copy link

@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.

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

6 participants