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

Adds the can/es module for tree-shaking bundlers #4085

Merged
merged 2 commits into from
Apr 2, 2018
Merged

Adds the can/es module for tree-shaking bundlers #4085

merged 2 commits into from
Apr 2, 2018

Conversation

matthewp
Copy link
Contributor

This change adds a new module, can/es which exports everything from
core as named exports. This enables people to import only the parts
of CanJS they need:

import { Component, DefineMap } from "can/es";

Provided they use a tree-shaking capable bundler, the bundle size will
not be too large.

Closes #4013

This change adds a new module, `can/es` which exports everything from
__core__ as named exports. This enables people to import only the parts
of CanJS they need:

```js
import { Component, DefineMap } from "can/es";
```

Provided they use a tree-shaking capable bundler, the bundle size will
not be too large.

Closes #4013

## Names

The names that can be exported by this module mirror what is part of the `can` namespace object that you get from `import can from "can"`. You can see the names that `can/es` exports [here](https://github.com/canjs/canjs/blob/master/es.js).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be

The names that can be imported from this module...

or

The names that are exported by this module...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll go with the former.

@phillipskevin phillipskevin merged commit 5b6b617 into master Apr 2, 2018
@phillipskevin phillipskevin deleted the es2 branch April 2, 2018 21:35
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.

2 participants