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

Shorten JSXStyle generated prop names. Fix #530 #534

Merged
merged 1 commit into from
Dec 27, 2018

Conversation

shYkiSto
Copy link
Contributor

Updating JSXStyle generated prop names to a shorter version:

  • styleId - > id
  • css -> leveraging JSX's children (the css content will be enclosed into <JSXStyle></JSXStyle> element.

Transpiled version changes from:

// ...
React.createElement(JSXStyle, {
    styleId: "3463673021",
    css: ".test.jsx-3463673021{color:red;}"
});
// ...

to:

// ...
React.createElement(JSXStyle, {
    id: "3463673021"
}, ".test.jsx-3463673021{color:red;}");
// ....

While it helps reduce the final bundle size, it also resolves the incompatibility issue with styled-components (details)

@shYkiSto shYkiSto requested a review from giuseppeg as a code owner December 18, 2018 09:09
@shYkiSto
Copy link
Contributor Author

shYkiSto commented Dec 20, 2018

Hey @timneutkens @giuseppeg,

Just a kindly reminder in case you would like to, and have time to, review these changes :)

I would appreciate if we could publish new version that fixes the incompatibility issue with styled-components before the holidays(some kind of a Christmas present for everyone, if that matters)

Thank you!
Siarhei

Copy link
Collaborator

@giuseppeg giuseppeg left a comment

Choose a reason for hiding this comment

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

awesome thank you for the PR and sorry for the delay!

@shYkiSto shYkiSto force-pushed the fix-jsx-styled-props branch from 87c25db to 6a3e1aa Compare December 21, 2018 01:27
@giuseppeg giuseppeg merged commit d95f767 into vercel:master Dec 27, 2018
@giuseppeg
Copy link
Collaborator

giuseppeg commented Dec 27, 2018

@shYkiSto great PR! thank you so much for contributing and sorry for the slow response :)

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.

2 participants