Git Product home page Git Product logo

gatsby-intl-flicker-demo's Introduction

Demoing page flicker with `gatsby-plugin-image` using `StaticImage` & `gatsby-plugin-intl` as locale is pushed onto route.

Site is here.

Go try it out and propose a better strategy for pushing locales onto routes, please.

To prevent network requests as gatsby-plugin-intl pushes the locale path onto the route, use the version of Link it comes bundled with.

Pushing the locale onto the route forces a network request, which defeats the purpose of using Gatsby in the first place. The fix is to use the version of Link that gatsby-plugin-intl comes bundled with.

Before, using Gatsby Link:

Page flickers as locales pushed onto routes.

After, using gatsby-plugin-intl bundled Link:

No network request as locale pushed onto routes.

Using Static Image with gatsby-plugin-image flickers.

This is unrelated to the locale routes issue but included anyway. Watch the logo png in the Header. Open to ideas for how to fix this.

Img flickers

Here's /src/components/Logo.js:

export function Logo() {
  return (
    <StaticImage
      src="../assets/images/logo.png"
      loading="eager"
      alt="Logo"
      placeholder="blurred" />
  );
}

How to work this.

git clone this repo

npm install

npm start

๐Ÿง What's inside?

There's some Tailwind and SSR stuff for themes you can ignore.

โ”œโ”€โ”€ LICENSE
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ gatsby-browser.js
โ”œโ”€โ”€ gatsby-config.js
โ”œโ”€โ”€ gatsby-ssr.js
โ”œโ”€โ”€ node_modules
โ”œโ”€โ”€ package-lock.json
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ postcss.config.js
โ”œโ”€โ”€ public
โ”œโ”€โ”€ src
โ”œโ”€โ”€ static
โ””โ”€โ”€ tailwind.config.js

gatsby-intl-flicker-demo's People

Contributors

theemattoliver avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.