Commit graph

1436 commits

Author SHA1 Message Date
Janicklas Ralph
332852bf01 Integration test case for fetch alias (#9391)
* Polyfilling fetch and object-assign

* Polyfilling corejs object-assign

* Adding object-assign in polyfills.js. IE11 does not support Object.assign

* Fixing failing test

* Updating object.assign polyfill to fix aliasing

* Updating test case value to match new build stats

* Increasing the size of default build to 225kb

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

* Revert README.md

* Re-design the polyfill approach based on PR feedback

* Adding comment and fixing test case

* Rename polyfills chunk

* Extract aliases into helper

* Remove extra new line

* Fix TypeScript typings

* Adding _internal_fetch alias

* Adjust build manifest plugin

* Build manifest plugin changes - adding a separate entry for polyfills

* Rename polyfills entry in build-manifest.json

* Remove old comment

* Fix TS

* Set key

* Polyfills already added

* Filtring polyfill.module.js

* Fix test

* Add __internal_fetch to alias rule

* Adjust name

* bump size

* ignore polyfills

* sigh

* Aliasing Object.assign

* Mergin latest changes

* Integration test for polyfilling fetch

* Remove comment

* Fix prettier error

* Fix review comments

* Fix review comments

* Update fetch.js

* Fix tests
2019-11-14 22:47:08 -08:00
Joe Haddad
1544443fd5
Improve route param error message 2019-11-14 16:45:52 -08:00
Joe Haddad
1fa612d844
refactor(router): extract handle slug method (#9414)
This refactors the `handleSlug` method in preparation for catch-all routing.
This PR is opened separately so the catch-all diff can be reviewed easier.
2019-11-14 14:12:27 -08:00
Joe Haddad
5905397457
v9.1.4-canary.4 2019-11-12 21:57:11 -08:00
JJ Kasper
5d5af48425 Don't treat static as an internal route when the folder is not provided (#9394)
* Render 404 for isInternalUrl in render

* Fix internal handling for static dir
2019-11-12 20:07:19 -08:00
Joe Haddad
553052f903
Remove unused property skeleton (#9393) 2019-11-12 19:26:42 -08:00
Joe Haddad
6387d9b5bc
Fix Dynamic next export Page Hydration Mismatch (#9388)
* Fix `next export` Hydration Mismatch

* Lower timeout to 1 minute
2019-11-12 18:34:12 -08:00
JJ Kasper
154d78461c Replace historyId with initial page tracking (#9380)
* Replace historyId with initial page tracking

* Apply suggestions from code review

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

* Apply suggestions from code review
2019-11-12 13:37:47 -08:00
Janicklas Ralph
788654e2fc Decrease the load priority of client _buildManifest (#9167)
* Decreasing the load priority of _buildmanifest file

* Remove buildmanifest filter in preload as its not needed anymore

* Removing test for _buildManifest.module.js

* re-add code

* re-add testing

* Re-add filtering

* add missing comment

* Adjust ordering

* reduce diff
2019-11-10 23:35:17 -08:00
Joe Haddad
00badd4d58
Initialize Git repo on app creation (#9376)
* Initialize Git repo on app creation
This PR initializes a Git repository after Create Next App runs.

We ensure the app was not created in an already-existing Git or Mercurial repo.

Failures of setup (no Git installed) do not fail the application bootstrapping.

Closes #9077 (replaces)

* Add test

* Update index.test.js
2019-11-10 21:42:51 -08:00
Joe Haddad
7bb7d70650
Polyfill Object.assign by Default (#9369)
* Polyfill `Object.assign` by Default

* fix formatting
2019-11-10 20:48:11 -08:00
Lee Robinson
b3dbcbb5bb Fix typo in API routes documentation. (#9373) 2019-11-10 20:07:45 -08:00
Mathieu Triay
be86ab00e1 Update webpack config to also take next-stylus into account (#9277) 2019-11-10 19:56:29 -08:00
Joe Haddad
18a9c7e371
Improve linting rules to catch more errors (#9374)
* Update `packages/`

* Update examples

* Update tests

* Update bench

* Update top level files

* Fix build

* trigger
2019-11-10 19:24:53 -08:00
JJ Kasper
c6f1c0c064
v9.1.4-canary.3 2019-11-10 13:01:52 -08:00
Joe Haddad
8107533b21
Bind fetch to self instead of window (#9368) 2019-11-10 12:54:29 -08:00
Slobodan Mišković
8ee536df09 Fix canonical rel link generation (#9357) 2019-11-10 12:44:15 -08:00
Joe Haddad
a7feb46886
v9.1.4-canary.2 2019-11-09 22:44:50 -08:00
Joe Haddad
8dcec04bd1
Fix window.fetch Polyfill (#9364) 2019-11-09 21:25:32 -08:00
Joe Haddad
32d702d204
v9.1.4-canary.1 2019-11-09 20:03:37 -08:00
JJ Kasper
4e3b5ae20c
Update routes-manifest and add tests (#9361)
* Test custom-routes serverless

* Make sure we add default statusCode to routes-manifest

* Update routes-manifest

* Add DEFAULT_REDIRECT_STATUS constant
2019-11-09 20:00:54 -08:00
Joe Haddad
7c83a12332
v9.1.4-canary.0 2019-11-09 16:27:10 -08:00
Tim Neutkens
9b999b1ce3
Convert wrapper class to function component (#9095)
* Convert wrapper class to function component

* Remove unneeded export

* Check versions of chrome and chromedriver

* Update to chromedriver 76

* Revert config.yml

* Update with-router.tsx
2019-11-09 14:56:59 -08:00
JJ Kasper
d19e825daa Implement custom routes RFC (#9157)
* add initial custom-routes handling

* Add tests for custom-routes

* Handle chained redirects, separate dev custom
routes reading, and add version to routes manifest

* Handle no routes manifest

* Swap build custom routes calling

* Add flatten-routes

* Add flattening of custom routes

* Re-work implementation to follow routes top-down

* Add regex field to routes-manifest

* Fix path-to-regexp match breaking after upgrade

* Fix duplicate const from merge

* Add some changes from review

* Don't make path-match strict

* add default custom route values

* Update routes-manifest

* Update options for path-match

* Remove todo

* Add test for rewrite with params

* Only use strict mode for custom routes

* Update dynamic-routing test

* Move getCustomRoutes to prepare

* Remove extra change

* Update handling for error-in-error test

* Apply suggestions from code review

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

* Apply suggestions from review

* Update slice change

* Apply suggestions from code review

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

* Apply suggestions from review

* Fix TypeScript error

* Fix getCustomRoutes in dev mode

* Apply suggestions from code review

* Update slice

* Apply suggestions from code review

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

* Delete un-used test page

* Add test for param overwriting

* Apply suggestions from code review

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

* Add extra check to param test
2019-11-09 14:34:52 -08:00
JJ Kasper
820a9790ba Add a routes manifest with the dynamic routes (#9347)
* Add a routes manifest with the dynamic routes

* Update to use pageKeys for windows compat

* Update routes-manifest test
2019-11-08 16:51:19 -08:00
Giuseppe
b929debd76 Upgrade styled-jsx (#9348)
It should fix an escaping issue with source maps on Windows. Also the library size should be a bit smaller https://github.com/zeit/styled-jsx/pull/591
2019-11-08 12:27:20 -08:00
Tim Neutkens
0499316650 Add check for now.json and custom server (#9346)
* Check if the user has a now.json

* Check for now.json

* Add check for custom server
2019-11-08 09:03:50 -08:00
Joe Haddad
c5faf73c5a
v9.1.3 2019-11-07 20:01:56 -08:00
JJ Kasper
5bf6760fa5
v9.1.3-canary.5 2019-11-07 17:28:28 -08:00
JJ Kasper
ec89e7387f Add readme with experimental warning for plugins (#9345) 2019-11-07 17:17:26 -08:00
Joe Haddad
fd36e41912
v9.1.3-canary.4 2019-11-07 16:52:11 -08:00
Luis Alvarez D
c8c4efba6c Remove the parameterized-routing example (#9297)
* Remove the example

* Include readme with link to alternative
2019-11-07 10:06:35 -08:00
Joe Haddad
7fe42fb057
v9.1.3-canary.3 2019-11-07 09:42:18 -08:00
Tim Neutkens
210dca8d7a Ensure we correctly decide on which packages need better interopt (#9327) 2019-11-06 19:14:32 -08:00
JJ Kasper
354de28422 Only add static files route if folder exists (#9305)
* Only add static files route if folder exists

* Remove extra import
2019-11-05 06:55:35 +01:00
Alex Castle
b37fcbb50b Prevent CSS script tags in granular chunks (#9306)
* Don't add script tags for css files on client side navigation with granular chunks

* Filter for JS, instead of against CSS
2019-11-05 06:54:17 +01:00
Joe Haddad
9defdd0a18
v9.1.3-canary.2 2019-11-04 15:32:17 -05:00
Joe Haddad
dee2888404
Allow TypeScript Namespaces (#9308) 2019-11-04 15:26:31 -05:00
Joe Haddad
8e62c9b688
Enforce the framework Chunk (#9250) 2019-11-04 11:25:14 -05:00
Joe Haddad
bbf705f262
Simplify Build Output (#9281)
* Simplify Build Output

* Remove noop tests

* Drop 

* Remove bolding
2019-11-04 11:14:04 -05:00
Tim Neutkens
21f0db8181 Call getInitialProps on Component when it’s not defined on App (#9287)
Fixes #9284
2019-11-02 11:00:55 -04:00
JJ Kasper
739322d06b Handle backslashes for plugins (#9282) 2019-11-01 23:06:34 -04:00
Janicklas Ralph
ff2d3fd87d Polyfill window.fetch by Default (#9168)
* Polyfilling fetch and object-assign

* Polyfilling corejs object-assign

* Adding object-assign in polyfills.js. IE11 does not support Object.assign

* Fixing failing test

* Updating object.assign polyfill to fix aliasing

* Updating test case value to match new build stats

* Increasing the size of default build to 225kb

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

* Revert README.md

* Re-design the polyfill approach based on PR feedback

* Adding comment and fixing test case

* Rename polyfills chunk

* Extract aliases into helper

* Remove extra new line

* Fix TypeScript typings

* Adding _internal_fetch alias

* Adjust build manifest plugin

* Build manifest plugin changes - adding a separate entry for polyfills

* Rename polyfills entry in build-manifest.json

* Remove old comment

* Fix TS

* Set key

* Polyfills already added

* Filtring polyfill.module.js

* Fix test

* Add __internal_fetch to alias rule

* Adjust name

* bump size

* ignore polyfills

* sigh
2019-11-01 21:00:56 -04:00
bennett4
99755b6742 fixed spelling of cookies (#9283) 2019-11-01 20:45:16 -04:00
Joe Haddad
aef927d576
Disallow iSSG revalidation period of zero (#9280)
* Disallow iSSG revalidation period of zero

* Fix revalidation period in test
2019-11-01 15:38:02 -04:00
Tim Neutkens
7c80febcf7 Initial plugins implementation (#9139)
* Add initial bit for plugins

* Add checks for needed metadata values

* Add test

* Initial plugins changes

* Add handling for _app middleware

* Add loading of _document middleware and
handling of multiple default export syntaxes

* Fix insert order for middleware member expression

* Remove early return from middleware plugin from testing

* Add tests for current plugin middlewares

* Update test plugin package.json

* Update handling for class default export

* Update to use webpack loader instead of babel
plugin, remove redundant middleware naming, and add field for required env for plugins

* Add middleware to support material-ui use case
and example material-ui plugin

* Update tests and remove tests stuff from google analytics plugin

* Remove old plugin suite

* Add init-server middleware

* Exit hard without stack trace when error in collecting plugins

* Add on-error-client and on-error-server and update
to run init-server with next-start in serverless mode

* Update init-client for google analytics plugin

* Add example Sentry plugin and update with-sentry-simple

* Remove middleware field/folder and use src dir for plugins

* Add post-hydration middleware and update
material-ui plugin

* Put plugins code behind flag

* Update chromedriver

* Revert "Update chromedriver"

This reverts commit 1461e978e677f7da05e29e0415ec614a04bf65f9.

* Update lock file

* Remove un-needed _app for sentry example

* Add auto loading of scoped packages, add plugins
config for manually listing plugins, and update
to only collect plugins once

* Update example plugins

* Expose plugins' config

* Rename plugin lifecycles and add babel-preset-build

* Rename other methods with unstable

* Update log when plugin config overrides auto-detecting
2019-11-01 14:13:13 -05:00
Joe Haddad
683903785a
Require Node 8.10 (#9278) 2019-11-01 13:43:29 -04:00
Joe Haddad
1a436535ce
v9.1.3-canary.1 2019-10-31 16:28:00 -04:00
JJ Kasper
b320f5bd59 Add handling for exportTrailingSlash for iSSG pages (#9258)
* Add handling for exportTrailingSlash for iSSG pages

* Update index.test.js
2019-10-31 16:26:47 -04:00
JJ Kasper
aafbd53cbf Remove dead code elimination for when iSSG isn't used (#9267)
* Don't rely on page-config plugin to detect iSSG usage

* Make sure to only update sprStatus if page file

* Remove dead-code elimination for iSSG code

* Revert next-page-config.ts

* Update index.js

* Update index.test.js
2019-10-31 16:07:35 -04:00