@gojek/gatsby-plugin-asphalt-ssr
v0.2.3
Published
Gatsby plugin for asphalt-react with built in server side rendering support
Downloads
12
Readme
gatsby-plugin-asphalt-ssr
A Gatsby plugin for Asphalt React with built-in server-side rendering support.
Install
# yarn
yarn add @gojek/gatsby-plugin-asphalt-ssr
# npm
npm install @gojek/gatsby-plugin-asphalt-ssr
Problem
Flash of Unstyled Content or FOUC may occur for Asphalt React components when server rendering your application.
Solution
Install and add @gojek/gatsby-plugin-asphalt-ssr
to your list of Gatsby plugins in your gatsby-config.js
file. This makes sure that there is no FOUC for Asphalt React components in your Gatsby application.
This plugin uses @asphalt-react/ssr and makes some changes to Gatsby Browser APIs and Gatsby Server Side Rendering APIs internally to solve FOUC.
How to use
// In your gatsby-config.js
module.exports = {
plugins: [`@gojek/gatsby-plugin-asphalt-ssr`],
}
Local Development
Clone this repository
Clone the repository.
cd gatsby-plugin-asphalt-ssr
Install dependencies
yarn
⛴️ Release
Uses standard-version
for managing releases.
Make sure you are on the updated default branch. Like
master
.Run
yarn run release
Version bump & release commit & tag will be created automatically. Proceed to publishing if you want to publish as well.
🚀 Publish
Make sure you are logged in to the target npm registry
Check authorization to registry
npm whoami --registry=https://registry.npmjs.org
Authorise if needed
npm adduser --registry=https://registry.npmjs.org
Switch to
master
branch & publishyarn publish --registry=https://registry.npmjs.org