Commit graph

815 commits

Author SHA1 Message Date
Joe Haddad
50c95d16b4
Send Credentials for getServerSideProps Requests (#10826)
* Send Credentials for `getServerSideProps` Requests

* Fix tests
2020-03-04 11:56:08 -05:00
JJ Kasper
70cb5bd726
Update to make sure preview mode works with getServerSideProps (#10813)
* Update to make sure preview mode works with getServerSideProps

* Update to only parse previewData in GS(S)P mode
2020-03-04 13:58:12 +01:00
JJ Kasper
4ef1cd4ebe
Add identifier to NEXT_DATA for gs(s)p (#10812)
* Add identifier to NEXT_DATA for gs(s)p

* Apply suggestions from code review

Co-Authored-By: Joe Haddad <joe.haddad@zeit.co>

* fix lint

* apply lint fix

Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-03-03 13:39:08 -05:00
Joe Haddad
a5d0cb9d80
Measure getStaticProps, getServerSideProps (#10800)
* Measure `getStaticProps`, `getServerSideProps`

* Test new fields
2020-03-02 19:01:12 -05:00
Prateek Bhatnagar
16672a4353
Adding conformance checks (#10314)
* adding tests  for rect sync conformance check

* adding test for react sync script conformance check

* reverting yarn lock changes

* adding duplicate polyfill conformance

* bug fixes in dulpicate polyfill conformance check

* adding settings capability to conformance plugin

* removing minification check from server build

* bug fix

* settings for react sync script check
2020-03-02 22:53:18 +01:00
JJ Kasper
9ec3dae607
Fix next/config module mismatch in new serverless mode (#10792)
* Add failing test case

* Update serverless-loader require to fix config module mismatch

Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-03-02 12:38:16 -05:00
Joe Haddad
990eda2c88
Prefetch SSG Data (#10127)
* Prefetch SSG Data

* Update packages/next/client/page-loader.js

Co-Authored-By: JJ Kasper <jj@jjsweb.site>

* Revert router.ts

* Revert link.tsx

* undo change

* mimmic existing

* simplify

* Prefetch href and asPath

* fix load

* dedupe prefetchAs

* Inject script tag on hover

* comment prefetchAs

* minify code

* introduce lazy files

* Add some breathing room

* correct default type

* Prefetch non-dynamic data

* Prefetch dynamic route data

* Fix size test

* Humanize code

* add tests

* Disable code

* Only generate modern version in modern mode

* Extract function helper

* add comments

* Filter out dynamic route to simplify manifest size

* add test

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-03-02 12:14:40 -05:00
Joe Haddad
8f01a4ae83
Fix RenderOpts in next-server (#10776)
* Correctly pass preview data

* remove todo

* re-do change

* fix types

* Prevent regression
2020-03-02 11:58:47 +01:00
Joe Haddad
24345c9d06
Correctly Dedupe Prefetching (#10758)
* Correctly Dedupe Prefetching

* add test
2020-02-29 18:06:18 -05:00
Joe Haddad
e608c86b59
Separate Low Priority Files from Main Files (#10756)
* Separate Low Priority Files from Main Files

* Fix tests
2020-02-29 17:09:42 -05:00
Prateek Bhatnagar
5a82812568
Adding new types of performance monitoring (#10421)
* add new types of performance monitoring

* adding LCP

* adding cls to perf relayer

* add test for cls and lcp

* nit fixes

* re-organizing code

* fixing tests for lcp

* updating size limits in test
2020-02-28 17:44:03 -06:00
JJ Kasper
b2624012ea
Remove old eslint-ignores from unstable_ prefix (#10740) 2020-02-28 12:40:27 -05:00
Janicklas Ralph
7848615bd6
Fix url-polyfill dep and re-enable native-url (#10726)
* Adding native-url package

* Bumping native-url version

* Upgrading native-url

* Logging stats object for debugging

* Logging stats object for debugging

* Adding try catch to the error lines

* Experimenting with regex

* Experimenting with regex

* Experimenting with regex

* Testing regex changes

* Fixing defer-script test case to not include polyfill.js

* Meging changes with existing polyfill work

* Bumping version

* adjust webpack config

* Reduce size in size test

* Remove 1kb from legacy

* Bumping native-url version, includes fix for IE11

* Update lock file

* Updating native-url, fixes issue on IE11

* Fix sourcemap being added in document

* Adding Router as an app level dep. Fixes Router not being added as a dep to pages without Link when granularChunks is enabled

* Fix typescript error

* Fix modern + granularChunks hydration failing

* Fix TS error

* Update native-url version

* Adding native-url with safari fix

* Update url-polyfill in polyfill-nomodule package

* Remove url-polyfill from next package.json

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-02-27 22:08:58 -05:00
JJ Kasper
5b5d72ba56
Fix buildId being escaped breaking test with certain build ids (#10728) 2020-02-27 21:43:49 -05:00
JJ Kasper
c9d9f1131c
Remove unstable_ prefix from new methods (#10723)
* 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: Joe Haddad <joe.haddad@zeit.co>

* Update types import

Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-02-27 11:57:39 -06:00
JJ Kasper
2789e7e0c2
Rename getServerProps to getServerSideProps (#10722) 2020-02-27 11:04:30 -06:00
Luis Alvarez D
75559f1431
Add --example=<github-url> to create-next-app (#10226)
* Initial support for URLs

* Added folder support

* Added --example-path

* Bug fix

* Also install deps

* Updated error message

* Bug fix and replace the file path

* Added tests

Co-authored-by: Shu Uesugi <shu@chibicode.com>
2020-02-27 16:32:32 +01:00
Joe Haddad
47ff1eb95a
Ability to Disable SSG Fallback (#10701)
* 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
2020-02-27 13:23:28 +01:00
JJ Kasper
6dea45bdc9
Add dataRoutes field to routes-manifest for SSG and serverProps routes (#10622)
* Add dataRoutes field to routes-manifest for SSG and serverProps routes

* Update routes-manifest test
2020-02-26 14:35:02 -05:00
JJ Kasper
395714a475
Update url prop handling for pages with new data methods (#10653)
* 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: Tim 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: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-02-26 13:26:55 -05:00
JJ Kasper
364b4fe797
Make sure rewrites are handled in serverless mode correctly (#10697)
Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-02-26 13:14:34 -05:00
Tim Neutkens
513a7d5b5c
Update head-manager to compress better (#10687)
* Update head-manager to compress better

* Decrease size limit test
2020-02-26 13:56:13 +01:00
JJ Kasper
03611eefc4
Update error load fail test so that webdriver can still connect to app (#10673) 2020-02-24 17:16:31 -05:00
JJ Kasper
40abd708e1
Show better error when non-array is returned from custom-routes (#10670)
* Show better error when non-array is returned from custom-routes

* bump

Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-02-24 17:01:02 -05:00
JJ Kasper
f17e170c3d
Add calling getStaticPaths in development before showing fallback (#10611)
* 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
2020-02-24 16:36:59 -05:00
Joe Haddad
c3d914919a
Fix Double URL Encoding for Serverless (#10663) 2020-02-24 13:06:11 -05:00
Joe Haddad
c3f11c20ca
Improve Nested Catch-All Coverage (#10659)
* Improve Nested Catch-All Coverage

* use check
2020-02-24 12:19:58 -05:00
Joe Haddad
51b35f1f31
Test Prerender in Emulated Serverless Mode (#10660)
* Test Prerender in Emulated Serverless Mode

* Clean up between runs
2020-02-24 11:10:57 -05:00
JJ Kasper
7767a42fff
Make sure to log errors from data fetching in dev mode in the console (#10652) 2020-02-24 10:14:46 +01:00
Joe Haddad
89c792f67f
Preview Mode Should Not Cache (#10636)
* Preview Mode Should Not Cache

* add import

* fix import

* add tests

* Add real serverless mode tests
2020-02-22 10:26:39 +01:00
Joe Haddad
43a70c7ef1
Fix Cookie Expiration (#10634) 2020-02-21 16:05:43 -05:00
JJ Kasper
830090a4e1
Update error-load-fail test to use check to handle reload taking longer on windows (#10631)
* Update error-load-fail test to use check to handle reload taking longer on windows

* bump
2020-02-21 12:17:03 -05:00
Joe Haddad
40217b75b9
Revert "Re-Enable Native url Module (#10530)" (#10623)
This reverts commit b329f6a2d6.
2020-02-21 01:16:07 -05:00
JJ Kasper
f5cb1a69d7
Add error messages for dynamic SSG page without getStaticPaths (#10620)
* Add error messages for dynamic SSG page without getStaticPaths

* Update error check

* Update test file

* Update another test file

* Adjust

Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-02-21 00:57:10 -05:00
Janicklas Ralph
b329f6a2d6
Re-Enable Native url Module (#10530)
* Adding native-url package

* Bumping native-url version

* Upgrading native-url

* Logging stats object for debugging

* Logging stats object for debugging

* Adding try catch to the error lines

* Experimenting with regex

* Experimenting with regex

* Experimenting with regex

* Testing regex changes

* Fixing defer-script test case to not include polyfill.js

* Meging changes with existing polyfill work

* Bumping version

* adjust webpack config

* Reduce size in size test

* Remove 1kb from legacy

* Bumping native-url version, includes fix for IE11

* Update lock file

* Updating native-url, fixes issue on IE11

* Fix sourcemap being added in document

* Adding Router as an app level dep. Fixes Router not being added as a dep to pages without Link when granularChunks is enabled

* Fix typescript error

* Fix modern + granularChunks hydration failing

* Fix TS error

* Update native-url version

* Adding native-url with safari fix

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-02-21 00:25:49 -05:00
JJ Kasper
a8b39889f3
Update legacy safari test for GitHub actions (#10618) 2020-02-20 15:39:57 -06:00
JJ Kasper
3cd45bc331
Make sure to handle failing to load _error (#10617) 2020-02-20 22:25:41 +01:00
JJ Kasper
00855de60a
Add navigation test specific for Safari 10 (#10616)
* Add testing in Safari 10.1 on merge

* Add nav test specific for Safari 10
2020-02-20 13:35:28 -05:00
Tim Neutkens
e9e1a2b900
Disable setImmediate polyfill (#10612)
* Disable setImmediate polyfill

* Update size-limit

Co-authored-by: Joe Haddad <timer150@gmail.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-02-20 12:52:28 -05:00
Tim Neutkens
9a0d82b4d9
Clean up landed experimental flags (#10593)
* Clean up landed experimental flags

* Remove check for experimental flags from build too

* Remove /_errors/404 in favor of /404

* Remove unneeded check for pathname

* Update test paths

* Fix test

* Update test

* Remove test for disabled config

* Set pages404 always to true

Co-authored-by: Joe Haddad <timer150@gmail.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-02-19 14:54:38 -05:00
Richard van der Dys
103e82260d
Fixed pathname check in router (#10547)
* Fixed pathname check in router

Remove the query portion of the URL when checking paths

* Updated change and added trial test

* Update test

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-02-19 12:00:27 -05:00
Joe Haddad
a30e94f21a
Fix Nested Index Dynamic Routes in Development (#10595)
* Fix Nested Index Dynamic Routes in Development

* add missing
2020-02-19 11:13:04 -05:00
Joe Haddad
c58f45f42d
Add Failing CSS Test Case (#10590)
* Add Failing CSS Test Case

* update tests
2020-02-19 08:46:58 -05:00
JJ Kasper
9e8f173319
Update to latest watchpack with dynamic route rename fix (#10351)
* Fix dynamic route rename failing for case change

* Update normalizing curPageFiles

* Remove using webpacks file info since its inaccurate

* Revert changes in favor of fixing upstream

* Update to latest watchpack with case rename fix
2020-02-19 11:05:59 +01:00
JJ Kasper
db04cc57c1
Make sure to handle rejection when prefetching pages (#10579)
* Make sure to handle rejection when prefetching pages

* Update comment

* Make sure to show prefetch error in development still
2020-02-18 15:28:29 -06:00
JJ Kasper
c66f2f757c
Decrease number of expected preloads in safari (#10578) 2020-02-18 14:11:52 -06:00
Tim Neutkens
0222a09cd0
Enable polyfillsOptimization (#10574)
* Enable polyfillsOptimization

* Update sizes

* Commons is no longer there

* Update test
2020-02-18 19:26:55 +01:00
Tim Neutkens
743bf5d345
Enable scss/sass support (#10571)
Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-02-18 08:35:12 -05:00
Tim Neutkens
162f11c0c0
Add extra profiling app (#10568)
Just another app that I’ve been using for analysis
2020-02-18 10:30:34 +01:00
Joe Haddad
41e24a516a
Speculate Navigations for Client-Side JS (#10560)
* Speculate Navigations for Client-Side JS

* add tests

* avoid desctructure
2020-02-17 14:46:15 -06:00