- Create as native ESM; refactor tests to ESM#55
- Create as native ESM; refactor tests to ESM#55brettz9 wants to merge 1 commit intoboblauer:masterfrom
Conversation
|
Also wondering if you might have some idea if and when you might get to a review on these PRs? Thanks! |
|
Hi, any chance you might review this and the other PRs, @boblauer (gradually or as you prefer) ? Thanks! |
|
I'm not too familiar with native esm modules, so this is hard for me to review and fully understand the implications.
Can you expand upon what this means? |
|
Sure. Node can now import and export ESM modules (as of Node 12 especially) just as it can export CommonJS-style However, since people will no doubt still be using CommonJS for some time, setting By default, package encapsulation occurs when adding In this PR, I've kept with this principle of encapsulation and only allowed access to :
I don't think you really have any other files that you'd want to expose, but if you do, I could add them. |
|
Any clarifying questions? |
This is a breaking change in adding
enginesto 12 (though Node 10 is now EOL).It is also breaking because now only the paths added to
exportsare available, but I imagine providing the UMD and ESM distribution files as well as TypeScript declaration file should be all that ought to be desirable.Besides adding native ESM, it also adds an ESM distribution which browser might use directly (and without needing a TypeScript build step).