Open Stanzilla opened 4 years ago
@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.
Babel compiles the files from lib, but it doesn't check for type errors
@LabhanshAgrawal what do you think about the es2018 thing though?
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
Also, transpiling everything atleast once is a necessity as we need to get js from ts
yup that does look correct. should probably try moving the babel stuff to es2018 first and see how it works
Since we're only targeting electron, we could just move everything over to es2018 by default and stop transpiling a few things, no?