Skip to content

Conversation

jchansen
Copy link
Contributor

This PR converts all core lore packages to ES6 syntax and adds linting.

The primary reason for converting to ES6 syntax is to support tree-shaking, which requires generating a version of the transpiled code that leaves the import/export statements intact. This commonly results in packages being transpiled into multiple directory; a lib directory, contained the ES5 code (using require statements) and a es directory, where everything except the import/export statements are converted to ES5.

The es directory is then exposed as an entry point via the module field in the package.json file. Webpack 2 is configured to look for the module entry point before the main entry point, and will use that code if it exists.

This PR does not expose the module entry point because it makes for a breaking change in any ES5-style Lore projects.

The module entry point will be exposed as part of v0.13, along with making ES6/ESNext the primary syntax, and de-emphasizing ES5.

@jchansen jchansen force-pushed the provide-es6-modules branch from be0c0b4 to a233009 Compare July 19, 2017 08:21
@jchansen jchansen merged commit 73f2b60 into master Jul 19, 2017
@jchansen jchansen deleted the provide-es6-modules branch August 29, 2023 23:37
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

Successfully merging this pull request may close these issues.

1 participant