├── index.js ├── CHANGELOG.md ├── gatsby-browser.js ├── package.json ├── README.md └── LICENSE /index.js: -------------------------------------------------------------------------------- 1 | // noop 2 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | ## 1.0.0 - 2019.11.03 4 | ### Added 5 | * Initial release 6 | -------------------------------------------------------------------------------- /gatsby-browser.js: -------------------------------------------------------------------------------- 1 | // gatsby-browser.js 2 | const ReactDOM = require('react-dom'); 3 | 4 | exports.replaceHydrateFunction = () => { 5 | return (element, container, callback) => { 6 | ReactDOM.createRoot(container, { 7 | hydrate: true, 8 | hydrationOptions: { onHydrated: callback }, 9 | }).render(element); 10 | }; 11 | }; 12 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "name": "Andrew Welch", 4 | "email": "andrew@nystudio107.com" 5 | }, 6 | "bugs": { 7 | "url": "https://github.com/nystudio107/gatsby-concurrent-mode/issues" 8 | }, 9 | "bundleDependencies": false, 10 | "deprecated": false, 11 | "description": "Enable Concurrent Mode in in React for Gatsby projects.", 12 | "engines": { 13 | "node": ">=8.0.0" 14 | }, 15 | "homepage": "https://github.com/nystudio107/gatsby-concurrent-mode", 16 | "keywords": [ 17 | "gatsby", 18 | "gatsby-plugin", 19 | "concurrent", 20 | "mode" 21 | ], 22 | "license": "MIT", 23 | "main": "index.js", 24 | "name": "gatsby-concurrent-mode", 25 | "peerDependencies": { 26 | "gatsby": "^2.0.0" 27 | }, 28 | "version": "1.0.0" 29 | } 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # gatsby-concurrent-mode 2 | 3 | ## About `gatsby-concurrent-mode` 4 | 5 | The `gatsby-concurrent-mode` plugin enables [Concurrent Mode](https://reactjs.org/docs/concurrent-mode-intro.html) in in React for Gatsby projects 6 | 7 | This is based on [Wei's](https://twitter.com/wgao19) blog [Play with React Concurrent Mode with Your Gatsby Site](https://aworkinprogress.dev/play-concurrent-mode-with-your-gatsby-site/) with code from [Fredrik Höglund](https://twitter.com/EphemeralCircle) 8 | 9 | ## Installing `gatsby-concurrent-mode` 10 | 11 | ```bash 12 | yarn add gatsby-concurrent-mode 13 | ``` 14 | 15 | or 16 | 17 | ```bash 18 | npm install --save gatsby-concurrent-mode 19 | ``` 20 | 21 | ## Using `gatsby-concurrent-mode` 22 | 23 | In your `gatsby-config.js` file add this to your `plugins:`: 24 | 25 | ```js 26 | module.exports = { 27 | plugins: ['gatsby-concurrent-mode'] 28 | }; 29 | ``` 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2019 Gatsbyjs 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | --------------------------------------------------------------------------------