- 10 Oct, 2020 1 commit
-
-
JJ Kasper authored
-
- 09 Oct, 2020 2 commits
-
-
JJ Kasper authored
-
JJ Kasper authored
Follow-up PR to #17370 this adds generating auto-export, non-dynamic SSG, and fallback pages with all locales. Dynamic SSG pages still control which locales the pages are generated with using `getStaticPaths`. To further control which locales non-dynamic SSG pages will be prerendered with a follow-up PR adding handling for 404 behavior from `getStaticProps` will be needed. x-ref: https://github.com/vercel/next.js/issues/17110
-
- 08 Oct, 2020 5 commits
-
-
JJ Kasper authored
-
JJ Kasper authored
This is a follow-up to https://github.com/vercel/next.js/pull/16973 which adds handling for the breaking change in the latest version of css-loader that causes unresolved file references in `url` or `import` to cause the build to fail. This fixes it by adding our own resolve checking and when it fails disabling the `css-loader`'s handling of it. Fixes: https://github.com/vercel/next.js/issues/17701
-
Jens Meindertsma authored
When using the `with-msw` example I noticed it increased my bundle size in production, even through MSW is meant to be used in development only. **Build size before implementing MSW** ``` Page Size First Load JS ┌ λ / 479 B 58.9 kB ├ /_app 0 B 58.4 kB └ ○ /404 3.44 kB 61.9 kB + First Load JS shared by all 58.4 kB ├ chunks/f6078781a05fe1bcb0902d23dbbb2662c8d200b3.b1b405.js 10.3 kB ├ chunks/framework.cb05d5.js 39.9 kB ├ chunks/main.a140d5.js 7.28 kB ├ chunks/pages/_app.b90a57.js 277 B └ chunks/webpack.e06743.js 751 B λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps) ○ (Static) automatically rendered as static HTML (uses no initial props) ● (SSG) automatically generated as static HTML + JSON (uses getStaticProps) (ISR) incremental static regeneration (uses revalidate in getStaticProps) ``` **Build size after implementing MSW according to the `with-msw` example** ``` Page Size First Load JS ┌ λ / 479 B 71.6 kB ├ /_app 0 B 71.1 kB └ ○ /404 3.44 kB 74.6 kB + First Load JS shared by all 71.1 kB ├ chunks/f6078781a05fe1bcb0902d23dbbb2662c8d200b3.b1b405.js 10.3 kB ├ chunks/framework.cb05d5.js 39.9 kB ├ chunks/main.a140d5.js 7.28 kB ├ chunks/pages/_app.c58a6f.js 13 kB └ chunks/webpack.e06743.js 751 B λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps) ○ (Static) automatically rendered as static HTML (uses no initial props) ● (SSG) automatically generated as static HTML + JSON (uses getStaticProps) (ISR) incremental static regeneration (uses revalidate in getStaticProps) ``` There was a 12.7 kB large increase in the `_app` First Load JS which increased the pages' First Load JS size. I tracked the problem down to the following code: ```js if (process.env.NEXT_PUBLIC_API_MOCKING === 'enabled') { require('../mocks') } ``` Removing this reduces the `_app` First Load JS to what it was previously. The `NEXT_PUBLIC_API_MOCKING` environment variable is defined in the `.env.development` file, as this means that Next.js will only activate MSW during development/testing, which is what MSW is intended for. After discussing with @kettanaito, the author of MSW, I did some investigation. This dynamic require statement is intended to allow tree-shaking of the MSW package for production. Unfortunately this did not seem to be working. To fix this, I changed the code to the following: ```js if (process.env.NODE_ENV !== 'production') { require('../mocks') } ``` This means I could remove the `NEXT_PUBLIC_API_MOCKING` environment variable from `.env.development`, as it is no longer used. It is important to note that this still achieves the same functionality as before: MSW runs in development / testing, and not in production. If MSW must be enabled in production for some reason, the following code can be used to run MSW regardless of the environment: ```js if (true) { require('../mocks') } ``` If possible, I'd love to hear from the Next.js maintainers regarding the tree-shaking process when using environment variables. Lastly, I made the necessary changes to have the example work in production mode as well, because there is no real backend. Of course there is a comment explaining what should be changed in a real world app. -
JJ Kasper authored
Follow-up PR to https://github.com/vercel/next.js/pull/17370 when the path is not prefixed with a locale and the default locale is the detected locale it doesn't redirect to locale prefixed variant. If the default locale path is visited and the default locale is visited this also redirects to the root removing the un-necessary locale in the URL. This also exposes the `defaultLocale` on the router since the RFC mentions `Setting a defaultLocale is required in every i18n library so it'd be useful for Next.js to provide it to the application.` although doesn't explicitly spec where we want to expose it. If we want to expose it differently this can be updated.
-
Henrik Wenz authored
# Issue The cache updates are performed in a wrong way, resulting in a duplicate collection: **Error:** ```log webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:88 Warning: Encountered two children with the same key, `6f3f7265-0d97-4708-a3ea-7dee76dc0a0a`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version. ``` **Video:**  # Fix **Video:** 
-
- 07 Oct, 2020 4 commits
-
-
JJ Kasper authored
This adds the initial changes outlined in the [i18n routing RFC](https://github.com/vercel/next.js/discussions/17078). This currently treats the locale prefix on routes similar to how the basePath is treated in that the config doesn't require any changes to your pages directory and is automatically stripped/added based on the detected locale that should be used. Currently redirecting occurs on the `/` route if a locale is detected regardless of if an optional catch-all route would match the `/` route or not we may want to investigate whether we want to disable this redirection automatically if an `/index.js` file isn't present at root of the pages directory. TODO: - [x] ensure locale detection/populating works in serverless mode correctly - [x] add tests for locale handling in different modes, fallback/getStaticProps/getServerSideProps To be continued in fall-up PRs - [ ] add tests for revalidate, auto-export, basePath + i18n - [ ] add mapping of domains with locales - [ ] investigate detecting locale against non-index routes and populating the locale in a cookie x-ref: https://github.com/vercel/next.js/issues/17110
-
JJ Kasper authored
-
JJ Kasper authored
-
JJ Kasper authored
-
- 06 Oct, 2020 2 commits
-
-
Tantan Fu authored
-
Joe Haddad authored
-
- 05 Oct, 2020 9 commits
-
-
Jashn Maloo authored
Fixes #17200
-
Lee Robinson authored
Addresses remaining comments from https://github.com/vercel/next.js/pull/17491.
-
Lee Robinson authored
Addresses https://github.com/vercel/next.js/issues/17453.
-
JJ Kasper authored
Follow-up to https://github.com/vercel/next.js/pull/17538 per https://github.com/vercel/next.js/pull/17538#discussion_r499647323 this updates the check to use the existing `hasNextSupport` export instead of checking the environment variable directly
-
James George authored
Added a test case to make sure that creating a new project within the current directory works as expected.
-
JJ Kasper authored
Follow-up to https://github.com/vercel/next.js/pull/17533 this makes sure the file used to signal release stats should be skipped for a non-release merge is created in a location that is accessible by the stats action and also updates the release action info detection for the new workflow
-
JJ Kasper authored
This makes sure to normalize the params for optional catch-all routes on Vercel since for `fallback: true` pages the `[[...paramName]]` value will be provided for the undefined/root param which needs to be normalized. Tests have been added in https://github.com/vercel/vercel/pull/5247 and were manually tested with the changes in this PR with https://github.com/ijjk/next-update-loader Fixes: https://github.com/vercel/next.js/issues/17220 x-ref: https://github.com/vercel/vercel/pull/5247
-
JJ Kasper authored
This adds a warning when `next export` and custom routes are defined outside of a platform that supports them since they won't be applied anymore.
-
Rafael Zerbini authored
Fixes #16431 * Added `.babelrc` with `next/babel` to remove the need of the React import on the `with-storybook` example.
-
- 04 Oct, 2020 1 commit
-
-
JJ Kasper authored
Noticed this method was left-over from previous query handling logic in `api-utils` while working on https://github.com/vercel/next.js/pull/17370 so this removes the extra code which should be safe since `api-utils` is an internal file that shouldn't be relied on externally.
-
- 03 Oct, 2020 2 commits
-
-
Joris W authored
The page describing exportPathMap goes straight into an example without explaining what the config is for.
-
JJ Kasper authored
Co-authored-by:kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
-
- 02 Oct, 2020 4 commits
-
-
Riccardo Di Maio authored
-
Yann Pringault authored
-
JJ Kasper authored
This adds a note about public files and pages taking higher priority over rewrites causing them to not be able to be rewritten unless the files are renamed first since this has been asked a few times. x-ref: https://github.com/vercel/next.js/discussions/17513 x-ref: https://github.com/vercel/next.js/discussions/9081#discussioncomment-22077 x-ref: https://github.com/vercel/next.js/discussions/9081#discussioncomment-21995
-
Dylan Jhaveri authored
-
- 01 Oct, 2020 2 commits
-
-
Lee Robinson authored
-
Luis Alvarez D authored
Fixes https://github.com/vercel/next.js/issues/17505
-
- 30 Sep, 2020 1 commit
-
-
Philihp Busby authored
If this component is missing, an error will be printed to the console ``` Expected Document Component Head was not rendered. Make sure you render them in your custom `_document` See more info here https://err.sh/next.js/missing-document-component ``` Additionally, any components which use CSS modules will fail with an error. This is documented in https://nextjs.org/docs/advanced-features/custom-document
-
- 29 Sep, 2020 2 commits
-
-
Amandeep Singh authored
-
Joe Haddad authored
-
- 28 Sep, 2020 2 commits
-
-
JJ Kasper authored
-
JJ Kasper authored
This handles the case where the children on a head element are undefined and not a string or an array of strings. This doesn't currently handle sub-children on head elements so additional handling will be needed if this is a feature we would like to support although can be discussed/investigated separately from this fix. Fixes: https://github.com/vercel/next.js/issues/17364 Fixes: https://github.com/vercel/next.js/issues/6388 Closes: https://github.com/vercel/next.js/pull/16751
-
- 27 Sep, 2020 1 commit
-
-
Tim Feeley authored
-
- 25 Sep, 2020 2 commits
-
-
JJ Kasper authored
-
JJ Kasper authored
* Expose dotenv loading under separate package * Update pre-compiled * Rename package to @next/env * Update lint ignores * Update package.json Co-authored-by:Joe Haddad <joe.haddad@zeit.co>
-