-
-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
find templates with custom babel parser #175
Conversation
Will try with htmlparser2. No need for full spec (parse5) compliance here. Better fast and forgiving :) |
23d1429
to
7b2d14b
Compare
this is ready now |
7b9734f
to
933059d
Compare
@dfreeman @ef4 @chriskrycho what do you think? |
I'm not an active maintainer here or on Embroider, but my guess is that https://github.com/embroider-build/content-tag is a more complete solution to the issues you're aiming to tackle here. |
Yes, that is correct and we hope that content-tag is the much more robust solution. It's rust compiled to wasm, based on SWC so it has the benefit of a full javascript parser. The intention is to PR changes to ember-template-imports that would use content-tag to replace the preprocessor stage, and the babel stage here will also not be needed at all because babel-plugin-ember-template-compilation has already shipped the corresponding feature that goes with content-tag. |
What about other packages that depend on this to find the template parts? Like the eslint ember plugin. template lint etc. |
Yes we want to standardize all those things on content-tag too. We can output whatever info from it is most convenient for those tools. It's actually problematic right now that the preprocessor here lives in a classic ember addon. It's bad that things like template lint need to depend on this full addon, because the addon does more than just provide the preprocessor library. |
So, it is already in a state that can be used for this? |
a5d44c6
to
b9b7132
Compare
content-tag does not look like its ready #182 |
also extracted this into: https://github.com/patricklx/ember-template-preprocessor |
Thanks for starting this work, I was able to extract a reproduction of the bug you found. embroider-build/content-tag#16 |
gonna close this as
thanks again for your hard work @patricklx, it's much appreciated! |
i noticed that the current template parsing has issues.
I created a custom parser for babel which can parse the template tags.
https://babeljs.io/docs/babel-parser#will-the-babel-parser-support-a-plugin-system
I also added a conditional prefix to fix #171