- 23 6月, 2020 3 次提交
-
-
由 Jan Potoms 提交于
Noticed this while reviewing https://github.com/vercel/next.js/pull/14376. After having done https://github.com/vercel/next.js/pull/13699, this code didn't feel right to me: ```js function prepareRoute(path: string) { path = delBasePath(path || '') // this /index rewrite is problematic, it makes pages/index.js // and pages/index/index.js point to the same thing: return toRoute(!path || path === '/' ? '/index' : path) } ``` Added a nested index page to the prerender tests and found it was rendering the `/` route on navigation. This uncovered 2 more places around the dataroute where the index path was not translated correctly. **edit:** Just to note that there was nothing wrong with https://github.com/vercel/next.js/pull/14376, the issue was already there, I just noticed it while reading that PR
-
由 Tim Neutkens 提交于
Gets rid of the custom function for naming files by removing buildId from the file paths.
-
由 Jan Potoms 提交于
Noticed while working on https://github.com/vercel/next.js/pull/14400 that the optional catch-all handling was missing in `namedRegex`. This whole file also seemed quite regex heavy so I took a look at the overall logic and changed a few things. It worked by regex escaping the whole route then unescape the dynamic parts. I changed it to only regex escape the static parts, this eliminates unnecessary back and forth escaping. It also makes the dynamic parts handling more readable. The whole logic is less reliant on regexes and just uses simple string manipulation to translate the route into a regex, I didn't measure anything but as an effect this should make it more performant.
-
- 22 6月, 2020 1 次提交
-
-
由 Jan Potoms 提交于
Fix https://github.com/vercel/next.js/issues/14290 and a couple other issues around optional catch-all that popped up after writing these tests Closes https://github.com/vercel/next.js/pull/14344
-
- 16 6月, 2020 1 次提交
-
-
由 JJ Kasper 提交于
This updates the named regexes output in the `routes-manifest` and the associated `routeKeys` to not use any non-word characters as this breaks the named regexes e.g. `"Invalid regular expression: "^/(?<data\-provider\-id>[^/]+?)(?:/)?$"` x-ref: https://github.com/zeit/now/pull/4355
-
- 10 6月, 2020 1 次提交
-
-
由 JJ Kasper 提交于
As noticed in https://github.com/vercel/next.js/pull/13506 when a build or export command fails the tests can just stall. This attempts to address that by rejecting when the command doesn't exit correctly and `stdout` and `stderr` aren't being looked at
-
- 05 6月, 2020 1 次提交
-
-
由 JJ Kasper 提交于
This error isn't specific to just fallback SSG pages since any dynamic SSG page that is rewritten to can cause the `/_next/data` request to fail also since it currently derived from the the URL. This can also fail for `getServerSideProps` since it derives the `/_next/data` URL the same way so might need to be updated to show in that case also
-
- 02 6月, 2020 1 次提交
-
-
由 Joe Haddad 提交于
In serverless mode, it's best practice to propagate an unhandled error so that the function is disposed instead of recycled. This helps fix the "bad state" problem.
-
- 01 6月, 2020 1 次提交
-
-
由 JJ Kasper 提交于
This addresses some errors for `/_next/data` requests where encoded `/` values in dynamic route param would cause invalid behavior, a headers already sent error would be shown when sending the fallback page in development, and when rendering the `_error` page for a data request the error response would still be treated as a data request. This also adds test cases for these errors to prevent regression
-
- 30 5月, 2020 1 次提交
-
-
由 JJ Kasper 提交于
Since non-fallback pages don't rely on the URL for hydration we can allow them to be rewritten to but pages with fallback still can't be rewritten to because we won't be able to parse the correct `/_next/data` path to request the page's data from. I added a test for this behavior and ensured it works correctly on Now. Example on with fallback false rewrite on Now: https://tst-rewrite-cp9vge4bg.now.sh/about
-
- 29 5月, 2020 1 次提交
-
-
由 Joe Haddad 提交于
This PR checks if our tests can be ran faster by disabling source maps unless they're used for the purpose of testing.
-
- 19 5月, 2020 4 次提交
-
-
由 JJ Kasper 提交于
-
由 Joe Haddad 提交于
-
由 Jan Potoms 提交于
-
由 Joe Haddad 提交于
-
- 17 5月, 2020 1 次提交
-
-
由 Jan Potoms 提交于
-
- 11 5月, 2020 1 次提交
-
-
由 Joe Haddad 提交于
-
- 28 4月, 2020 1 次提交
-
-
由 JJ Kasper 提交于
-
- 03 4月, 2020 1 次提交
-
-
由 JJ Kasper 提交于
* Rename unstable GSP revalidate field * Update error message * Tweak error message some more * Apply suggestions from code review Co-Authored-By: NJoe Haddad <joe.haddad@zeit.co> Co-authored-by: NJoe Haddad <joe.haddad@zeit.co>
-
- 26 3月, 2020 1 次提交
-
-
由 JJ Kasper 提交于
-
- 10 3月, 2020 1 次提交
-
-
由 Joe Haddad 提交于
* Verify GS(S)P Serializability * Add support for cyclic refs * Add unit tests * Test for error in development mode * Fix prerender preview tests * Fix gssp preview tests * fix 2x test cases * Add desired test * fix some more tests * Fix route manifest expect * Fix test expects * Test that `getServerSideProps` does not error in production * Test that getStaticProps is not checked in production * Test serialization check during build * Fix export detection for serverless * Update test/unit/is-serializable-props.test.js Co-Authored-By: NJJ Kasper <jj@jjsweb.site> Co-authored-by: NJJ Kasper <jj@jjsweb.site>
-
- 06 3月, 2020 2 次提交
-
-
由 Joe Haddad 提交于
* Fix Prerender Test Cases * fix test
-
由 Joe Haddad 提交于
-
- 04 3月, 2020 1 次提交
-
-
由 JJ Kasper 提交于
* Add identifier to NEXT_DATA for gs(s)p * Apply suggestions from code review Co-Authored-By: NJoe Haddad <joe.haddad@zeit.co> * fix lint * apply lint fix Co-authored-by: NJoe Haddad <timer150@gmail.com>
-
- 29 2月, 2020 1 次提交
-
-
由 JJ Kasper 提交于
-
- 28 2月, 2020 1 次提交
-
-
由 JJ Kasper 提交于
* Rename getServerProps to getServerSideProps * Remove unstable_ prefix from new methods * Add error when legacy methods are detected * Add legacy methods for babel transform * Add unstable_getServerSideProps also * Apply suggestions from code review Co-Authored-By: NJoe Haddad <joe.haddad@zeit.co> * Update types import Co-authored-by: NJoe Haddad <timer150@gmail.com>
-
- 27 2月, 2020 3 次提交
-
-
由 Joe Haddad 提交于
* Ability to Disable SSG Fallback * Throw error when value is missing * Fix existing tests * Adjust error message * Do not render fallback at build time for `fallback: false` page * Fix existing fallback behavior * fix build * fix version * fix some tests * Fix last test * Add docs for get static paths * Add explicit mode tests * test for fallback error message
-
由 JJ Kasper 提交于
* Add dataRoutes field to routes-manifest for SSG and serverProps routes * Update routes-manifest test
-
由 JJ Kasper 提交于
* Make sure to show error when url prop is returned for a page * Update test and handle undefined pageProps * Handle empty props * Apply suggestions from code review Co-Authored-By: NTim Neutkens <tim@timneutkens.nl> * Update tests * Update to not add url prop for SSG/SSP pages * Update errsh for reserved prop * Update errsh wording some more * Update tests and to warn instead of error * Update reserved prop warning * Include page in url prop warning Co-authored-by: NTim Neutkens <tim@timneutkens.nl> Co-authored-by: NJoe Haddad <timer150@gmail.com>
-
- 25 2月, 2020 3 次提交
-
-
由 JJ Kasper 提交于
* Add calling getStaticPaths in development before showing fallback * Move staticPathsWorker to next-dev-server * Make sure to clear require cache in worker process * bump * Remove staticPathsCache member * Update numWorkers for staticPathsWorker
-
由 Joe Haddad 提交于
* Improve Nested Catch-All Coverage * use check
-
由 Joe Haddad 提交于
* Test Prerender in Emulated Serverless Mode * Clean up between runs
-
- 24 2月, 2020 1 次提交
-
-
由 JJ Kasper 提交于
-
- 21 2月, 2020 1 次提交
-
-
由 JJ Kasper 提交于
* Add error messages for dynamic SSG page without getStaticPaths * Update error check * Update test file * Update another test file * Adjust Co-authored-by: NJoe Haddad <timer150@gmail.com>
-
- 16 2月, 2020 1 次提交
-
-
由 Joe Haddad 提交于
This adds a `isFallback` property to detect if the page is being rendered in "fallback" mode or normal mode. Accessed via the `useRouter()` hook. --- Closes #10527
-
- 13 2月, 2020 2 次提交
-
-
由 Joe Haddad 提交于
-
由 Joe Haddad 提交于
* Adjust SSG Loading Behavior * Update expected preview behavior * Rename two corrections * Only use skeleton in production for now * Fix "should SSR SPR page correctly" test * fix tests * fix trailing comment letter * disable test for now
-
- 08 2月, 2020 2 次提交
-
-
由 JJ Kasper 提交于
* Add error message when rewriting to dynamic SSG page * Update comment Co-authored-by: NJoe Haddad <timer150@gmail.com>
-
由 JJ Kasper 提交于
* Add paths field for unstable_getStaticPaths * Make sure to specify page in getStaticPaths errors
-
- 07 2月, 2020 1 次提交
-
-
由 JJ Kasper 提交于
* Add initial SSG fallback handling * Remove extra changes and update fallback handling * Remove extra timeout for testing * Update SSG tests in dynamic-routing suite * Add racing to decide between rendering fallback and data * Update size-limit test * Update comment * Make sure to follow correct route change order * Make comment more verbose for racing * Revert getStaticData to only return Promise * Make sure to update URL on fallback * Add retrying for data, de-dupe initial fallback request, and merge fallback replace * Update to add preload for fallback pages data * Add test for data preload link * Use pre-built fallback in production mode * Remove preload link for fallback from _document * Update to make sure fallback is rendered correctly for serverless
-