Skip to content

Add esm support to shared package #983

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

Merged
merged 1 commit into from
May 5, 2020
Merged

Conversation

TrySound
Copy link
Contributor

@TrySound TrySound commented May 4, 2020

Enabled tslib to prevent emitting helpers with top level this which
does not exist in es modules. For some reason tslib has different and
correct helpers.

Commonjs artifacts are moved into cjs folder. Added esm folder near it.
package.json routes are created for each module via cherry-pick package.

@TrySound TrySound requested review from aleclarson and drcmda May 4, 2020 08:46
@TrySound
Copy link
Contributor Author

TrySound commented May 4, 2020

Have no idea why tests failed.

@aleclarson aleclarson force-pushed the v9 branch 2 times, most recently from b4272bd to 43a994a Compare May 5, 2020 20:53
Enabled tslib to prevent emitting helpers with top level `this` which
does not exist in es modules. For some reason tslib has different and
correct helpers.

Commonjs artifacts are moved into cjs folder. Added esm folder near it.
package.json routes are created for each module via cherry-pick package.
@aleclarson aleclarson merged commit 283d494 into pmndrs:v9 May 5, 2020
@aleclarson
Copy link
Contributor

Thanks!

cherry-pick is a neat little tool 😮

@aleclarson
Copy link
Contributor

I noticed a ./dist/createInterpolator.test/ directory is created. Not a big deal, but I wonder if there's a way to avoid that.

@TrySound
Copy link
Contributor Author

TrySound commented May 5, 2020

Maybe we can add the feature to cherry-pick. Do you mind to release current changes? We have to alias local copy of "shared" package to build spring with rollup.

@aleclarson
Copy link
Contributor

aleclarson commented May 5, 2020

Nested directories aren't supported by cherry-pick either. Andarist/cherry-pick#8

So the src/types directory isn't being copied.

edit: Well, dist/esm/types and dist/cjs/types do exist, but not the dist/types package. But that's okay, I can work around that by moving src/types/index.ts to src/types.ts and then avoid importing from shared/types/example.

@TrySound
Copy link
Contributor Author

TrySound commented May 5, 2020

Types could be imported from index.ts with import type {} syntax to prevent bundle bloating.

@aleclarson
Copy link
Contributor

Do you mind to release current changes?

#985

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