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

chore(web-components): Normalize exports paths #32451

Merged

Conversation

radium-v
Copy link
Contributor

@radium-v radium-v commented Sep 3, 2024

Previous Behavior

The default exports for components pointed to the define.js files. This is convenient when you want to import the side-effectful define() calls for the browser. However, importing specific exports from components has to be done at the top level.

New Behavior

  • The default exports for all components come from <component-name>.js
  • Modules with define() calls can be imported at <component-name>/define.js
  • Option exports can be imported from <component-name>/options.js
  • Per-component template exports can be imported directly from <component-name>/template.js
  • Per-component style exports can be imported directly from <component-name>/styles.js
  • Per-component definitions can be imported directly from <component-name>/definition.js

Reviewer Notes

This PR also changes the sideEffects array to use ./dist/esm/**/define.js instead of individual entries for every define.js file. sideEffects is a nonstandard feature mainly used by Webpack, so I'm not sure if this will work everywhere. Here's the documentation for that feature.

@fabricteam
Copy link
Collaborator

📊 Bundle size report

✅ No changes found

@fabricteam
Copy link
Collaborator

🕵 fluentui-web-components-v3 No visual regressions between this PR and main

@radium-v radium-v marked this pull request as ready for review September 3, 2024 20:05
@radium-v radium-v requested a review from a team as a code owner September 3, 2024 20:05
@radium-v radium-v requested a review from chrisdholt September 3, 2024 20:06
@radium-v radium-v merged commit dcc17c9 into microsoft:master Sep 3, 2024
18 checks passed
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.

6 participants