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

Clean up babel/transpiler stuff #4115

Open
Stanzilla opened this issue Dec 26, 2019 · 6 comments
Open

Clean up babel/transpiler stuff #4115

Stanzilla opened this issue Dec 26, 2019 · 6 comments

Comments

@Stanzilla
Copy link
Contributor

Since we're only targeting electron, we could just move everything over to es2018 by default and stop transpiling a few things, no?

@ivanwonder
Copy link
Contributor

@LabhanshAgrawal
One problem. If hyper use the babel to compile the ts file. Why still use tsc here. It can be removed?
/~https://github.com/zeit/hyper/blob/5bb03972d78ff885df46c9dad692ef22f9a9c047/package.json#L8
If I am wrong, correct me.

@LabhanshAgrawal
Copy link
Collaborator

LabhanshAgrawal commented Dec 27, 2019

Babel compiles the files from lib, but it doesn't check for type errors

@Stanzilla
Copy link
Contributor Author

@LabhanshAgrawal what do you think about the es2018 thing though?

@LabhanshAgrawal
Copy link
Collaborator

I think it makes sense.
The codebase is divided in 4 parts

app/  - already getting transpiled to es2018 by tsc.
lib/  - bundled by webpack (babel-loader) to es5 (no target specified in babel config)
        and then minified by babel (cli)
cli/  - bundled by webpack (babel-loader) to es5 (no target specified in babel config)
test/ - no transpilation, ava running with ts-node

From what I understand
We can configure Babel to target specific versions of electron and node (which support es2019 currently).
Also possible to take the versions from package.json, which will require to use babel.config .js or provide the config through webpack
For lib/ I think we can do the minification during the webpack run itself, when env is production and remove the babel cli stuff

Please correct if I missed something

@LabhanshAgrawal
Copy link
Collaborator

Also, transpiling everything atleast once is a necessity as we need to get js from ts

@Stanzilla
Copy link
Contributor Author

yup that does look correct. should probably try moving the babel stuff to es2018 first and see how it works

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

No branches or pull requests

3 participants