Closed peterblazejewicz closed 9 years ago
Yeah, that's indeed not really the behaviour people will like. There's really no right way to do that though. We could do some regex magic but that would already break when people start changing the order or tweak the comments.
Maybe the issue should be moved to PSK first? The very first (at least public) commit to PSK would have not cause the problem when adding elements, as the last one section was dedicated to custom elements: https://github.com/PolymerElements/polymer-starter-kit/commit/42fa0d6a8fb4ea3872c05e22dd3b2dd7f369790e https://github.com/PolymerElements/polymer-starter-kit/blob/42fa0d6a8fb4ea3872c05e22dd3b2dd7f369790e/app/elements/elements.html
Hm yeah the easiest option would be for the add your elements
to appear after the routing section in PSK. @addyosmani is that an annoying change to make? If so we could add something to the generator to maybe work around it
I'm fine with that change being made (it's pretty minimal and really doesn't impact end users negatively afaics). Would someone like to open a corresponding issue on PSK and we'll get that made?
=> https://github.com/PolymerElements/polymer-starter-kit/pull/177 should fix this.
I you guys are OK with https://github.com/PolymerElements/polymer-starter-kit/pull/177 I could close this one as the change will be added at some point in the future
sounds good to me :)
PR landed.
When using
yo polymer:element my-element
the user is asked if she wants to import newly created custom element intoelements.html
:If the answer is positive (not default), the import is added - but into routings section - not into elements import section:
That is unfortunate I think, especially for user that is starting with framework or routes/imports.
Maybe that can be easily fixed by just moving
imports
section to the end ofelements.html
template, as the subgenerator routine just appends newly created element import to the end of the file? Just swap these two sections places (and in original starter kit template): https://github.com/yeoman/generator-polymer/blob/master/el/index.js#L89-L94 https://github.com/yeoman/generator-polymer/blob/master/app/templates/polymer-starter-kit/app/elements/elements.html#L32-L38 https://github.com/PolymerElements/polymer-starter-kit/blob/master/app/elements/elements.html#L32-L38Thanks!