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

[zero][vite] Modify plugin to transform node_modules #39517

Merged
merged 4 commits into from
Oct 20, 2023

Conversation

brijeshb42
Copy link
Contributor

@brijeshb42 brijeshb42 commented Oct 19, 2023

This feature allows users to specify a list of packages
that also uses zero runtime and transform the files at
build time. Default behavior is not transform any files
from node_modules.

Also, fix a bug where the transformation did not allow you to write callback functions for css variables.

@brijeshb42 brijeshb42 added the package: system Specific to @mui/system label Oct 19, 2023
@mui-bot
Copy link

mui-bot commented Oct 19, 2023

Netlify deploy preview

https://deploy-preview-39517--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against e346f8f

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 19, 2023
@@ -82,16 +76,19 @@ const cssFunctionTransformerPlugin = declare<BabelPluginOptions>((api, pluginOpt
if (themeKey === 'typography' && val === 'inherit') {
return;
}
const propertyThemeKey = themeKey ?? val.split('.')[0];
Copy link
Member

Choose a reason for hiding this comment

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

Found one more bug. With:

export const Main = styled('main')({,
  '--test': (props) => props.test,
});

produces:

image

I think the variable should not be created if the result of the callback is undefined | null | ''

Copy link
Member

Choose a reason for hiding this comment

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

I tried to fix it but I am not sure where to find.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It'll need to be fixed in styled.ts of zero-runtime package since this function is called at runtime.
Right now it only checks for number/string. It'll need to account for undefined

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in latest commit.

Copy link
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

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

👍

This feature allows users to specify a list of packages
that also uses zero runtime and transform the files at
build time. Default behavior is not do transform any files
from node_modules.
presence in sxConfig. This did not allow you to write
callback functions for css variables.
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 20, 2023
@brijeshb42 brijeshb42 force-pushed the zero-vite-library branch 2 times, most recently from 58bf37e to 3f0e2df Compare October 20, 2023 08:25
@brijeshb42 brijeshb42 merged commit 9b74132 into mui:master Oct 20, 2023
19 checks passed
@brijeshb42 brijeshb42 deleted the zero-vite-library branch October 20, 2023 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: system Specific to @mui/system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants