forked from gatsbyjs/gatsby
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gatsby-plugin-emotion): update plugin for emotion v10 (gatsbyjs#…
…10226) # 🎉 Emotion v10 is here! 🎉 - [X] Update dependencies - [X] Update critical style handling - [X] Add Babel config for `jsx` pragma - [X] Update plugin install instructions - [X] Update Gatsby tutorial (part 4) - [X] Update the "using emotion" example
- Loading branch information
Showing
11 changed files
with
157 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,23 +4,25 @@ | |
"description": "Gatsby example site using using-emotion", | ||
"author": "Tegan Churchill <[email protected]>", | ||
"dependencies": { | ||
"emotion": "^9.2.12", | ||
"emotion-server": "^9.2.12", | ||
"@emotion/core": "^10.0.0", | ||
"@emotion/styled": "^10.0.0", | ||
"emotion": "^10.0.0", | ||
"emotion-server": "^10.0.0", | ||
"gatsby": "^2.0.0", | ||
"gatsby-plugin-emotion": "^2.0.5", | ||
"gatsby-plugin-google-analytics": "^2.0.5", | ||
"gatsby-plugin-offline": "^2.0.5", | ||
"gatsby-plugin-react-helmet": "^3.0.0", | ||
"react": "^16.4.0", | ||
"react-dom": "^16.4.0", | ||
"react-emotion": "^9.2.12", | ||
"react-helmet": "^5.2.0" | ||
}, | ||
"license": "MIT", | ||
"main": "n/a", | ||
"scripts": { | ||
"develop": "gatsby develop", | ||
"build": "gatsby build", | ||
"serve": "gatsby serve", | ||
"start": "npm run develop" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
{ | ||
"presets": [ | ||
["babel-preset-gatsby-package", { "browser": true }] | ||
] | ||
"presets": [["babel-preset-gatsby-package", { "browser": true }]] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,3 @@ | ||
/* globals window */ | ||
import { hydrate } from "emotion" | ||
import { wrapElement } from "./wrap-element" | ||
|
||
exports.onClientEntry = () => { | ||
if ( | ||
typeof window !== `undefined` && | ||
typeof window.__EMOTION_CRITICAL_CSS_IDS__ !== `undefined` | ||
) { | ||
hydrate(window.__EMOTION_CRITICAL_CSS_IDS__) | ||
} | ||
} | ||
export const wrapRootElement = ({ element }) => wrapElement(element) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from "react" | ||
import { cache } from "emotion" | ||
import { CacheProvider } from "@emotion/core" | ||
|
||
export const wrapElement = element => ( | ||
<CacheProvider value={cache}>{element}</CacheProvider> | ||
) |
Oops, something went wrong.