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

Fixed a bundling issue that prevented the keys() export to be preserved in the previous release #3118

Merged
merged 1 commit into from
Mar 4, 2022

Conversation

Andarist
Copy link
Member

@Andarist Andarist commented Mar 4, 2022

fixes #3115

@changeset-bot
Copy link

changeset-bot bot commented Mar 4, 2022

🦋 Changeset detected

Latest commit: 8aa614b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
xstate Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codesandbox-ci
Copy link

codesandbox-ci bot commented Mar 4, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 8aa614b:

Sandbox Source
XState Example Template Configuration
XState React Template Configuration

@ghost
Copy link

ghost commented Mar 4, 2022

CodeSee Review Map:

Review these changes using an interactive CodeSee Map

Review in an interactive map

View more CodeSee Maps

Legend

CodeSee Map Legend

export default [
createNpmConfig({
input: 'src/index.ts',
input: npmInputs,
Copy link
Member Author

Choose a reason for hiding this comment

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

Even though we were using preserveModules here the whole thing was still subject to tree-shaking and since keys was not really used by anything... it got removed by Rollup. By providing an array of inputs we let Rollup to know that we expect stuff to be importable directly from those entries so it has to preserve every public export of every input - and that makes keys to be preserved

@@ -48,9 +49,11 @@ const createUmdConfig = ({ input, output, target = undefined }) => ({
]
});

const npmInputs = glob.sync('src/!(scxml|invoke|model.types|typegenTypes).ts');
Copy link
Member Author

Choose a reason for hiding this comment

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

those were mainly type-only files and Rollup has been complaining about empty entries so I've filtered them out. The whole thing should still work correctly - and those files are still accessible at the type-level because .d.ts files are still produced for them

@Andarist Andarist merged commit 28e3530 into main Mar 4, 2022
@Andarist Andarist deleted the andarist/fix-3115 branch March 4, 2022 13:23
@github-actions github-actions bot mentioned this pull request Mar 4, 2022
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.

@xstate/test
2 participants