You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Breaks a latent circular import in the styled-system that started crashing the Dashboard dev build once the dev Rspack config turned off tree-shaking (providedExports/usedExports).
The loop: InternalThemeProvider imports useAppearance from the customizables barrel, which eagerly loads primitives, whose Box calls createVariants from the styledSystem barrel at module-eval time, re-entering a barrel that hasn't finished initializing. useAppearance actually lives in the customizables/AppearanceContext leaf, and that leaf's subtree only references styledSystem through a type-only import, so pointing the import there directly pulls nothing back in and severs the cycle.
InternalThemeProvider imported useAppearance from the customizables barrel, which eagerly loads primitives; Box then calls createVariants from the styledSystem barrel at module-eval time, closing a cycle back into a barrel that has not finished initializing. Import useAppearance from customizables/AppearanceContext (a leaf that only references styledSystem via a type-only import) so the barrel edge is dropped and the cycle is broken. Latent under tree-shaking; surfaced when the dev Rspack config disabled providedExports/usedExports.
This PR resolves a circular import issue in the styled-system module. The fix changes InternalThemeProvider to import useAppearance directly from the AppearanceContext module instead of importing it through the customizables barrel export. This direct import breaks the circular dependency chain that could cause module initialization to fail in bundlers when tree-shaking is disabled. A changeset documents the patch-level release.
The title 'fix(ui): break circular import between styled-system and primitives' accurately describes the main change: breaking a circular import in the styled-system. It is concise, specific, and directly relates to the changeset.
Description check
✅ Passed
The description clearly explains the circular import issue, the specific loop causing the problem, and how the fix resolves it by changing the import source. It is directly related to the changeset.
Docstring Coverage
✅ Passed
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check
✅ Passed
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
✅ Passed
Check skipped because no linked issues were found for this pull request.
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
Comment @coderabbitai help to get the list of available commands and usage tips.
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
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.
Breaks a latent circular import in the styled-system that started crashing the Dashboard dev build once the dev Rspack config turned off tree-shaking (
providedExports/usedExports).The loop:
InternalThemeProviderimportsuseAppearancefrom thecustomizablesbarrel, which eagerly loadsprimitives, whoseBoxcallscreateVariantsfrom thestyledSystembarrel at module-eval time, re-entering a barrel that hasn't finished initializing.useAppearanceactually lives in thecustomizables/AppearanceContextleaf, and that leaf's subtree only referencesstyledSystemthrough a type-only import, so pointing the import there directly pulls nothing back in and severs the cycle.