Skip to content
This repository has been archived by the owner on Sep 16, 2022. It is now read-only.

Releases: joe-bell/next-google-fonts

v2.2.0

30 Mar 18:40
91dc5e1
Compare
Choose a tag to compare

Features

  • Add keys to <Head> tags to prevent duplicates (e0caed5)
  • Add data-next-google-fonts-* attributes for debugging (dd7cc13)

v2.1.0

15 Mar 07:41
27a1440
Compare
Choose a tag to compare

Features

  • add "no-js" fallback (4f45eb2)

    In the unlikely event that a visitor has intentionally disabled JavaScript, fall back to the original method. The good news is that, although this is a render-blocking request, it can still make use of the preconnect which makes it marginally faster than the default.

    Harry Roberts

v2.0.0

26 Feb 17:09
0a1b4fb
Compare
Choose a tag to compare

Migration

Component

Switch any default imports to the new named { GoogleFonts } import:

--  import GoogleFonts from "next-google-fonts";
++  import { GoogleFonts } from "next-google-fonts";

Types

The GoogleFontsProps has been removed in favour of the interface IGoogleFontsProps:

--  import { GoogleFontsProps } from "next-google-fonts";
++  import { IGoogleFontsProps } from "next-google-fonts";

Changelog

Refactor

  • switches to named GoogleFonts export (8fdb19d)

Features

  • upgrade peerDeps to latest next and react versions (8fdb19d)

v1.3.0

25 Feb 10:46
976f7ae
Compare
Choose a tag to compare
  • Adds named GoogleFonts export

v1.1.0

09 Jun 07:27
b1b37d0
Compare
Choose a tag to compare

Significantly smaller, no migration required

v1.0.0

06 Jun 15:07
56f24ab
Compare
Choose a tag to compare

No more custom _app.jsx setup!

Migration

  1. Replace imports of import { GoogleFonts } from "next-google-fonts"; to import GoogleFonts from "next-google-fonts";.
  2. Move your href attribute and it's value from GoogleFontsProvider to GoogleFonts
    e.g.
    // components/head.tsx
    import * as React from "react";
    import GoogleFonts from "next-google-fonts";
    
    export const Head: React.FC = () => (
      <GoogleFonts href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" />
    );
  3. Remove the deprecated GoogleFontsProvider from your custom _app.jsx or _app.tsx. If you're not using any other contexts/providers, you may be able to remove this file altogether.