diff --git a/docs/api-routes/dynamic-api-routes.md b/docs/api-routes/dynamic-api-routes.md index c8204455d1d87..8c49755693a6b 100644 --- a/docs/api-routes/dynamic-api-routes.md +++ b/docs/api-routes/dynamic-api-routes.md @@ -86,6 +86,8 @@ Catch all routes can be made optional by including the parameter in double brack For example, `pages/api/post/[[...slug]].js` will match `/api/post`, `/api/post/a`, `/api/post/a/b`, and so on. +The main difference between catch all and optional catch all routes is that with optional, the route without the parameter is also matched (`/api/post` in the example above). + The `query` objects are as follows: ```json diff --git a/docs/routing/dynamic-routes.md b/docs/routing/dynamic-routes.md index 71a877f0c9f3e..ca1f26e54fd87 100644 --- a/docs/routing/dynamic-routes.md +++ b/docs/routing/dynamic-routes.md @@ -83,14 +83,14 @@ And in the case of `/post/a/b`, and any other matching path, new parameters will { "slug": ["a", "b"] } ``` -> A good example of catch all routes is the Next.js docs, a single page called [pages/docs/[...slug].js](https://github.com/zeit/next-site/blob/master/pages/docs/%5B...slug%5D.js) takes care of all the docs you're currently looking at. - ### Optional catch all routes Catch all routes can be made optional by including the parameter in double brackets (`[[...slug]]`). For example, `pages/post/[[...slug]].js` will match `/post`, `/post/a`, `/post/a/b`, and so on. +The main difference between catch all and optional catch all routes is that with optional, the route without the parameter is also matched (`/post` in the example above). + The `query` objects are as follows: ```json @@ -99,6 +99,8 @@ The `query` objects are as follows: { "slug": ["a", "b"] } // `GET /post/a/b` (multi-element array) ``` +> A good example of optional catch all routes is the Next.js docs, a single page called [pages/docs/[[...slug]].js](https://github.com/zeit/next-site/blob/master/pages/docs/%5B%5B...slug%5D%5D.js) takes care of all the docs you're currently looking at. + ## Caveats - Predefined routes take precedence over dynamic routes, and dynamic routes over catch all routes. Take a look at the following examples: diff --git a/errors/invalid-route-source.md b/errors/invalid-route-source.md index 07f1773427266..c29c8610cf65c 100644 --- a/errors/invalid-route-source.md +++ b/errors/invalid-route-source.md @@ -29,4 +29,4 @@ Wrap the `RegExp` part of your `source` as an un-named parameter. ### Useful Links - [path-to-regexp](https://github.com/pillarjs/path-to-regexp) -- [un-named paramters](https://github.com/pillarjs/path-to-regexp#unnamed-parameters) +- [un-named parameters](https://github.com/pillarjs/path-to-regexp#unnamed-parameters) diff --git a/examples/amp/pages/index.js b/examples/amp/pages/index.js index 0f256f298fac9..5395cb8f9ee6b 100644 --- a/examples/amp/pages/index.js +++ b/examples/amp/pages/index.js @@ -77,7 +77,7 @@ export default function IndexPage() { food, yet ignore the squirrels, you'll never catch them anyway cat snacks spread kitty litter all over house or hopped up on catnip. Spit up on light gray carpet instead of adjacent linoleum throwup on your - pillow, so cat is love, cat is life yet human is washing you why halp oh + pillow, so cat is love, cat is life yet human is washing you why help oh the horror flee scratch hiss bite. Chase mice. Swat turds around the house hide at bottom of staircase to trip human. Meowing non stop for food howl on top of tall thing. Shake treat bag pee in human's bed until @@ -93,7 +93,7 @@ export default function IndexPage() { catch the red dot today slap owner's face at 5am until human fills food dish scratch at the door then walk away for intrigued by the shower, but steal the warm chair right after you get up. Fall asleep on the washing - machine destroy couch as revenge scream at teh bath so love to play with + machine destroy couch as revenge scream at the bath so love to play with owner's hair tie. Howl uncontrollably for no reason rub whiskers on bare skin act innocent. Cats making all the muffins lick butt and make a weird face meow all night having their mate disturbing sleeping humans @@ -108,7 +108,7 @@ export default function IndexPage() { cleans the litter box and if it fits, i sits caticus cuteicus. Eats owners hair then claws head lounge in doorway, and hide when guests come over chase ball of string eat owner's food play riveting piece on - synthesizer keyboard. Purrr purr littel cat, little cat purr purr spit + synthesizer keyboard. Purrr purr little cat, little cat purr purr spit up on light gray carpet instead of adjacent linoleum kitty loves pigs yet damn that dog meow or walk on car leaving trail of paw prints on hood and windshield. Roll on the floor purring your whiskers off meow @@ -212,7 +212,7 @@ export default function IndexPage() { together yet have my breakfast spaghetti yarn so scamper. Need to chase tail meow for food, then when human fills food dish, take a few bites of food and continue meowing for pee in the shoe thinking longingly about - tuna brine yet purrr purr littel cat, little cat purr purr lie on your + tuna brine yet purrr purr little cat, little cat purr purr lie on your belly and purr when you are asleep. Lounge in doorway poop on grasses for lounge in doorway for chew iPad power cord.
diff --git a/examples/blog-starter-typescript/_posts/dynamic-routing.md b/examples/blog-starter-typescript/_posts/dynamic-routing.md index bed83f440fc8f..b6ef7a26e6ae0 100644 --- a/examples/blog-starter-typescript/_posts/dynamic-routing.md +++ b/examples/blog-starter-typescript/_posts/dynamic-routing.md @@ -1,6 +1,6 @@ --- title: 'Dynamic Routing and Static Generation' -excerpt: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilisi morbi tempus.' +excerpt: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilities morbi tempus.' coverImage: '/assets/blog/dynamic-routing/cover.jpg' date: '2020-03-16T05:35:07.322Z' author: @@ -10,10 +10,10 @@ ogImage: url: '/assets/blog/dynamic-routing/cover.jpg' --- -Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilisi morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies. +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilities morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies. Venenatis cras sed felis eget velit. Consectetur libero id faucibus nisl tincidunt. Gravida in fermentum et sollicitudin ac orci phasellus egestas tellus. Volutpat consequat mauris nunc congue nisi vitae. Id aliquet risus feugiat in ante metus dictum at tempor. Sed blandit libero volutpat sed cras. Sed odio morbi quis commodo odio aenean sed adipiscing. Velit euismod in pellentesque massa placerat. Mi bibendum neque egestas congue quisque egestas diam in arcu. Nisi lacus sed viverra tellus in. Nibh cras pulvinar mattis nunc sed. Luctus accumsan tortor posuere ac ut consequat semper viverra. Fringilla ut morbi tincidunt augue interdum velit euismod. ## Lorem Ipsum -Tristique senectus et netus et malesuada fames ac turpis. Ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel. In mollis nunc sed id semper. Egestas tellus rutrum tellus pellentesque. Phasellus vestibulum lorem sed risus ultricies tristique nulla. Quis blandit turpis cursus in hac habitasse platea dictumst quisque. Eros donec ac odio tempor orci dapibus ultrices. Aliquam sem et tortor consequat id porta nibh. Adipiscing elit duis tristique sollicitudin nibh sit amet commodo nulla. Diam vulputate ut pharetra sit amet. Ut tellus elementum sagittis vitae et leo. Arcu non odio euismod lacinia at quis risus sed vulputate. +Tristique senectus et netus et malesuada fames ac turpis. Ridiculous mus mauris vitae ultricies leo integer malesuada nunc vel. In mollis nunc sed id semper. Egestas tellus rutrum tellus pellentesque. Phasellus vestibulum lorem sed risus ultricies tristique nulla. Quis blandit turpis cursus in hac habitasse platea dictumst quisque. Eros donec ac odio tempor orci dapibus ultrices. Aliquam sem et tortor consequat id porta nibh. Adipiscing elit duis tristique sollicitudin nibh sit amet commodo nulla. Diam vulputate ut pharetra sit amet. Ut tellus elementum sagittis vitae et leo. Arcu non odio euismod lacinia at quis risus sed vulputate. diff --git a/examples/blog-starter-typescript/_posts/hello-world.md b/examples/blog-starter-typescript/_posts/hello-world.md index 005b883a60ae6..8d85a1df8f174 100644 --- a/examples/blog-starter-typescript/_posts/hello-world.md +++ b/examples/blog-starter-typescript/_posts/hello-world.md @@ -1,6 +1,6 @@ --- title: 'Learn How to Pre-render Pages Using Static Generation with Next.js' -excerpt: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilisi morbi tempus.' +excerpt: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilities morbi tempus.' coverImage: '/assets/blog/hello-world/cover.jpg' date: '2020-03-16T05:35:07.322Z' author: @@ -10,10 +10,10 @@ ogImage: url: '/assets/blog/hello-world/cover.jpg' --- -Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilisi morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies. +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilities morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies. Venenatis cras sed felis eget velit. Consectetur libero id faucibus nisl tincidunt. Gravida in fermentum et sollicitudin ac orci phasellus egestas tellus. Volutpat consequat mauris nunc congue nisi vitae. Id aliquet risus feugiat in ante metus dictum at tempor. Sed blandit libero volutpat sed cras. Sed odio morbi quis commodo odio aenean sed adipiscing. Velit euismod in pellentesque massa placerat. Mi bibendum neque egestas congue quisque egestas diam in arcu. Nisi lacus sed viverra tellus in. Nibh cras pulvinar mattis nunc sed. Luctus accumsan tortor posuere ac ut consequat semper viverra. Fringilla ut morbi tincidunt augue interdum velit euismod. ## Lorem Ipsum -Tristique senectus et netus et malesuada fames ac turpis. Ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel. In mollis nunc sed id semper. Egestas tellus rutrum tellus pellentesque. Phasellus vestibulum lorem sed risus ultricies tristique nulla. Quis blandit turpis cursus in hac habitasse platea dictumst quisque. Eros donec ac odio tempor orci dapibus ultrices. Aliquam sem et tortor consequat id porta nibh. Adipiscing elit duis tristique sollicitudin nibh sit amet commodo nulla. Diam vulputate ut pharetra sit amet. Ut tellus elementum sagittis vitae et leo. Arcu non odio euismod lacinia at quis risus sed vulputate. +Tristique senectus et netus et malesuada fames ac turpis. Ridiculous mus mauris vitae ultricies leo integer malesuada nunc vel. In mollis nunc sed id semper. Egestas tellus rutrum tellus pellentesque. Phasellus vestibulum lorem sed risus ultricies tristique nulla. Quis blandit turpis cursus in hac habitasse platea dictumst quisque. Eros donec ac odio tempor orci dapibus ultrices. Aliquam sem et tortor consequat id porta nibh. Adipiscing elit duis tristique sollicitudin nibh sit amet commodo nulla. Diam vulputate ut pharetra sit amet. Ut tellus elementum sagittis vitae et leo. Arcu non odio euismod lacinia at quis risus sed vulputate. diff --git a/examples/blog-starter-typescript/_posts/preview.md b/examples/blog-starter-typescript/_posts/preview.md index 385082606e9b6..3d70ba7f99d11 100644 --- a/examples/blog-starter-typescript/_posts/preview.md +++ b/examples/blog-starter-typescript/_posts/preview.md @@ -1,6 +1,6 @@ --- title: 'Preview Mode for Static Generation' -excerpt: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilisi morbi tempus.' +excerpt: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilities morbi tempus.' coverImage: '/assets/blog/preview/cover.jpg' date: '2020-03-16T05:35:07.322Z' author: @@ -10,10 +10,10 @@ ogImage: url: '/assets/blog/preview/cover.jpg' --- -Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilisi morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies. +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilities morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies. Venenatis cras sed felis eget velit. Consectetur libero id faucibus nisl tincidunt. Gravida in fermentum et sollicitudin ac orci phasellus egestas tellus. Volutpat consequat mauris nunc congue nisi vitae. Id aliquet risus feugiat in ante metus dictum at tempor. Sed blandit libero volutpat sed cras. Sed odio morbi quis commodo odio aenean sed adipiscing. Velit euismod in pellentesque massa placerat. Mi bibendum neque egestas congue quisque egestas diam in arcu. Nisi lacus sed viverra tellus in. Nibh cras pulvinar mattis nunc sed. Luctus accumsan tortor posuere ac ut consequat semper viverra. Fringilla ut morbi tincidunt augue interdum velit euismod. ## Lorem Ipsum -Tristique senectus et netus et malesuada fames ac turpis. Ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel. In mollis nunc sed id semper. Egestas tellus rutrum tellus pellentesque. Phasellus vestibulum lorem sed risus ultricies tristique nulla. Quis blandit turpis cursus in hac habitasse platea dictumst quisque. Eros donec ac odio tempor orci dapibus ultrices. Aliquam sem et tortor consequat id porta nibh. Adipiscing elit duis tristique sollicitudin nibh sit amet commodo nulla. Diam vulputate ut pharetra sit amet. Ut tellus elementum sagittis vitae et leo. Arcu non odio euismod lacinia at quis risus sed vulputate. +Tristique senectus et netus et malesuada fames ac turpis. Ridiculous mus mauris vitae ultricies leo integer malesuada nunc vel. In mollis nunc sed id semper. Egestas tellus rutrum tellus pellentesque. Phasellus vestibulum lorem sed risus ultricies tristique nulla. Quis blandit turpis cursus in hac habitasse platea dictumst quisque. Eros donec ac odio tempor orci dapibus ultrices. Aliquam sem et tortor consequat id porta nibh. Adipiscing elit duis tristique sollicitudin nibh sit amet commodo nulla. Diam vulputate ut pharetra sit amet. Ut tellus elementum sagittis vitae et leo. Arcu non odio euismod lacinia at quis risus sed vulputate. diff --git a/examples/blog-starter/_posts/dynamic-routing.md b/examples/blog-starter/_posts/dynamic-routing.md index bed83f440fc8f..b6ef7a26e6ae0 100644 --- a/examples/blog-starter/_posts/dynamic-routing.md +++ b/examples/blog-starter/_posts/dynamic-routing.md @@ -1,6 +1,6 @@ --- title: 'Dynamic Routing and Static Generation' -excerpt: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilisi morbi tempus.' +excerpt: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilities morbi tempus.' coverImage: '/assets/blog/dynamic-routing/cover.jpg' date: '2020-03-16T05:35:07.322Z' author: @@ -10,10 +10,10 @@ ogImage: url: '/assets/blog/dynamic-routing/cover.jpg' --- -Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilisi morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies. +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilities morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies. Venenatis cras sed felis eget velit. Consectetur libero id faucibus nisl tincidunt. Gravida in fermentum et sollicitudin ac orci phasellus egestas tellus. Volutpat consequat mauris nunc congue nisi vitae. Id aliquet risus feugiat in ante metus dictum at tempor. Sed blandit libero volutpat sed cras. Sed odio morbi quis commodo odio aenean sed adipiscing. Velit euismod in pellentesque massa placerat. Mi bibendum neque egestas congue quisque egestas diam in arcu. Nisi lacus sed viverra tellus in. Nibh cras pulvinar mattis nunc sed. Luctus accumsan tortor posuere ac ut consequat semper viverra. Fringilla ut morbi tincidunt augue interdum velit euismod. ## Lorem Ipsum -Tristique senectus et netus et malesuada fames ac turpis. Ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel. In mollis nunc sed id semper. Egestas tellus rutrum tellus pellentesque. Phasellus vestibulum lorem sed risus ultricies tristique nulla. Quis blandit turpis cursus in hac habitasse platea dictumst quisque. Eros donec ac odio tempor orci dapibus ultrices. Aliquam sem et tortor consequat id porta nibh. Adipiscing elit duis tristique sollicitudin nibh sit amet commodo nulla. Diam vulputate ut pharetra sit amet. Ut tellus elementum sagittis vitae et leo. Arcu non odio euismod lacinia at quis risus sed vulputate. +Tristique senectus et netus et malesuada fames ac turpis. Ridiculous mus mauris vitae ultricies leo integer malesuada nunc vel. In mollis nunc sed id semper. Egestas tellus rutrum tellus pellentesque. Phasellus vestibulum lorem sed risus ultricies tristique nulla. Quis blandit turpis cursus in hac habitasse platea dictumst quisque. Eros donec ac odio tempor orci dapibus ultrices. Aliquam sem et tortor consequat id porta nibh. Adipiscing elit duis tristique sollicitudin nibh sit amet commodo nulla. Diam vulputate ut pharetra sit amet. Ut tellus elementum sagittis vitae et leo. Arcu non odio euismod lacinia at quis risus sed vulputate. diff --git a/examples/blog-starter/_posts/hello-world.md b/examples/blog-starter/_posts/hello-world.md index 005b883a60ae6..8d85a1df8f174 100644 --- a/examples/blog-starter/_posts/hello-world.md +++ b/examples/blog-starter/_posts/hello-world.md @@ -1,6 +1,6 @@ --- title: 'Learn How to Pre-render Pages Using Static Generation with Next.js' -excerpt: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilisi morbi tempus.' +excerpt: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilities morbi tempus.' coverImage: '/assets/blog/hello-world/cover.jpg' date: '2020-03-16T05:35:07.322Z' author: @@ -10,10 +10,10 @@ ogImage: url: '/assets/blog/hello-world/cover.jpg' --- -Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilisi morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies. +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilities morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies. Venenatis cras sed felis eget velit. Consectetur libero id faucibus nisl tincidunt. Gravida in fermentum et sollicitudin ac orci phasellus egestas tellus. Volutpat consequat mauris nunc congue nisi vitae. Id aliquet risus feugiat in ante metus dictum at tempor. Sed blandit libero volutpat sed cras. Sed odio morbi quis commodo odio aenean sed adipiscing. Velit euismod in pellentesque massa placerat. Mi bibendum neque egestas congue quisque egestas diam in arcu. Nisi lacus sed viverra tellus in. Nibh cras pulvinar mattis nunc sed. Luctus accumsan tortor posuere ac ut consequat semper viverra. Fringilla ut morbi tincidunt augue interdum velit euismod. ## Lorem Ipsum -Tristique senectus et netus et malesuada fames ac turpis. Ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel. In mollis nunc sed id semper. Egestas tellus rutrum tellus pellentesque. Phasellus vestibulum lorem sed risus ultricies tristique nulla. Quis blandit turpis cursus in hac habitasse platea dictumst quisque. Eros donec ac odio tempor orci dapibus ultrices. Aliquam sem et tortor consequat id porta nibh. Adipiscing elit duis tristique sollicitudin nibh sit amet commodo nulla. Diam vulputate ut pharetra sit amet. Ut tellus elementum sagittis vitae et leo. Arcu non odio euismod lacinia at quis risus sed vulputate. +Tristique senectus et netus et malesuada fames ac turpis. Ridiculous mus mauris vitae ultricies leo integer malesuada nunc vel. In mollis nunc sed id semper. Egestas tellus rutrum tellus pellentesque. Phasellus vestibulum lorem sed risus ultricies tristique nulla. Quis blandit turpis cursus in hac habitasse platea dictumst quisque. Eros donec ac odio tempor orci dapibus ultrices. Aliquam sem et tortor consequat id porta nibh. Adipiscing elit duis tristique sollicitudin nibh sit amet commodo nulla. Diam vulputate ut pharetra sit amet. Ut tellus elementum sagittis vitae et leo. Arcu non odio euismod lacinia at quis risus sed vulputate. diff --git a/examples/blog-starter/_posts/preview.md b/examples/blog-starter/_posts/preview.md index 385082606e9b6..3d70ba7f99d11 100644 --- a/examples/blog-starter/_posts/preview.md +++ b/examples/blog-starter/_posts/preview.md @@ -1,6 +1,6 @@ --- title: 'Preview Mode for Static Generation' -excerpt: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilisi morbi tempus.' +excerpt: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilities morbi tempus.' coverImage: '/assets/blog/preview/cover.jpg' date: '2020-03-16T05:35:07.322Z' author: @@ -10,10 +10,10 @@ ogImage: url: '/assets/blog/preview/cover.jpg' --- -Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilisi morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies. +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilities morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies. Venenatis cras sed felis eget velit. Consectetur libero id faucibus nisl tincidunt. Gravida in fermentum et sollicitudin ac orci phasellus egestas tellus. Volutpat consequat mauris nunc congue nisi vitae. Id aliquet risus feugiat in ante metus dictum at tempor. Sed blandit libero volutpat sed cras. Sed odio morbi quis commodo odio aenean sed adipiscing. Velit euismod in pellentesque massa placerat. Mi bibendum neque egestas congue quisque egestas diam in arcu. Nisi lacus sed viverra tellus in. Nibh cras pulvinar mattis nunc sed. Luctus accumsan tortor posuere ac ut consequat semper viverra. Fringilla ut morbi tincidunt augue interdum velit euismod. ## Lorem Ipsum -Tristique senectus et netus et malesuada fames ac turpis. Ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel. In mollis nunc sed id semper. Egestas tellus rutrum tellus pellentesque. Phasellus vestibulum lorem sed risus ultricies tristique nulla. Quis blandit turpis cursus in hac habitasse platea dictumst quisque. Eros donec ac odio tempor orci dapibus ultrices. Aliquam sem et tortor consequat id porta nibh. Adipiscing elit duis tristique sollicitudin nibh sit amet commodo nulla. Diam vulputate ut pharetra sit amet. Ut tellus elementum sagittis vitae et leo. Arcu non odio euismod lacinia at quis risus sed vulputate. +Tristique senectus et netus et malesuada fames ac turpis. Ridiculous mus mauris vitae ultricies leo integer malesuada nunc vel. In mollis nunc sed id semper. Egestas tellus rutrum tellus pellentesque. Phasellus vestibulum lorem sed risus ultricies tristique nulla. Quis blandit turpis cursus in hac habitasse platea dictumst quisque. Eros donec ac odio tempor orci dapibus ultrices. Aliquam sem et tortor consequat id porta nibh. Adipiscing elit duis tristique sollicitudin nibh sit amet commodo nulla. Diam vulputate ut pharetra sit amet. Ut tellus elementum sagittis vitae et leo. Arcu non odio euismod lacinia at quis risus sed vulputate. diff --git a/examples/cms-agilitycms/README.md b/examples/cms-agilitycms/README.md index 146cf89317bd8..ae05e54bdfd0a 100644 --- a/examples/cms-agilitycms/README.md +++ b/examples/cms-agilitycms/README.md @@ -57,7 +57,7 @@ cd cms-agilitycms The key principle behind Agility CMS is that **Editors** should have full control of their pages and what content is on each page without getting into code. -This means you'll not only be definining **Content** for your `Posts` and `Authors`, but you'll also be defining UI Components to compose your pages. This site will consist of a single **Page Template** and a collection of **Modules** that represent the UI components you see on the page. +This means you'll not only be defining **Content** for your `Posts` and `Authors`, but you'll also be defining UI Components to compose your pages. This site will consist of a single **Page Template** and a collection of **Modules** that represent the UI components you see on the page. > **NOTE** - `Modules` and `Page Templates` in Agility CMS simply correspond to `React Components` in your website. @@ -90,7 +90,7 @@ From within the Agility CMS Content Manager, navigate to **Shared Content** and - **Content Definition** should be **Author** - **Display Name** should be set to **Authors**. This will also pre-populate **Reference Name** for you. -### Step 4. Create a `Post` Content Definiton +### Step 4. Create a `Post` Content Definition From within the Agility CMS Content Manager, navigate to **Settings** > **Content Definitions** and click **New** to create a new **Content Definition**. @@ -150,7 +150,7 @@ Navigate to **Settings** > **Module Definitions** and click **New** to create a - Set **Title** to `Intro` - Set **Description** to `Displays an intro message.` -In this case, we are not adding any fields to control the output or behaviour, since the content is actually hard-coded in the template. +In this case, we are not adding any fields to control the output or behavior, since the content is actually hard-coded in the template. Click **Save & Close** to save the definition. @@ -161,7 +161,7 @@ Navigate to **Settings** > **Module Definitions** and click **New** to create a - Set **Title** to `Hero Post` - Set **Description** to `Displays the latest Post.` -In this case, we are not adding any fields to control the output or behaviour, since the latest post will be used by default and all of the data is associated to the post itself. +In this case, we are not adding any fields to control the output or behavior, since the latest post will be used by default and all of the data is associated to the post itself. Click **Save & Close** to save the definition. @@ -185,7 +185,7 @@ Navigate to **Settings** > **Module Definitions** and click **New** to create a - Set **Title** to `Post Details` - Set **Description** to `Displays the details of a Post.` -In this case, we are not adding any fields to control the output or behaviour, since the data is associated to the post itself. +In this case, we are not adding any fields to control the output or behavior, since the data is associated to the post itself. Click **Save & Close** to save the definition. diff --git a/examples/cms-agilitycms/lib/preview.js b/examples/cms-agilitycms/lib/preview.js index cef85235bbf08..7189f4ca398d1 100644 --- a/examples/cms-agilitycms/lib/preview.js +++ b/examples/cms-agilitycms/lib/preview.js @@ -95,7 +95,7 @@ export async function validateSlugForPreview({ slug, contentID }) { } } -//Generates a preview key to compare agains +//Generates a preview key to compare against export function generatePreviewKey() { //the string we want to encode const str = `-1_${process.env.AGILITY_CMS_SECURITY_KEY}_Preview` diff --git a/examples/cms-prismic/package.json b/examples/cms-prismic/package.json index 09c4868768aa8..159ee685813dd 100644 --- a/examples/cms-prismic/package.json +++ b/examples/cms-prismic/package.json @@ -10,8 +10,8 @@ "classnames": "2.2.6", "date-fns": "2.10.0", "next": "latest", - "prismic-javascript": "2.2.0", - "prismic-reactjs": "1.2.0", + "prismic-javascript": "3.0.1", + "prismic-reactjs": "1.3.1", "react": "^16.13.0", "react-dom": "^16.13.0" }, diff --git a/examples/cms-prismic/pages/api/preview.js b/examples/cms-prismic/pages/api/preview.js index 1fccac78fff63..554040b9207f1 100644 --- a/examples/cms-prismic/pages/api/preview.js +++ b/examples/cms-prismic/pages/api/preview.js @@ -11,10 +11,13 @@ function linkResolver(doc) { } export default async function preview(req, res) { - const ref = req.query.token + const { token: ref, documentId } = req.query // Check the token parameter against the Prismic SDK - const url = await PrismicClient.previewSession(ref, linkResolver, '/') + const url = await PrismicClient.getPreviewResolver(ref, documentId).resolve( + linkResolver, + '/' + ) if (!url) { return res.status(401).json({ message: 'Invalid token' }) diff --git a/examples/custom-server-actionhero/config/tasks.js b/examples/custom-server-actionhero/config/tasks.js index 1fdecb0aefc0c..8ef6b0bbd7496 100644 --- a/examples/custom-server-actionhero/config/tasks.js +++ b/examples/custom-server-actionhero/config/tasks.js @@ -37,7 +37,7 @@ exports['default'] = { maxTaskProcessors: 0, // how often should we check the event loop to spawn more taskProcessors? checkTimeout: 500, - // how many ms would constitue an event loop delay to halt taskProcessors spawning? + // how many ms would constitutes an event loop delay to halt taskProcessors spawning? maxEventLoopDelay: 5, // When we kill off a taskProcessor, should we disconnect that local redis connection? toDisconnectProcessors: true, diff --git a/examples/using-router/pages/index.js b/examples/using-router/pages/index.js index 4ead9ec92d442..36583518a84cd 100644 --- a/examples/using-router/pages/index.js +++ b/examples/using-router/pages/index.js @@ -1,4 +1,4 @@ -import Header from '../components/header' +import Header from '../components/Header' export default function Home() { return ( diff --git a/examples/with-cookie-auth-fauna/pages/profile.js b/examples/with-cookie-auth-fauna/pages/profile.js index e76b566837645..e45df8405c9bc 100644 --- a/examples/with-cookie-auth-fauna/pages/profile.js +++ b/examples/with-cookie-auth-fauna/pages/profile.js @@ -24,7 +24,7 @@ const Profile = () => { return (
Larger content should be still available as a fallback to{' '}
- fileLoader but it should not polute{' '}
+ fileLoader but it should not pollute{' '}
/.next/static/css folder. You should see two images
below. One, smaller, loaded as data url, and one, bigger,
loaded via url.
diff --git a/examples/with-sentry/README.md b/examples/with-sentry/README.md
index 7d70711f564e2..4b1200bccea59 100644
--- a/examples/with-sentry/README.md
+++ b/examples/with-sentry/README.md
@@ -57,7 +57,7 @@ cp .env.local.example .env.local
Next, Copy your Sentry DSN. You can get it from the settings of your project in **Client Keys (DSN)**. Then, copy the string labeled **DSN** and set it as the value for `NEXT_PUBLIC_SENTRY_DSN` inside `.env.local`
-> **Note:** Error tracking is disabled in development mode using the `NODE_ENV` environment variable. To change this behaviour, remove the `enabled` property from the `Sentry.init()` call inside your `_app.js` file.
+> **Note:** Error tracking is disabled in development mode using the `NODE_ENV` environment variable. To change this behavior, remove the `enabled` property from the `Sentry.init()` call inside your `_app.js` file.
### Step 2. Run Next.js in development mode
@@ -80,7 +80,7 @@ Your app should be up and running on [http://localhost:3000](http://localhost:30
3. Create an auth token in Sentry. The recommended way to do this is by creating a new internal integration for your organization. To do so, go into **Settings > Developer Settings > New internal integration**. After the integration is created, copy the Token.
4. Save the token inside the `SENTRY_AUTH_TOKEN` environment variable in `.env.local`.
-> **Note:** Sourcemap upload is disabled in development mode using the `NODE_ENV` environment variable. To change this behaviour, remove the `NODE_ENV === 'production'` check from your `next.config.js` file.
+> **Note:** Sourcemap upload is disabled in development mode using the `NODE_ENV` environment variable. To change this behavior, remove the `NODE_ENV === 'production'` check from your `next.config.js` file.
## Other configuration options
diff --git a/examples/with-tesfy/README.md b/examples/with-tesfy/README.md
index fd15316d99911..c4eb4d0ae0a96 100644
--- a/examples/with-tesfy/README.md
+++ b/examples/with-tesfy/README.md
@@ -8,7 +8,7 @@ To use Tesfy there are only two mandatory things needed. A `userId` and a config
The `userId` must uniquely identify a user even if not logged in, for that reason a [uuid](https://en.wikipedia.org/wiki/Universally_unique_identifier) is created and stored in a cookie so the next time a page is requested a new `userId` won't be created, instead the cookie one will be used.
-The `datafile` is just a `json` that defines the configuration of the experiments and features avaliable. It must be fetched from Tesfy CDN or from your own servers at least everytime a request is performed, later on this configuration could also be fetched if wanted (e.g. during page transitions).
+The `datafile` is just a `json` that defines the configuration of the experiments and features available. It must be fetched from Tesfy CDN or from your own servers at least everytime a request is performed, later on this configuration could also be fetched if wanted (e.g. during page transitions).
## Deploy your own
diff --git a/examples/with-universal-configuration-build-time/.gitignore b/examples/with-universal-configuration-build-time/.gitignore
new file mode 100644
index 0000000000000..1437c53f70bc2
--- /dev/null
+++ b/examples/with-universal-configuration-build-time/.gitignore
@@ -0,0 +1,34 @@
+# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
+
+# dependencies
+/node_modules
+/.pnp
+.pnp.js
+
+# testing
+/coverage
+
+# next.js
+/.next/
+/out/
+
+# production
+/build
+
+# misc
+.DS_Store
+*.pem
+
+# debug
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+
+# local env files
+.env.local
+.env.development.local
+.env.test.local
+.env.production.local
+
+# vercel
+.vercel
diff --git a/examples/with-universal-configuration-runtime/.gitignore b/examples/with-universal-configuration-runtime/.gitignore
new file mode 100644
index 0000000000000..1437c53f70bc2
--- /dev/null
+++ b/examples/with-universal-configuration-runtime/.gitignore
@@ -0,0 +1,34 @@
+# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
+
+# dependencies
+/node_modules
+/.pnp
+.pnp.js
+
+# testing
+/coverage
+
+# next.js
+/.next/
+/out/
+
+# production
+/build
+
+# misc
+.DS_Store
+*.pem
+
+# debug
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+
+# local env files
+.env.local
+.env.development.local
+.env.test.local
+.env.production.local
+
+# vercel
+.vercel
diff --git a/lerna.json b/lerna.json
index b3bed1dbb7ec7..bc46f3075539d 100644
--- a/lerna.json
+++ b/lerna.json
@@ -17,5 +17,5 @@
"registry": "https://registry.npmjs.org/"
}
},
- "version": "9.4.5-canary.37"
+ "version": "9.4.5-canary.39"
}
diff --git a/packages/create-next-app/package.json b/packages/create-next-app/package.json
index 70b0f77fdacad..7403913025d14 100644
--- a/packages/create-next-app/package.json
+++ b/packages/create-next-app/package.json
@@ -1,6 +1,6 @@
{
"name": "create-next-app",
- "version": "9.4.5-canary.37",
+ "version": "9.4.5-canary.39",
"keywords": [
"react",
"next",
diff --git a/packages/eslint-plugin-next/lib/index.js b/packages/eslint-plugin-next/lib/index.js
index 910b702c4db0e..876aa2e91630e 100644
--- a/packages/eslint-plugin-next/lib/index.js
+++ b/packages/eslint-plugin-next/lib/index.js
@@ -3,6 +3,7 @@ module.exports = {
'no-css-tags': require('./rules/no-css-tags'),
'no-sync-scripts': require('./rules/no-sync-scripts'),
'no-html-link-for-pages': require('./rules/no-html-link-for-pages'),
+ 'no-unwanted-polyfillio': require('./rules/no-unwanted-polyfillio'),
},
configs: {
recommended: {
@@ -11,6 +12,7 @@ module.exports = {
'@next/next/no-css-tags': 1,
'@next/next/no-sync-scripts': 1,
'@next/next/no-html-link-for-pages': 1,
+ '@next/next/no-unwanted-polyfillio': 1,
},
},
},
diff --git a/packages/eslint-plugin-next/lib/rules/no-unwanted-polyfillio.js b/packages/eslint-plugin-next/lib/rules/no-unwanted-polyfillio.js
new file mode 100644
index 0000000000000..cfcbdda4d67d7
--- /dev/null
+++ b/packages/eslint-plugin-next/lib/rules/no-unwanted-polyfillio.js
@@ -0,0 +1,107 @@
+const NEXT_POLYFILLED_FEATURES = [
+ 'Array.prototype.@@iterator',
+ 'Array.prototype.copyWithin',
+ 'Array.prototype.fill',
+ 'Array.prototype.find',
+ 'Array.prototype.findIndex',
+ 'Array.prototype.flatMap',
+ 'Array.prototype.flat',
+ 'Array.from',
+ 'Array.prototype.includes',
+ 'Array.of',
+ 'Function.prototype.name',
+ 'fetch',
+ 'Map',
+ 'Number.EPSILON',
+ 'Number.Epsilon',
+ 'Number.isFinite',
+ 'Number.isNaN',
+ 'Number.isInteger',
+ 'Number.isSafeInteger',
+ 'Number.MAX_SAFE_INTEGER',
+ 'Number.MIN_SAFE_INTEGER',
+ 'Object.entries',
+ 'Object.getOwnPropertyDescriptor',
+ 'Object.getOwnPropertyDescriptors',
+ 'Object.is',
+ 'Object.keys',
+ 'Object.values',
+ 'Reflect',
+ 'Set',
+ 'Symbol',
+ 'Symbol.asyncIterator',
+ 'String.prototype.codePointAt',
+ 'String.prototype.endsWith',
+ 'String.fromCodePoint',
+ 'String.prototype.includes',
+ 'String.prototype.@@iterator',
+ 'String.prototype.padEnd',
+ 'String.prototype.padStart',
+ 'String.prototype.repeat',
+ 'String.raw',
+ 'String.prototype.startsWith',
+ 'String.prototype.trimEnd',
+ 'String.prototype.trimStart',
+ 'String.prototype.trim',
+ 'URL',
+ 'URLSearchParams',
+ 'WeakMap',
+ 'WeakSet',
+ 'Promise',
+ 'Promise.prototype.finally',
+ 'es2015', // Should be covered by babel-preset-env instead.
+ 'es2016', // Should be covered by babel-preset-env instead.
+ 'es2017', // Should be covered by babel-preset-env instead.
+ 'es2018', // Should be covered by babel-preset-env instead.
+ 'es2019', // Should be covered by babel-preset-env instead.
+ 'es5', // Should be covered by babel-preset-env instead.
+ 'es6', // Should be covered by babel-preset-env instead.
+ 'es7', // Should be covered by babel-preset-env instead.
+]
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+module.exports = {
+ meta: {
+ docs: {
+ description:
+ 'Prohibit unwanted features to be listed in Polyfill.io tag.',
+ category: 'HTML',
+ recommended: true,
+ },
+ fixable: null, // or "code" or "whitespace"
+ },
+
+ create: function (context) {
+ return {
+ 'JSXOpeningElement[name.name=script][attributes.length>0]'(node) {
+ const srcNode = node.attributes.find(
+ (attr) => attr.type === 'JSXAttribute' && attr.name.name === 'src'
+ )
+ if (!srcNode || srcNode.value.type !== 'Literal') {
+ return
+ }
+ const src = srcNode.value.value
+ if (
+ src.startsWith('https://cdn.polyfill.io/v2/') ||
+ src.startsWith('https://polyfill.io/v3/')
+ ) {
+ const featureQueryString = new URL(src).searchParams.get('features')
+ const featuresRequested = (featureQueryString || '').split(',')
+ const unwantedFeatures = featuresRequested.filter((feature) =>
+ NEXT_POLYFILLED_FEATURES.includes(feature)
+ )
+ if (unwantedFeatures.length > 0) {
+ context.report({
+ node,
+ message: `You're requesting polyfills from polyfill.io which are already shipped with NextJS. Please remove ${unwantedFeatures.join(
+ ', '
+ )} from the features list.`,
+ })
+ }
+ }
+ },
+ }
+ },
+}
diff --git a/packages/eslint-plugin-next/package.json b/packages/eslint-plugin-next/package.json
index 000450b154341..83eb16c6f9ee4 100644
--- a/packages/eslint-plugin-next/package.json
+++ b/packages/eslint-plugin-next/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/eslint-plugin-next",
- "version": "9.4.5-canary.37",
+ "version": "9.4.5-canary.39",
"description": "ESLint plugin for NextJS.",
"main": "lib/index.js",
"license": "MIT",
diff --git a/packages/next-bundle-analyzer/package.json b/packages/next-bundle-analyzer/package.json
index 0f2f34d9fce5b..a93d1296386e3 100644
--- a/packages/next-bundle-analyzer/package.json
+++ b/packages/next-bundle-analyzer/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/bundle-analyzer",
- "version": "9.4.5-canary.37",
+ "version": "9.4.5-canary.39",
"main": "index.js",
"license": "MIT",
"repository": {
diff --git a/packages/next-mdx/package.json b/packages/next-mdx/package.json
index b97d1ebcc043c..b08f7911f9d5e 100644
--- a/packages/next-mdx/package.json
+++ b/packages/next-mdx/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/mdx",
- "version": "9.4.5-canary.37",
+ "version": "9.4.5-canary.39",
"main": "index.js",
"license": "MIT",
"repository": {
diff --git a/packages/next-plugin-google-analytics/package.json b/packages/next-plugin-google-analytics/package.json
index 759b8389f1ef4..eb3ad1d3dbd3d 100644
--- a/packages/next-plugin-google-analytics/package.json
+++ b/packages/next-plugin-google-analytics/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-google-analytics",
- "version": "9.4.5-canary.37",
+ "version": "9.4.5-canary.39",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-google-analytics"
diff --git a/packages/next-plugin-sentry/package.json b/packages/next-plugin-sentry/package.json
index a320ce0856a41..2f53c0e619378 100644
--- a/packages/next-plugin-sentry/package.json
+++ b/packages/next-plugin-sentry/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-sentry",
- "version": "9.4.5-canary.37",
+ "version": "9.4.5-canary.39",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-sentry"
diff --git a/packages/next-plugin-storybook/package.json b/packages/next-plugin-storybook/package.json
index 2404dfae3e1fc..3a90f4d222dc9 100644
--- a/packages/next-plugin-storybook/package.json
+++ b/packages/next-plugin-storybook/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-storybook",
- "version": "9.4.5-canary.37",
+ "version": "9.4.5-canary.39",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-storybook"
diff --git a/packages/next-polyfill-nomodule/package.json b/packages/next-polyfill-nomodule/package.json
index 11a73b6fe15ef..48d9a3d856bed 100644
--- a/packages/next-polyfill-nomodule/package.json
+++ b/packages/next-polyfill-nomodule/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-nomodule",
- "version": "9.4.5-canary.37",
+ "version": "9.4.5-canary.39",
"description": "A polyfill for non-dead, nomodule browsers.",
"main": "dist/polyfill-nomodule.js",
"license": "MIT",
diff --git a/packages/next/build/webpack-config.ts b/packages/next/build/webpack-config.ts
index a0670e4d168b7..1d94e7482d159 100644
--- a/packages/next/build/webpack-config.ts
+++ b/packages/next/build/webpack-config.ts
@@ -1278,7 +1278,10 @@ export default async function getBaseWebpackConfig(
const originalFile = clientEntries[
CLIENT_STATIC_FILES_RUNTIME_MAIN
] as string
- entry[CLIENT_STATIC_FILES_RUNTIME_MAIN] = [...['main.js'], originalFile]
+ entry[CLIENT_STATIC_FILES_RUNTIME_MAIN] = [
+ ...entry['main.js'],
+ originalFile,
+ ]
}
delete entry['main.js']
diff --git a/packages/next/build/webpack/config/blocks/css/index.ts b/packages/next/build/webpack/config/blocks/css/index.ts
index bc0ab532fb2a9..5843509d6c431 100644
--- a/packages/next/build/webpack/config/blocks/css/index.ts
+++ b/packages/next/build/webpack/config/blocks/css/index.ts
@@ -102,7 +102,7 @@ export const css = curry(async function css(
)
// CSS Modules support must be enabled on the server and client so the class
- // names are availble for SSR or Prerendering.
+ // names are available for SSR or Prerendering.
fns.push(
loader({
oneOf: [
diff --git a/packages/next/build/webpack/plugins/next-esm-plugin.ts b/packages/next/build/webpack/plugins/next-esm-plugin.ts
index a3071fce959f0..c45a76d8c954c 100644
--- a/packages/next/build/webpack/plugins/next-esm-plugin.ts
+++ b/packages/next/build/webpack/plugins/next-esm-plugin.ts
@@ -289,7 +289,7 @@ export class NextEsmPlugin implements Plugin {
plugins = plugins.concat(this.options.additionalPlugins)
/**
- * We are deliberatly not passing plugins in createChildCompiler.
+ * We are deliberately not passing plugins in createChildCompiler.
* All webpack does with plugins is to call `apply` method on them
* with the childCompiler.
* But by then we haven't given childCompiler a fileSystem or other options
diff --git a/packages/next/client/dev/error-overlay/format-webpack-messages.js b/packages/next/client/dev/error-overlay/format-webpack-messages.js
index fca10a28a192a..8ad928e47fb35 100644
--- a/packages/next/client/dev/error-overlay/format-webpack-messages.js
+++ b/packages/next/client/dev/error-overlay/format-webpack-messages.js
@@ -34,7 +34,10 @@ function isLikelyASyntaxError(message) {
function formatMessage(message) {
// TODO: Replace this once webpack 5 is stable
if (typeof message === 'object' && message.message) {
- message = (message.file ? message.file + '\n' : '') + message.message
+ message =
+ (message.moduleName ? message.moduleName + '\n' : '') +
+ (message.file ? message.file + '\n' : '') +
+ message.message
}
let lines = message.split('\n')
diff --git a/packages/next/client/dev/event-source-polyfill.js b/packages/next/client/dev/event-source-polyfill.js
index 643f8aaaf1fd2..d68ee57d6d9d3 100644
--- a/packages/next/client/dev/event-source-polyfill.js
+++ b/packages/next/client/dev/event-source-polyfill.js
@@ -280,7 +280,7 @@ XHRWrapper.prototype.open = function (method, url) {
// XDomainRequest#abort removes onprogress, onerror, onload
xhr.onload = onFinish
xhr.onerror = onFinish
- // improper fix to match Firefox behaviour, but it is better than just ignore abort
+ // improper fix to match Firefox behavior, but it is better than just ignore abort
// see https://bugzilla.mozilla.org/show_bug.cgi?id=768596
// https://bugzilla.mozilla.org/show_bug.cgi?id=880200
// https://code.google.com/p/chromium/issues/detail?id=153570
diff --git a/packages/next/lib/typescript/writeConfigurationDefaults.ts b/packages/next/lib/typescript/writeConfigurationDefaults.ts
index e6c6b19cdd1e1..491200c9a6c2c 100644
--- a/packages/next/lib/typescript/writeConfigurationDefaults.ts
+++ b/packages/next/lib/typescript/writeConfigurationDefaults.ts
@@ -7,7 +7,12 @@ import { getTypeScriptConfiguration } from './getTypeScriptConfiguration'
type DesiredCompilerOptionsShape = {
[key: string]:
| { suggested: any }
- | { parsedValue?: any; value: any; reason: string }
+ | {
+ parsedValue?: any
+ parsedValues?: Array (
delete loadableOptions.webpack
delete loadableOptions.modules
- // This check is neccesary to prevent react-loadable from initializing on the server
+ // This check is necessary to prevent react-loadable from initializing on the server
if (!isServerSide) {
return LoadableInitializer(loadableOptions)
}
diff --git a/packages/next/next-server/lib/router/router.ts b/packages/next/next-server/lib/router/router.ts
index a52e31ac04985..2c5d2e175cbb5 100644
--- a/packages/next/next-server/lib/router/router.ts
+++ b/packages/next/next-server/lib/router/router.ts
@@ -38,10 +38,6 @@ export function delBasePath(path: string): string {
return path.slice(basePath.length) || '/'
}
-function prepareRoute(path: string) {
- return removePathTrailingSlash(delBasePath(path || '/'))
-}
-
type Url = UrlObject | string
/**
@@ -134,50 +130,42 @@ const manualScrollRestoration =
typeof window !== 'undefined' &&
'scrollRestoration' in window.history
-function fetchNextData(
- dataHref: string,
- isServerRender: boolean,
- cb?: (...args: any) => any
-) {
- let attempts = isServerRender ? 3 : 1
- function getResponse(): Promise