Open prateekbh opened 5 years ago
Looks good, but points to discuss:
tsickle
to annotate code for closurees2015
or newer, because almost all browsers support that newer features (e.g. async functions)Lets skip closure shall we? Its a huge hugeeee maintenance effort.
tsickle
is just a drop in typescript compiler, which handles that
Lets look at that but not make this a blocker for 2.0. Have had some bad experiences with closure compiler in past
I would try it and if it doesn't work as a drop in, I would postpone it to after 2.0
So can we agree on having only esm
and es5
?
What browsers should we support for es5
?
I would say:
Actually I was going for es5 and fesm(flat esm) For es5: Babel-preset-env: last 2 browsers and IE11 For FESM: Babel-preset-env: esm
Or just use https://www.npmjs.com/package/babel-esm-plugin
Actually I was going for es5 and fesm(flat esm)
Do you know a build system, that can handle fesm? I do not. And I don't know any advantage of fesm vs. esm
Babel-preset-env: esm
We should'n need babel at all
Or just use https://www.npmjs.com/package/babel-esm-plugin
But that's only for webpack
Esm uses native es modules but fesm does not.
Fesm are flattened modules, like from webpack. No native modules but the transportation is targeted to es2015.
This means we don't have to support native modules but we can ship stuff like async await, classes and more of es6
This means we don't have to support native modules but we can ship stuff like async await, classes and more of es6
We should definitely include the files in es module format, without that there is no tree-shaking and with es modules included in all modern browser and node.js it will definitely the future, also because it's the only standardized module system.
Esm uses native es modules but fesm does not.
@prateekbh Reading the docs, they do use es modules, but there is no good build system, but export {[...]} from "[...]";
does work
We should bundle both esm/es5 files in every package and expose them using fesm format
Spec details: "Angular Package Format" on Google Docs