Open
Conversation
🦋 Changeset detectedLatest commit: a3ca889 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
askoufis
reviewed
Feb 20, 2024
askoufis
reviewed
Feb 26, 2024
askoufis
reviewed
May 23, 2024
Contributor
askoufis
left a comment
There was a problem hiding this comment.
Feel like we should show the API in the changeset, and be a bit more clear about its usage.
|
|
||
| // Optional: | ||
| title: 'My Awesome Library', | ||
| entry: './src/entry', |
Contributor
There was a problem hiding this comment.
Suggested change
| entry: './src/entry', | |
| entry: './src/entry.js', |
Comment on lines
+166
to
+169
| ```js | ||
| import '../path/to/your/theming-system/reset'; | ||
| import '../path/to/your/theming-system/global-styles.css'; | ||
| ``` |
Contributor
There was a problem hiding this comment.
Suggested change
| ```js | |
| import '../path/to/your/theming-system/reset'; | |
| import '../path/to/your/theming-system/global-styles.css'; | |
| ``` | |
| ```js | |
| // playroom.config.js | |
| entry: './src/entry.js', | |
| ``` | |
| ```js | |
| // ./src/entry.js | |
| import '../path/to/your/theming-system/reset'; | |
| import '../path/to/your/theming-system/global-styles.css'; | |
| ``` |
Comment on lines
+9
to
+12
| ```js | ||
| import '../path/to/your/theming-system/reset'; | ||
| import '../path/to/your/theming-system/global-styles.css'; | ||
| ``` |
Contributor
There was a problem hiding this comment.
Suggested change
| ```js | |
| import '../path/to/your/theming-system/reset'; | |
| import '../path/to/your/theming-system/global-styles.css'; | |
| ``` | |
| ```js | |
| // playroom.config.js | |
| entry: './src/entry.js', | |
| ``` | |
| ```js | |
| // ./src/entry.js | |
| import '../path/to/your/theming-system/reset'; | |
| import '../path/to/your/theming-system/global-styles.css'; | |
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It became clear in seek-oss/braid-design-system#1448 that Playroom needed...
After scanning the module graph, here are the relavant code paths:
entry src/index.js
entry src/frame.js
entry src/preview.js
My first idea was to import a module at the top of each of the webpack-defined
__PLAYROOM_ALIAS__*__aliases. That's because we might not know which one loads first, if we were to convert the code to ESM/TypeScript (which might happen in #313). So I wasn't convinced if it was a good idea.This implementation loads the entry at the top of each webpack entry:
playroom/lib/makeWebpackConfig.js
Lines 42 to 46 in 3aa9edd
This ensures the entry is imported only once per bundle, which is what we want. It also avoids the dual ESM/CJS package hazard, because the entry is loaded by webpack, not by our own code which can be
importorrequirecalls.