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

fix: handle circular import issue in a compiler friendly way #6812

Merged
merged 1 commit into from
May 30, 2024

Conversation

stipsan
Copy link
Member

@stipsan stipsan commented May 30, 2024

Description

By moving the import to colocate with the StyledCard definition we're able to avoid the circular deps issue in CJS, and regain the benefit of declaring the styled(PreviewCard) on the top-level instead of at runtime in that the CSS is known ahead of time for styled-components.

What to review

It makes sense what it's named and its internal warning.

Testing

I tested it manually, but I'm not familiar with the original cjs bundle issue being referred to, can @bjoerge advice?

Notes for release

N/A as it's an internal refactor that allows React Compiler but is otherwise the same as before

Copy link

vercel bot commented May 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
page-building-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 30, 2024 2:25pm
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 30, 2024 2:25pm
test-compiled-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 30, 2024 2:25pm
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 30, 2024 2:25pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 30, 2024 2:25pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview May 30, 2024 2:25pm

@stipsan stipsan requested a review from a team as a code owner May 30, 2024 14:20
@stipsan stipsan requested review from binoy14 and removed request for a team May 30, 2024 14:20
@stipsan stipsan enabled auto-merge May 30, 2024 14:20
Copy link
Contributor

No changes to documentation

@stipsan stipsan force-pushed the fix-preview-card-compiler-issue branch from 240b325 to 7ef7ac1 Compare May 30, 2024 14:21
Copy link
Contributor

github-actions bot commented May 30, 2024

Component Testing Report Updated May 30, 2024 2:29 PM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 35s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 6s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 25s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 31s 11 7 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 14s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 8s 3 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 35s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 21s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 3s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 6s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 21s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 14s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 30s 12 0 0

Copy link
Contributor

@binoy14 binoy14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense to me, thanks!

@stipsan stipsan added this pull request to the merge queue May 30, 2024
Merged via the queue into next with commit 8ac809f May 30, 2024
40 of 43 checks passed
@stipsan stipsan deleted the fix-preview-card-compiler-issue branch May 30, 2024 14:56
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.

2 participants