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

transform styled dom component usage for improved performance #154

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jantimon
Copy link
Owner

This is a nice to have performance optimizations by transforming the following code:

From:

import { styled } from "next-yak";
const button = styled.button`...`

To:

import { __yak_button } from "next-yak/internal";
const button = __yak_button`...`

Benefits:

  1. Reduces runtime overhead by eliminating proxy object property lookup
  2. Enables better tree-shaking, potentially reducing bundle size
  3. Improves minification efficiency

This optimization could lead to faster execution and smaller bundle sizes, especially beneficial for large applications with many styled components.

Copy link

codspeed-hq bot commented Aug 15, 2024

CodSpeed Performance Report

Merging #154 will not alter performance

Comparing feature/styled-dom (60058eb) with main (4a7ff24)

Summary

✅ 2 untouched benchmarks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant