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

core: Bump package versions and fix related TS errors #294

Merged
merged 4 commits into from
Nov 4, 2024

Conversation

brijeshb42
Copy link
Contributor

@brijeshb42 brijeshb42 commented Nov 1, 2024

There was one breaking change in Emotion. Some common types had been moved to @emotion/serialize.

There is also a small change in how we do conversion for !important. Currently, we do it by replacing ! with IMP and then reconverting back.
In this PR, I have changed that to just encode and decode to and from base64. So we don't need special handling for ! character.

I encountered these errors while setting up the Pigment CSS docs workspace.

@brijeshb42 brijeshb42 added the bug 🐛 Something doesn't work label Nov 1, 2024
@brijeshb42 brijeshb42 requested a review from siriwatknp November 1, 2024 10:11
There is also a small change in how we do conversion for !important.
Currently, we do it by replacing ! with __IMP__ and then reconverting
back.
In this PR, I have changed that to just encode and decode to and from
base64. So we don't need special handling for ! character
"@types/node": "^20.5.7",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.2.19",
"@types/node": "^18.19.63",
Copy link
Member

Choose a reason for hiding this comment

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

This's a downgrade. Is this correct?

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 is. v20 never actually was used since at the root, in resolutions, it was still v18. I have kept it at 18 since we are currently using node v18 to build in CI.

Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

Left few comments, please check them before merging.

@@ -1,7 +1,7 @@
/* eslint-env node */
// eslint-ignore-next-line import/no-unresolved
const { withPigment } = require('@pigment-css/nextjs-plugin');
const { experimental_extendTheme: extendTheme } = require('@mui/material/styles');
const { extendTheme } = require('@mui/material/styles');
Copy link
Member

Choose a reason for hiding this comment

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

For a next PR, we could just use createTheme with the css vars option.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. I'll update it in the actual docs PR.

"@mui/system": "next",
"@mui/icons-material": "next",
"clsx": "^2.1.0",
"@mui/utils": "6.1.6",
Copy link
Member

Choose a reason for hiding this comment

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

We should replace these to latest, no?

Copy link
Contributor Author

@brijeshb42 brijeshb42 Nov 4, 2024

Choose a reason for hiding this comment

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

IMO, it makes sense for examples. But for local apps, I'd prefer to manually update the versions since some of the things started breaking especially since currently v5 was being used (in the lockfile).

@@ -1,6 +1,6 @@
export const loader = function virtualFileLoader() {
const callback = this.async();
const resourceQuery = this.resourceQuery.slice(1);
const { source } = JSON.parse(decodeURIComponent(resourceQuery));
return callback(null, source.replaceAll('__IMP__', '!important'));
const { source } = JSON.parse(decodeURIComponent(decodeURI(atob(resourceQuery))));
Copy link
Member

Choose a reason for hiding this comment

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

👍

@@ -9,7 +9,7 @@ import type {
} from '@wyw-in-js/processor-utils';
import type { Replacements, Rules } from '@wyw-in-js/shared';
import { ValueType } from '@wyw-in-js/shared';
import type { CSSInterpolation } from '@emotion/css';
import type { CSSInterpolation } from '@emotion/serialize';
Copy link
Member

Choose a reason for hiding this comment

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

How did this breaking change land in an minor 😕

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah. I was surprised as well.

@brijeshb42 brijeshb42 merged commit b9d3611 into mui:master Nov 4, 2024
12 checks passed
@brijeshb42 brijeshb42 deleted the bump-versions branch November 4, 2024 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants