Skip to content

feat: Experimental support for --turbo (requires next@^14.0.3) - #641

Merged
amannn merged 5 commits into
mainfrom
feat/250-turbopack
Nov 17, 2023
Merged

feat: Experimental support for --turbo (requires next@^14.0.3)#641
amannn merged 5 commits into
mainfrom
feat/250-turbopack

Conversation

@amannn

@amannn amannn commented Nov 17, 2023

Copy link
Copy Markdown
Owner

Fixes #250

Kapture.2023-11-17.at.14.23.46.mp4

Turbo seemingly supports HMR for JSON files (if the path is static)—this comes in quite handy!

@vercel

vercel Bot commented Nov 17, 2023

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-intl-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 17, 2023 1:45pm
next-intl-example-app-router ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 17, 2023 1:45pm

@ovflowd

ovflowd commented Nov 17, 2023

Copy link
Copy Markdown

I was literally just looking for this 👀 is this going to be added on next-intl 3.0?

Comment thread examples/example-app-router/src/i18n.ts Outdated
messages: (
await (locale === 'en'
? // When using Turbopack, this will enable HMR for `en`
import(`../messages/en.json`)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quite handy!

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed! Is there a way we could iterate through the available languages (all available languages and load them directly here?)

Is that even necessary? Would loading all languages without string interpolation be problematic?

Because by that snippet you're still loading conditionally, but how we could do "magic" and make Turbopack understand that it can load all the languages in that fashion?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would loading all languages without string interpolation be problematic?

That should work too, yes! Depending on how many locales your app has (and how often they change), this could surely be a good idea!

@ovflowd ovflowd Nov 17, 2023

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that HMR benefit is mostly just local dev and development is always in English, so just for HMR that might not be necessary.

What I wonder if not using strin interpolation here brings any other Turbopack magic benefit

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that HMR benefit is mostly just local dev and development is always in English, so just for HMR that might not be necessary.

That's what I thought too, yes!

@amannn

amannn commented Nov 17, 2023

Copy link
Copy Markdown
Owner Author

I was literally just looking for this 👀 is this going to be added on next-intl 3.0?

@ovflowd Absolutely! 😎

@tianyingchun

Copy link
Copy Markdown

how it works?

const config = {
  reactStrictMode: true,
  experimental: {
    typedRoutes: true,
  ///?
    turbo: {},
  },

it seems that it can not works

@tianyingchun

Copy link
Copy Markdown

need to specifc .env

TURBOPACK=true

it seems that works

@amannn

amannn commented Nov 20, 2023

Copy link
Copy Markdown
Owner Author

juanforlizzi pushed a commit to juanforlizzi/next-intl that referenced this pull request Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Turbopack support

3 participants