-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
[feature] Implement useTheme processor #94
Conversation
2e9c97b
to
3d5be1b
Compare
to replace the useTheme function calls with an import from Pigment package
3d5be1b
to
2433547
Compare
@@ -0,0 +1,117 @@ | |||
import { useTheme as _useTheme } from '@pigment-css/react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is the runtime useTheme
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's the main PR now - #105
See the description.
|
||
export type TemplateCallback = (params: Record<string, unknown> | undefined) => string | number; | ||
|
||
export class UseThemeProcessor extends BaseProcessor { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that we were going with option B (babel plugin instead of tagProcessor) from https://www.notion.so/mui-org/material-ui-pigment-non-processor-replacement-0c7e4b150c90499b93cd8fc17c31a009?pvs=4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realised that tagProcessor handles all the different kinds of imports that we can have, ie,
import * as lib from 'lib';
import {useTheme} from 'lib';
require('lib')
interopRequire(require('lib'));
Doing it ourselves might miss something especially for library code where most of the code is transpiled.
Closing in favor or #105 |
to replace the useTheme function calls with an import from Pigment package.
Also re-export
RtlProvider
from@mui/system
.Fixes mui/material-ui#42260
There will be a follow-up PR to implement the runtime part from a generated source at build-time.