Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Don't export at all without export or export-as meta (Fix Storybook) #1143

Merged

Conversation

garrett-hopper
Copy link
Contributor

Originally changed in ec63c34 for #710

The latest version of Webpack appears to behave differently than it did at the time the change was made.

technically still exported to avoid breaking existing builds
but tools like storybook should no longer find them because
of enumerable: false.

Webpack's require shim no longer respects enumerable: false, which causes Storybook to see exports it shouldn't.

This change forces properties to not be exported unless they explicitly have ^:export (or ^{:exportAs ""}) metadata.

I'm not sure which existing builds mentioned in @thheller's comment might be broken by this change.

If that's a concern, perhaps this change should be behind some sort of flag on the ns with the default behavior being the existing "export everything, but use enumerable: false" behavior.

(It's really only necessary for module consumers that expect all exports to mean something specific, like Storybook.)

@garrett-hopper garrett-hopper changed the title Don't export at all without export or export-as meta Don't export at all without export or export-as meta (Fix Storybook) Aug 20, 2023
@thheller thheller merged commit 81c3ebb into thheller:master Sep 5, 2023
@thheller
Copy link
Owner

thheller commented Sep 5, 2023

Makes sense I guess. Accessing not-exported things worked fine in dev but broke in release anyways.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants