transform styled dom component usage for improved performance#154
Merged
Jan Nicklas (jantimon) merged 82 commits intomainfrom Jan 10, 2025
Merged
transform styled dom component usage for improved performance#154Jan Nicklas (jantimon) merged 82 commits intomainfrom
Jan Nicklas (jantimon) merged 82 commits intomainfrom
Conversation
CodSpeed Performance ReportMerging #154 will not alter performanceComparing Summary
|
# Conflicts: # packages/next-yak/runtime/styled.tsx
🦋 Changeset detectedLatest commit: b613991 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 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 |
…import only stays if it's needed
# Conflicts: # packages/yak-swc/yak_swc/src/lib.rs
packages/yak-swc/yak_swc/tests/fixture/nested-dynamic-mixin/output.stderr
Show resolved
Hide resolved
# Conflicts: # packages/next-yak/runtime/__tests__/attrs.test.tsx # packages/next-yak/runtime/styled.tsx
Luca Schneider (Mad-Kat)
previously approved these changes
Dec 11, 2024
Remo Vetere (rvetere)
previously approved these changes
Jan 8, 2025
Remo Vetere (rvetere)
previously approved these changes
Jan 8, 2025
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.
When looking at the minified next-yak usages I had an idea for a smaller bundle size
Initially, we transformed the imports from:
to:
This worked well - but unfortunately we noticed that Webpack was wrapping our function calls with
(0, __yakButton)to ensure properthisbinding..After we learned that additional transform we went a step further - Instead of individual imports, we now use:
This eliminates the need for webpack's
thisbinding wrapper and once minified results in output likea.b("button")Example App Build Size
before (main + next15 + react19)
after