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

[styles] Add a new injectFirst prop #15028

Merged
merged 1 commit into from Mar 25, 2019

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Mar 24, 2019

One slice of #14999. The property should be enough for 80% of the cases:

 import React from "react";
 import { render } from "react-dom";
-import { create } from "jss";
-import { StylesProvider, jssPreset } from '@material-ui/styles';
+import { StylesProvider } from '@material-ui/styles';
 import StyledComponentsButton from "./StyledComponentsButton";

-const styleNode = document.createComment("insertion-point-jss");
-document.head.insertBefore(styleNode, document.head.firstChild);
-
-const jss = create({
-  ...jssPreset(),
-  insertionPoint: "insertion-point-jss"
-});
-
 const App = () => (
-  <StylesProvider jss={jss}>
+  <StylesProvider injectFirst>
     <StyledComponentsButton />
   </StylesProvider>
 );

@oliviertassinari oliviertassinari added the package: styles Specific to @mui/styles. Legacy package, @material-ui/styled-engine is taking over in v5. label Mar 24, 2019
@mui-pr-bot
Copy link

mui-pr-bot commented Mar 24, 2019

@material-ui/core: parsed: +0.09% , gzip: +0.17%
@material-ui/lab: parsed: +0.21% , gzip: +0.35%
@material-ui/styles: parsed: +0.61% , gzip: +0.85%

Details of bundle changes.

Comparing: e6594d2...addb1ac

bundle parsed diff gzip diff prev parsed current parsed prev gzip current gzip
@material-ui/core +0.09% 🔺 +0.17% 🔺 352,645 352,964 90,524 90,677
@material-ui/core/Paper +0.47% 🔺 +0.71% 🔺 67,382 67,701 19,709 19,849
@material-ui/core/Paper.esm +0.52% 🔺 +0.84% 🔺 61,143 61,462 18,799 18,957
@material-ui/core/Popper 0.00% 0.00% 30,460 30,460 10,527 10,527
@material-ui/core/styles/createMuiTheme 0.00% 0.00% 17,384 17,384 5,727 5,727
@material-ui/core/useMediaQuery 0.00% 0.00% 2,469 2,469 1,038 1,038
@material-ui/lab +0.21% 🔺 +0.35% 🔺 152,123 152,442 44,511 44,666
@material-ui/styles +0.61% 🔺 +0.85% 🔺 52,565 52,884 15,330 15,461
@material-ui/system 0.00% 0.00% 17,138 17,138 4,519 4,519
Button +0.35% 🔺 +0.64% 🔺 90,889 91,208 26,921 27,092
Modal +0.38% 🔺 +0.61% 🔺 84,633 84,952 25,232 25,387
colorManipulator 0.00% 0.00% 3,232 3,232 1,300 1,300
docs.landing 0.00% 0.00% 49,958 49,958 10,837 10,837
docs.main +0.05% 🔺 +0.06% 🔺 649,537 649,856 201,606 201,717
packages/material-ui/build/umd/material-ui.production.min.js 0.00% 0.00% 301,793 301,793 83,744 83,744

Generated by 🚫 dangerJS against addb1ac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: styles Specific to @mui/styles. Legacy package, @material-ui/styled-engine is taking over in v5.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants