-
Notifications
You must be signed in to change notification settings - Fork 190
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
make @glimmer/compiler runable in browser #1311
base: main
Are you sure you want to change the base?
make @glimmer/compiler runable in browser #1311
Conversation
Removes node.js crypto API usage so the compiler can be used in all JS runtimes. Instead, now we simply increment the template default id for each template compilation.
cb4959f
to
e1cd954
Compare
Hmmm, I don't think this should be needed. It is definitely possible to use Maybe you can explain what you ran into specifically? |
Hi @rwjblue thanks for your response! It's been 3 months since I created the issue so I'll need to remember where I exactly need this 😅 However I know that I needed this change absolutely when I was building I do a similar code adjustment here automated: Currently ember and glimmer tests run through ember specific build systems including I've spent a lot of time on This runtime error occurs because node.js doesn't provide Currently I'm busy working on an ember-data alternative for directly node.js/esm compliant glimmer app framework(so no compilers/cli build system for dev, perhaps one only needed to remove the glimmer runtime in production mode to remove bytes & make it AOT instead of JIT), I can reproduce the exact error once Im back to emberx experiment which is almost finished, will be a successful experiment when tests are done, was able to get a universal framework/library running without a build system however misses a data management library so I'm also experimenting with a Again I'm not sure where this specific error came from but the scenario/runtime error above is a valid scenario. Based on node.js and esbuild errors on emberx I created this type of scripts(first link), so I could eventually eliminate these code adjustment/automation scripts with needed adjustments/PRs on the related dependencies. |
@izelnakri - Thanks for your response! I totally agree with you, I'd like to see progress on that front (help absolutely welcome!!). Specifically, I'd like to:
IMHO, this makes things a bit nicer/easier for Embroider too (one of my objectives is to get ember-source building properly under Embroider's Webpack builds without requiring so much cusomization; which would unlock quite a bit better shaking and whatnot). |
Hi @rwjblue , I'm definitely interested in helping out for these issues. I suspect I'll have some time in 3 weeks for contributions. We can chat/plan it over DMs, you can reach me: izelnakri#8658 on discord, @izelnakri on Telegram. |
I think @ef4 has an upcoming RFC that will make the compiler available at runtime (if imported), and could supersede this PR? |
No, this PR would probably be needed to make that idea work anyway. |
But also, the compiler definitely runs in the browser during ember's test suite already, so I don't know the details of what this is fixing. |
I think it's a good improvement anyway. Having incremental id's:
In addition, it's |
Removes node.js crypto API usage so the compiler can be used in all JS runtimes. Instead, now we simply increment the template default id for each template for compilation.