Hacker News new | ask | show | jobs
by hzoo 3098 days ago
Oh cool, didn't realize someone posted to HN (I haven't been on HN in a while =D)! Open to questions and clarifications (on the actual content of the upcoming release, process, how to help, future, whatever)!

There are a few things we need to do like a upgrade tool and some other things that haven't been addressed like how library/module authors should publish to npm (do you include/exclude polyfills, do you compile down to ES5 or start introducing ES6+ code under a different folder or package.json string like "module" or "es2015" which will be out of date, etc)

Also didn't write much about the Typescript support yet but we want to help people use that too if that helps with their development

1 comments

I am very interested about publishing ES6+ code. https://philipwalton.com/articles/deploying-es2015-code-in-p... was very inspirational on this topic, but the fact that 99% of the libraries I use are publishing transpiled code (+ polyfill) is a big disappointment.

From what I understood, there is currently nothing to allow both ES5 and ES6 code to be published and let the bundler choose which one to include. Any ideas on how to change this?

> From what I understood, there is currently nothing to allow both ES5 and ES6 code to be published and let the bundler choose which one to include. Any ideas on how to change this?

Yeah it's mostly a conventional then we have to figure out.

Some people have different "dist" folders like say with redux_- https://unpkg.com/redux@3.7.2/ there is `src`, `lib`, `es`, `dist`.

In package.json, you can specify

  "main": "lib/index.js",
  "module": "es/index.js",
  "jsnext:main": "es/index.js",
  "typings": "./index.d.ts",
which a bundler like webpack will look at. The problem now mostly is that "module" assumes es modules but not a specific level of ES/polyfills and we want a way to do that instead. Making a yearly "es2015", "es2016" field seems weird and we want one that is up to date like preset-env?