Skip to content
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

babeljs integration example #710

Draft
wants to merge 1 commit into
base: frost
Choose a base branch
from

Conversation

wmill
Copy link
Contributor

@wmill wmill commented Nov 1, 2023

Just a proof of concept showing how to integrate bablejs so that you can use newer JS features.

Edit files/bundles.yaml to control what files are transpiled.

@zorbathut
Copy link
Contributor

Huh. Neat!

So, as I'm reading this, it looks like this is basically being given to Flask as a preprocessing step. Any idea if Flask is smart enough to cache, or is it regenerating every run? Also, if it's caching, is it smart enough to recognize when the underlying files have changed and reprocess it?

@wmill
Copy link
Contributor Author

wmill commented Nov 1, 2023

@zorbathut So Flask-Assets is built on top of WebAssets. It's supposed to handle caching, rebuilding, and can even upload the files to S3 if you want.

I haven't verified that it's all working correctly, additional configuration might be needed to set up caching properly. Note that if you're looking at the docs Python Babel is completely different from BabelJS. Python Babel does internationalization.

@zorbathut
Copy link
Contributor

Any idea how hard it would be to work typescript into this? It looks like Babel and TS do similar-but-unrelated things.

@wmill
Copy link
Contributor Author

wmill commented Nov 1, 2023

Babel can compile typescript using @babel/preset-typescript, there are limits because it can't do things like generate .d.ts files. It should work for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants