-
Notifications
You must be signed in to change notification settings - Fork 72
LG-5635 fix unexpected @emotion imports in umd bundle of icons #3319
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
base: main
Are you sure you want to change the base?
LG-5635 fix unexpected @emotion imports in umd bundle of icons #3319
Conversation
🦋 Changeset detectedLatest commit: e2fd584 The changes in this PR will be included in the next version bump. This PR includes changesets to release 72 packages
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 |
|
Size Change: +82 B (0%) Total Size: 1.79 MB
ℹ️ View Unchanged
|
|
Coverage after merging cloudp-335379-fail-on-race-cond-on-icons into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a race condition in the icon package build process that was causing unexpected @emotion imports in UMD bundles. The core issue was that asynchronous buildPackage calls weren't being awaited, allowing subsequent build steps to run before bundling completed.
Key changes:
- Made
buildPackagefunction properly async/await instead of using promise chaining - Added await to
buildPackagecall in icon build script - Extended validation to check index.js for @emotion imports
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tools/build/src/rollup/build-package.ts | Converted promise chaining to async/await pattern to fix race condition |
| packages/icon/scripts/build/build.ts | Added await to buildPackage call to ensure build completes before validation |
| packages/icon/scripts/postbuild/index.ts | Removed skip logic for index.js to validate all files for @emotion imports |
| .changeset/great-birds-dress.md | Added changeset documenting the validation improvement |
| export async function buildPackage({ | ||
| verbose, | ||
| }: BuildPackageOptions): Promise<void> { |
Copilot
AI
Nov 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function JSDoc comment should be updated to reflect that this is now an async function that returns a Promise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's obvious from the signature.
🎫 Ticket
LG-5635
📝 Description
This PR fixes unexpected @emotion imports in the UMD bundle of icons by correcting promise handling in the build process where buildPackage calls weren't being awaited, which could cause race conditions.
🧪 Testing
index.jsfor@emotionimports.act -j build -W ./.github/workflows/pr.yml --no-cache-server, I can confirm that after this change the race condition does not happen anymore.