Skip to content
This repository has been archived by the owner on Jan 11, 2022. It is now read-only.

Add documentation on how to use generator #1

Closed
BorntraegerMarc opened this issue Jan 11, 2017 · 6 comments
Closed

Add documentation on how to use generator #1

BorntraegerMarc opened this issue Jan 11, 2017 · 6 comments
Assignees

Comments

@BorntraegerMarc
Copy link

Would be cool too see a little bit more specific doc on how to use it :)

@tomzi8
Copy link

tomzi8 commented Jan 11, 2017

Yeah everybody would be grateful :)

@hydraslay
Copy link
Owner

Added detail step of generate and use the static directives.

@BorntraegerMarc @tomaszcysewski

@hydraslay hydraslay self-assigned this Jan 11, 2017
@BorntraegerMarc
Copy link
Author

Thank you very much @hydraslay

But I ment more on how to actually generate a new directive based on an web component. Not how to include them :)

@hydraslay
Copy link
Owner

@BorntraegerMarc
The step 2 ~ 5 is how to generate a directive.
But it can not generate directive based on any web component. Just Polymer.
The mechanism (in polymer-directive-generator.ts )is to execute the "PolymerElement(paper-xxx)" just like you use the polymer component before. and save the output into a static file , and use it in webpack.

The step 6 is how to include them.
Just like a sample like this (see the app.module.ts)

About howto use the polymer component
About howto use component in angular-cli(webpack)

@BorntraegerMarc
Copy link
Author

Cool, thank you very much :) Do you see any possibility to create a generator for any web component?

@hydraslay
Copy link
Owner

@BorntraegerMarc
Theoretically doable.

The generator in this project is about two things. Polymer and Webpack.
While building, Webpack won't accept a dynamic definition of component, which is the way polymer does.
So we make a generator to generate the static file to build in webpack.

If there is another component dynamically defined, and happened to be build by webpack.
Find that dynamical definition ( the implementation of js/ts) and make a new generator for that component.
Of course statically defined component don't need a generator.

But another question is , is a generator a best way or worth to be done?
just like somebody commented in original issue, here and here.

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

3 participants