选择 NextJS 12 和 13 之间的区别如何?

huangapple go评论57阅读模式
英文:

How to choose between NextJS 12 and 13

问题

我是你的中文翻译,以下是翻译好的内容:

我对NextJS还很新。我学过create-react-app并写了一些项目。现在,我想学习NextJS。在YouTube上,我看了几个关于两个版本的视频。然而,我注意到它们的架构有很大的不同。在12版本中,我们有一个奇怪命名为_app.ts等的pages文件夹。另一方面,在13版本中,我们有一个layout.ts文件。然而,13版本具有src/app文件夹的架构,但没有pages文件夹。我在考虑学习13版本而不是12版本,但担心会错过一些在13版本中可能没有涵盖的12版本的知识。你们对我有什么建议呢?

英文:

I am new to NextJS. I learned create-react-app and wrote some projects. Now, I want to learn NextJS. On Youtube, I watched several videos about both versions. However, I noticed that their architecture is quite different. While in 12 we have pages folder with strange naming _app.ts etc. On the other hand, in version 13 we have a layout.ts file. However, version 13 that have src/app folders architecture, but does not have a pages folder. I am thinking about learning version 13 instead of 12, but afraid of missing some knowledge from 12 that might not be covered in version 13. What is your advice for me guys?

答案1

得分: 2

你可以安全使用 NextJS 13 并将其部署到生产环境,但不建议在生产环境中使用任何实验性功能,比如 app

英文:

You are safe to use NextJS 13 and deploy it to production, but it is not recommended to use any experimental feature such as app for production

答案2

得分: 0

下一个版本是稳定版,具有出色的功能,并且配备了比 NextJS 12 更快的 Turbo 打包工具,可以更快地打包资源。

英文:

Next 13 is stable release with awesome features and has turbo bundler which bundles assets faster than NextJS 12

答案3

得分: 0

只使用最新版本。然而/app目前尚未达到生产就绪状态,因此您可以忽略它用于生产构建。

英文:

Just use the latest version. However /app is not yet production-ready so you can ignore that for your production build.

huangapple
  • 本文由 发表于 2023年3月31日 02:32:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/75891798.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定