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

Update package.json with fesm2015 #1273

Open
prateekbh opened this issue Jan 26, 2019 · 12 comments
Open

Update package.json with fesm2015 #1273

prateekbh opened this issue Jan 26, 2019 · 12 comments
Assignees

Comments

@prateekbh
Copy link
Owner

prateekbh commented Jan 26, 2019

We should bundle both esm/es5 files in every package and expose them using fesm format

Spec details:
"Angular Package Format" on Google Docs

@cromefire
Copy link
Collaborator

cromefire commented Jan 27, 2019

Looks good, but points to discuss:

@prateekbh
Copy link
Owner Author

Lets skip closure shall we? Its a huge hugeeee maintenance effort.

@cromefire
Copy link
Collaborator

tsickle is just a drop in typescript compiler, which handles that

@prateekbh
Copy link
Owner Author

Lets look at that but not make this a blocker for 2.0. Have had some bad experiences with closure compiler in past

@cromefire
Copy link
Collaborator

I would try it and if it doesn't work as a drop in, I would postpone it to after 2.0

@cromefire
Copy link
Collaborator

So can we agree on having only esm and es5?
What browsers should we support for es5?
I would say:

  • Chrome: last 2 versions
  • Firefox: last 2 versions
  • Firefox ESM
  • Safari: last 2 versions
  • Edge: last version
  • IE: ? version

@prateekbh
Copy link
Owner Author

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

@prateekbh
Copy link
Owner Author

@cromefire
Copy link
Collaborator

cromefire commented Feb 17, 2019

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

@cromefire cromefire self-assigned this Feb 17, 2019
@prateekbh
Copy link
Owner Author

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

@cromefire
Copy link
Collaborator

cromefire commented Feb 17, 2019

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.

@cromefire
Copy link
Collaborator

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

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

2 participants