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

Core: Remove pointless module.hot.decline() in addons #21421

Merged
merged 1 commit into from
Mar 6, 2023

Conversation

tmeasday
Copy link
Member

@tmeasday tmeasday commented Mar 6, 2023

Closes #21340

What I did

Removed invalid ESM code from our addons. module is not defined in .mjs files, but tsup was passing this code through.

We were getting away with it because our WP rules were fairly permissive (not sure how it was working in Vite). Users seemed to trigger the issue by throwing away some of our rules, in combination with a move towards favouring .mjs more in #21161

The thing is, it didn't do anything anyway outside of developing the addon, AFAICT. @winkerVSbecks I'm not sure if we should keep it in addon-kit or not:

https://github.com/storybookjs/addon-kit/blob/4c3224fbbe9d3c663e88d11f563c91ebc10b0b4f/src/index.ts#L1-L3

How to test

Checklist

  • Make sure your changes are tested (stories and/or unit, integration, or end-to-end tests)
  • Make sure to add/update documentation regarding your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Maintainers

  • If this PR should be tested against many or all sandboxes,
    make sure to add the ci:merged or ci:daily GH label to it.
  • Make sure this PR contains one of the labels below.

["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]

@ndelangen ndelangen merged commit fdec40c into next Mar 6, 2023
@ndelangen ndelangen deleted the tom/21340-remove-old-module-hot-decline branch March 6, 2023 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: ReferenceError: module is not defined
2 participants