Upgrading

Contents

Guillotine application

Guillotine version 7 is required if you need to modify graphql schema in your application.

Upgrading from v2.x

  1. You need to use Next.js app router to be able to use v3.x. See upgrade instructions from pages router here.

  2. _renderable page is now an API route at src/api/renderable/route.ts.

  3. @enonic/nextjs-adapter methods renamed:

    • getLocaleProjectConfig() → getLocaleMapping()

    • getProjectLocaleConfigById → getLocaleMappingById()

  4. @enonic/nextjs-adapter method signature changes:

    • fetchFromApi method changed to :

      fetchFromApi(
         apiUrl: string,
         projectConfig: ProjectLocaleConfig,
         options?: FetchOptions): Promise<GuillotineResponseJson>
    • fetchGuillotine method signature changes:

      fetchGuillotine(
         contentApiUrl: string,
         projectConfig: ProjectLocaleConfig,
         options?: FetchOptions): Promise<GuillotineResult>
  5. @enonic/nextjs-adapter exports rearranged:

    Exports working both on the server and client sides are now available from @enonic/nextjs-adapter package root. Client-only exports are available from @enonic/nextjs-adapter/client package. Server-only exports are available from @enonic/nextjs-adapter/server package. Views are available at @enonic/nextjs-adapter/views/<ViewName>.

  6. ENONIC_PROJECTS environmental variable change:

    ENONIC_PROJECTS -> ENONIC_MAPPINGS
    Language is now required for every project config:
    ENONIC_MAPPINGS=<lang>:<repo-name>/site/path[,<lang>:<repo-name>/site/path,...]
    First config in the list is used as default.
  7. next.config.js config changes:

    Remove i18n block from next.js config:
    i18n: {
        locales: ['en', 'no'],
        defaultLocale: 'en',
    }
    Add phrases block to webpack config:
    config.resolve.alias = {
        ...config.resolve.alias,
        "@phrases": path.resolve(__dirname, "./src/phrases"),
    }
  8. Add src/phrases folder to your project root. This folder should contain static translations for every language from ENONIC_MAPPINGS env var in the following format: src/phrases/<lang>.json

    src/phrases/en.json
    src/phrases/no.json
  9. Middleware file has been updated to support new i18n config. If you have custom middleware, you need to update it to support new i18n config.


Contents

Contents

AI-powered search

Juke AI