Just want to note that the script portion of a Polymer element can live anywhere, there is no requirement that it be inside the <polymer-element>, we just like to write it that way in most cases.
This is why you have to repeat the element name when invoking `Polymer` function, but it allows you to use any kind of system for working with script (CoffeeScript, TypeScript, ES6 modules, requirejs, whatever). On Thu, Mar 6, 2014 at 1:04 PM, Ahuth <[email protected]> wrote: > What are your thoughts on using web technologies that require a > compilation step, such as CoffeeScript and SASS, inside Polymer components? > > I posted <https://groups.google.com/forum/#!topic/polymer-dev/4l7eIsf3p4Q>the > other day about a ruby > gem I made called Emcee <https://github.com/ahuth/emcee>. Essentially, it > allows you to declare in your Rails app what web components to import. It > then handles putting those and their dependencies into the asset pipeline, > and inserting html import tags into the page for them. In production, it > even concatenates everything into one import tag, and runs basic > compressing on it (removing comments and newlines). > > So pretty much Vulcanize, except for Rails. And it handles everything > automatically when the app runs. > > I've been thinking about where to go next, and I realized that it will > (hopefully) be pretty straightforward to add CoffeeScript or SASS > compilation to the processing of Polymer components. > > You could define an element like this: > > <polymer-element name="my-element"> > <template> > <span>stuff</span> > </template> > <script type="application/coffeescript"> > # CoffeeScript code here > </script> > </polymer-element> > > > and when you load your web app, the CoffeeScript will have been converted > to Javascript. The same would go for SASS. > > Does anyone have an thoughts on this, and is this something people want to > see? Or am I barking up the wrong tree here? > > P.S. Does anyone know a better way to format code on here? It seems like > the box the code example in is HUGE. > > Thanks > > Follow Polymer on Google+: plus.google.com/107187849809354688692 > --- > You received this message because you are subscribed to the Google Groups > "Polymer" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/polymer-dev/a5c4e055-9506-49af-b6cd-ed89a4f093fd%40googlegroups.com<https://groups.google.com/d/msgid/polymer-dev/a5c4e055-9506-49af-b6cd-ed89a4f093fd%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/groups/opt_out. > Follow Polymer on Google+: plus.google.com/107187849809354688692 --- You received this message because you are subscribed to the Google Groups "Polymer" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/CAHbmOLaSv%3D2QcZ5PhWZ6ux-F_shz7pWx9A_DtOe_5UUn0wPBPw%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
