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

fix(storybook-builder): import both globals and globalsNameReferenceM… #2620

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

jdevega
Copy link
Contributor

@jdevega jdevega commented Jan 24, 2024

…ap from @storybook/preview/globals

What I did

  1. Import both globals and globalsNameReferenceMap exports from @storybook/preview/globals.
  2. Instead of using globals, only use it when globalsNameReferenceMap has no value to preserve retrocompatibility.

Copy link

changeset-bot bot commented Jan 24, 2024

🦋 Changeset detected

Latest commit: 010eed6

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

This PR includes changesets to release 1 package
Name Type
@web/storybook-builder 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

@@ -1,7 +1,8 @@
import rollupPluginNodeResolve from '@rollup/plugin-node-resolve';
import { getBuilderOptions } from '@storybook/core-common';
import { logger } from '@storybook/node-logger';
import { globals } from '@storybook/preview/globals';
// @ts-ignore
import { globals, globalsNameReferenceMap } from '@storybook/preview/globals';
Copy link
Member

Choose a reason for hiding this comment

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

wouldnt just the globalsNameReferenceMap be enough? Why are we using both?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

for retrocompatibility. Those using 7.5.3 or lower will have an error if we don't support the previous behaviour.

Copy link
Member

Choose a reason for hiding this comment

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

Ah I see. Could you add a comment to the import that we import both for this reason? Just so we'll know why this is in the future :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Member

Choose a reason for hiding this comment

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

Thanks :) just running CI to make sure everything passes, then we can merge it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, fixed linting problems

@jdevega jdevega force-pushed the fix-preview-import-globals branch 2 times, most recently from 7561aaa to 201887e Compare January 24, 2024 14:51
@thepassle thepassle merged commit dd1f9d8 into modernweb-dev:master Jan 24, 2024
5 of 6 checks passed
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.

None yet

2 participants