From 866138c7bdbd97e5f3e558ee3fcae2ff952038f7 Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Wed, 10 Apr 2024 16:19:27 +0200 Subject: [PATCH 1/3] Update Next.js mention in Turbopack docs --- docs/pages/pack/docs/features/frameworks.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/pages/pack/docs/features/frameworks.mdx b/docs/pages/pack/docs/features/frameworks.mdx index 14498c0ef2043..da0aa2531a216 100644 --- a/docs/pages/pack/docs/features/frameworks.mdx +++ b/docs/pages/pack/docs/features/frameworks.mdx @@ -26,9 +26,9 @@ React Server Components impose unusual constraints on your bundler. The mix of c Turbopack has been built from the ground up to solve these problems - it works with React Server Components out of the box. -## Next +## Next.js -To begin with, Turbopack is focused on providing a great experience for Next.js's dev server. We're using this as our initial goal to show what Turbopack can do. In the future, we want Turbopack to act as a low-level engine for other frameworks. +To begin with, Turbopack is focused on providing a great experience for the Next.js's dev server. We're using this as our initial goal to show what Turbopack can do. In the future, we want Turbopack to act as a low-level engine for other frameworks. ## Vue and Svelte From c91549f035e506d92b5ea56e227a026add1d55af Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Wed, 10 Apr 2024 16:22:21 +0200 Subject: [PATCH 2/3] Update static-assets.mdx --- .../pack/docs/features/static-assets.mdx | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/docs/pages/pack/docs/features/static-assets.mdx b/docs/pages/pack/docs/features/static-assets.mdx index fd13d8d0ff0d4..0b42f69957b2a 100644 --- a/docs/pages/pack/docs/features/static-assets.mdx +++ b/docs/pages/pack/docs/features/static-assets.mdx @@ -1,13 +1,13 @@ # Static Assets -Part of bundling for the web is handling all the asset types the web supports - images, videos, JSON, fonts, and much more. Turbopack offers familiar tools for these so you can immediately get productive. +Part of bundling for the web is handling all the asset types the web supports - images, JSON, and much more. Turbopack offers familiar tools for these so you can immediately get productive. ## Import static assets Importing static assets works out of the box with Turbopack: ```ts -import img from './img.png' +import img from "./img.png"; ``` ### Next.js @@ -15,31 +15,23 @@ import img from './img.png' In webpack and some other frameworks, importing an image returns a string containing that image's URL. ```ts -import img from './img.png'; +import img from "./img.png"; console.log(img); // /assets/static/1uahwd98h123.png ``` -In Next.js, importing an image actually returns an object, containing various metadata about the image. This is so it can be fed into [Next.js's Image component](https://nextjs.org/docs/basic-features/image-optimization#local-images). - -The behavior of extracting an object of metadata from the image is **not yet supported**. For now, imported images will resolve to strings. - -## Public directory - -The `/public` directory lets you place assets which you want to be available on the root URL of the website. For instance, `public/favicon.png` will be available at `https://example/favicon.png`. - -In Turbopack, the `/public` directory is supported out of the box. +In Next.js, importing an image returns an object, containing various metadata about the image. This is so it can be fed into [Next.js's Image component](https://nextjs.org/docs/basic-features/image-optimization#local-images). ## JSON Most frameworks allow you to import JSON directly into your application: ```ts -import fixtures from './fixtures.json'; +import fixtures from "./fixtures.json"; ``` This is supported out of the box with Turbopack, as is performing a named import on that JSON: ```ts -import { users, posts } from './fixtures.json'; +import { users, posts } from "./fixtures.json"; ``` From fcbe4c5636ac0ed586f16e15981737d367019699 Mon Sep 17 00:00:00 2001 From: Maia Teegarden Date: Wed, 10 Apr 2024 07:50:39 -0700 Subject: [PATCH 3/3] Update docs/pages/pack/docs/features/frameworks.mdx --- docs/pages/pack/docs/features/frameworks.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/pack/docs/features/frameworks.mdx b/docs/pages/pack/docs/features/frameworks.mdx index da0aa2531a216..bfe9db931074d 100644 --- a/docs/pages/pack/docs/features/frameworks.mdx +++ b/docs/pages/pack/docs/features/frameworks.mdx @@ -28,7 +28,7 @@ Turbopack has been built from the ground up to solve these problems - it works w ## Next.js -To begin with, Turbopack is focused on providing a great experience for the Next.js's dev server. We're using this as our initial goal to show what Turbopack can do. In the future, we want Turbopack to act as a low-level engine for other frameworks. +To begin with, Turbopack is focused on providing a great experience for the Next.js dev server. We're using this as our initial goal to show what Turbopack can do. In the future, we want Turbopack to act as a low-level engine for other frameworks. ## Vue and Svelte