Commit graph

112 commits

Author SHA1 Message Date
JJ Kasper
5c6a20dbfc Add refresh header for 308 redirect for IE11 compatibility (#10042) 2020-01-10 15:54:23 -05:00
JJ Kasper
14ca20d0d5 Add warning when API resolves without the request being finished (#9999)
* Add error when API resolves without the request being finished

* Update to only show warning in development instead

* Update packages/next/next-server/server/api-utils.ts

Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-01-10 10:56:20 -05:00
JJ Kasper
3e923d059d Fix public/ file name encoding (#10022)
* Update serving of files from public folder to handle special chars

* Update tests and match handling in dev mode

* Fix windows public file handling

* Remove colon test to make git on windows happy

* Remove un-used files

* Add missing await
2020-01-09 21:56:05 -05:00
Joe Haddad
af82f322e5
Enable New CSS Support by Default (#9927)
* Enable New CSS Support by Default

* Adjust configs

* Fix invisible AMP body

* Fix AMP validation warning

* test fix

* Use expression that won't be eliminated by babel
2020-01-09 15:31:28 -05:00
Jan Potoms
2112e81ae4 Don't prepend a slash on empty path (#9973)
Fixes https://github.com/zeit/next.js/issues/9678

Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-01-08 11:45:17 -05:00
Afzal Sayed
58b2d9e208 Use optional chaining syntax (#9975)
* Use optional chaining syntax

* Changes as per review

* Bug fix
2020-01-08 11:30:53 -05:00
Joe Haddad
3c8fff354b
Simplify <Link> Prefetch Deduping (#9987)
* Simplify `<Link>` Prefetch Deduping

* Fix test

* Update test/integration/preload-viewport/test/index.test.js

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

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-01-07 18:25:44 -05:00
Joe Haddad
2757826cf7
Use <script defer> by default, matching <script type=module> (#9966)
* Use `<script defer>` by default, matching `<script module>` behavior

* remove old test
2020-01-06 14:55:08 -05:00
Joe Haddad
a50a0577d2 Fix Tests (#9963) 2020-01-06 10:43:26 -06:00
Tim Neutkens
32ec4f6913 Allow for shortened names for certain items (#9949)
* Use smaller name as it's not shortened

* Remove export as it's not used and it'll be shortened

* Update size

Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-01-04 15:53:33 -05:00
Tim Neutkens
7e817cab04 Remove rewriteUrlForNextExport from bundles when option is not enabled (#9946)
Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-01-04 12:16:57 -05:00
Tim Neutkens
1fd57d22d5
Remove experiment (#9945)
* Remove experiment

* Add back ssr-prepass for serverless test

* Update size as they both decreased

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-01-04 17:40:18 +01:00
Joe Haddad
9261b82a82
Enable New Chunking Behavior (#9731)
* Enable New Chunking Behavior

* fix tst

* Increase sizes in test

* add another test

* Fix preloading order

* Replace commons with framework
2020-01-03 15:55:10 -05:00
Igor Crispim Diniz
2f1b15c674 Fix _app global css import order (#9836)
* fix root components import order

* import order tests

* chunks attachment order tests
2020-01-03 18:00:06 +01:00
Tim Neutkens
c8799f9e7d
Enable catchAllRouting by default (#9922) 2020-01-03 16:51:26 +01:00
Joe Haddad
00179adcaa
Fix User Error in Async API Endpoint (#9911) 2020-01-02 18:47:39 -05:00
JJ Kasper
ad7bb4e352 Add headers support to custom-routes (#9879)
* Add headers support to custom-routes

* Update manifest version test

* Add headers field for dynamic routes test

* Update test
2020-01-01 13:47:58 +01:00
JJ Kasper
5c72663c87
Ensure params in query are updated for custom-routes (#9797)
* Add handling for params in destination query

* Update describe name
2019-12-31 14:13:55 -06:00
Joe Haddad
0957ed6f32
Use Cached SSG Data on History Navigation (#9887)
* Use Cached SSG Data on History Navigation

* Add data caching test

* Create a static data cache

* Eliminate an if / return

* Do not cache in dev mode

* bump

* bump

* bump

* bump

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2019-12-30 17:57:06 -05:00
JJ Kasper
39ccd8ffe8 Add error for rewrite to auto-exported dynamic page (#9816)
* Add error for rewrite to auto-exported dynamic page

* Update packages/next/next-server/server/render.tsx

Co-authored-by: Joe Haddad <timer150@gmail.com>
2019-12-30 14:06:38 -05:00
Joe Haddad
078b2a5e49 Refactor SSG Data Fetching (#9884) 2019-12-30 12:40:23 -06:00
Tim Neutkens
86808bbce2
Add basePath support (#9872)
* Add basePath support

* Add tests including copy of HMR tests

* Add production tests

* Add tests for serverless target

* Add missing quotes
2019-12-29 20:03:12 +01:00
Joe Haddad
2d0ad7d40c
Refactor Router#getInitialProps (#9853)
This PR refactors `Router#getInitialProps` in preparation for dedicated SSG fetching logic. This PR should have no functional change -- please review it carefully.
2019-12-29 14:01:46 -05:00
Joe Haddad
6b50b1322b Allow Boolean API Response (#9842) 2019-12-26 15:38:12 -06:00
Joe Haddad
ec440d4b7b
Allow Empty API Body (#9838) 2019-12-26 14:23:06 -05:00
JJ Kasper
b9865ba32e Add checking filesystem after each rewrite (#9568)
* Add check: true behavior to custom routes

* Update adding dev routes

* Add checking of pages and dynamic routes for check: true

* Fix hasPage binding

* Add tests for check: true behavior

* Update regex checking

* Make changes based on review

* Update to handle rewrites in serverless loader

* Update to not change req.url

* Make sure to always parse dynamic route params

* Export all of pathToRegexp from path-match

Co-authored-by: Joe Haddad <timer150@gmail.com>
2019-12-23 16:20:17 -05:00
JJ Kasper
1ec7716fe6
Prevent re-observing for an already prefetched page (#9644)
* Prevent re-observing for an already prefetched page

* Update size-limit test

* Move prefetched setting

* Remove extra prefetched setting
2019-12-20 15:30:58 -06:00
Lachlan Campbell
8e1046d94a Fix error message typo: "Keys that need moved" (#9772) 2019-12-17 14:25:02 -10:00
JJ Kasper
463d30ec9d
Add handling for external redirects (#9764) 2019-12-17 11:02:39 -06:00
Tim Neutkens
2ba056aa20
Add check for invalid assetPrefix (#9759)
* Add check for invalid assetPrefix

* Update test/integration/invalid-config-values/test/index.test.js

Co-Authored-By: JJ Kasper <jj@jjsweb.site>
2019-12-16 16:07:03 +01:00
Joe Haddad
62a6ece4b9 Emit Static Export Intent (#9737)
* Emit Static Export Intent

* Remove the old export detail on rebuild

* Add test cases

* fix export

* Add a resolve return
2019-12-13 13:30:22 -06:00
JJ Kasper
677a9509f3 Fix query values being passed in dev mode for SSG (#9734)
* Fix query values being passed in dev mode for SSG

* Update test names
2019-12-13 13:14:09 -05:00
Joe Haddad
2347e3e47e
Adjust return value (#9712)
* Adjust return value

* Add delay
2019-12-11 16:32:16 -05:00
JJ Kasper
a40a32d1cc Fix SSG tests failing on windows (#9710) 2019-12-11 14:36:35 -05:00
Joe Haddad
e11cf22721 Enable New Chunking for CSS (#9688)
* Enable New Chunking for CSS

* set false
2019-12-10 14:21:52 -06:00
JJ Kasper
da1ef5062f Refactor next-server some for easier page checking (#9671)
* De-dupe pagesManifest

* Update handleApiRequest a bit

* Simplify handleApiRequest a bit

* Update packages/next/next-server/server/next-server.ts


Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2019-12-10 10:08:42 -05:00
JJ Kasper
6c103ef5a6 Add checking of custom routes for invalid fields (#9434)
* Add checking of custom routes for invalid fields

* Remove un-used test imports

* Mentioned statusCode can be undefined in error message

* Update test

* Update invalid routes output

* Add checking to make sure source/destination start with slash

* Update import
2019-12-10 09:54:56 -05:00
Luis Alvarez D
56c1392bd6 Use NextComponentType in NextPage (#9575) 2019-12-03 13:35:20 -05:00
Joe Haddad
bd8b1221e5
Support repeating Dynamic Route Params (#9599)
* Test for desired catch all behavior

* Support `repeat`ing Dynamic Route Params

x-ref: #9598
2019-12-02 16:55:49 -05:00
Joe Haddad
69b7538dce
Simplify getRouteRegex Callsites (#9597) 2019-12-02 16:43:30 -05:00
Joe Haddad
ca3f881a42 s/getStaticParams/getStaticPaths/ (#9565)
* WIP: rename get static paths

* Adjust logic

* Add warning

* rename constant

* Check for error when using old method

* Add friendly error message

* Test for message of invalid keys

* replace index with dots
2019-11-27 21:46:16 -06:00
Joe Haddad
a6656a0b84
Upgrade path-to-regexp (#9553)
* Upgrade `path-to-regexp`

* Correct import

* Update delimiter

* Fix path match

* Fix hot loader

* Fix params.path usage and pathToRegexp import

* Revert changes for params.path

* Fix lint

* Simplify path match function

* Delimiter should always be `/`

* Fix passed in params

* Add new regex wrapping

* Wrap another route

* Fix error message match
2019-11-27 16:48:28 -05:00
Adam Stankiewicz
9c9f0609a0 Fix deduplicating dynamic (array) meta tags (#9315) 2019-11-26 12:27:33 -05:00
JJ Kasper
cd8e72d5e3 Add custom routes to build output (#9517)
* Add custom routes to build output

* De-dupe code a bit
2019-11-26 10:33:47 +01:00
Joe Haddad
302407486e
Specify Invalid Dynamic Route Values (#9525) 2019-11-25 17:15:23 -05:00
JJ Kasper
409f20a9ca
Fix AMP HTML content emit (#9468)
* Add failing test

* Escape dollar signs in AMP HTML

* Update to not use replace for updating AMP_RENDER_TARGET
2019-11-25 14:05:52 -06:00
JJ Kasper
ff2d28c4ff Add err.sh for invalid multi-match usage (#9498)
* Adds err.sh for multi-match error

* Fix missing apostrophe

* Update regex to catch other param names

* Add test for multi-match error

* Update test/integration/invalid-multi-match/test/index.test.js
2019-11-23 02:23:01 +01:00
JJ Kasper
29d267a1dc
Add handling for rewriting to /_next with catchall (#9466)
* Add handling for rewriting to /_next with catchall

* bump
2019-11-20 09:53:31 -06:00
Tim Neutkens
6a2c16a945
Update router to have only one route traverse pass (#9435)
* Fix next-news inconsistent return type

* Add failing test for static file rewrite

* Revert "Fix next-news inconsistent return type"

This reverts commit b66e76fb86061e45741c3c4bb9296a0874900f76.

* Add failing test for double redirect

* Fix bug in matcher when having multiple redirects

* Remove custom traversal in favor of router handling it

* Update next-server.ts

* Update router.ts

* Temporarily disable test

* Don't deeply resolve redirects

* Support combined parameters + query passing

* Make sure params are correctly passed in

* Add test for hash in route
2019-11-17 16:12:48 -08:00
JJ Kasper
09cab2df5e Fix typo in serverless loader (#9431)
* Fix typo in serverless loader

* Add test for top level error in API route

* Fix type error
2019-11-15 18:00:24 -08:00