Commit graph

1513 commits

Author SHA1 Message Date
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
Tim Neutkens
37ee8fc9e7 Update _app documentation to reflect no longer needing next/app (#9268)
* Update _app documentation to reflect no longer needing next/app

* Remove lint-staged
2019-10-31 10:53:55 -04:00
Petra Jaros
1e9407459d Fix import next from "next" (#9216) 2019-10-31 13:20:05 +01:00
JJ Kasper
fa5fb97ce8 Make sure to pipe output from staticCheckWorkers (#9256) 2019-10-31 12:38:09 +01:00
Jason Miller
c966900768 Bugfix/Performance: Start the modern child compiler earlier (#9257)
* Start the modern Child Compiler earlier during builds

* fix child compiler errors not bubbling
2019-10-31 12:37:07 +01:00
Joe Haddad
c2a2417e0c
v9.1.3-canary.0 2019-10-30 13:50:18 -04:00
JJ Kasper
f16f868ea1
Make sure to handle paths with dot in name for SPR (#9227) 2019-10-30 11:29:23 -05:00
Ilya
8dd394a055 Load granular chunks with correct asset prefix (#8993)
* closes #8989

fix

closes #8989

* test

* Update next.config.js

* Revert page1.js

* Revert page2.js

* Delete page4.js

* Delete page3.js

* Update index.test.js

* Revert index.test.js

* Revert next.config.js
2019-10-30 10:25:11 -04:00
Gerald Monaco
f632567bcf Add experimental config for React Mode (#9207)
* Add experimental config for React Mode

* Use latest types

* Use latest types
2019-10-30 09:39:58 -04:00
sagar talla
6707909690 Error when user tries to use uncompiled next.config.ts (#9223)
* Throw Error for next.config.ts

Ref: https://github.com/zeit/next-plugins/issues/555

* Check for .js else .ts

* Update Error Message

Co-Authored-By: Alexander Kachkaev <alexander@kachkaev.ru>

* Add test case when both next.config.js and next.config.ts exist.

* Remove extra constant CONFIG_FILE_TS and Add check for ts/tsx/json

* Rename test config parameter and add tsx and json files

* Change messege

* change value

* Update next.config.json

* Update next.config.json

* Change message  and add jsx filter

* Adjust

* Simplify test

* adjust
2019-10-30 08:18:33 -04:00
Joe Haddad
6b54e9ed66 Fix Prettier Commit Hook (#9245)
* Apply format to webpack config

* hit all files
2019-10-30 12:35:51 +01:00
Jan Karres
3b3d20f729 Check if 'formatAmpMessages' returns a none empty string in Next.js build process (#8924) 2019-10-29 23:49:40 -04:00
Jason Miller
5f203b8342 Improve serverless build performance (#9155)
* Improve serverless build performance

Next's serverless build uses a custom resolver, injected the via Webpack's `externals` option that delegates out to `resolve-request` to more aggressively pull node modules into the serverless bundles.

When profiling a large Next.js application, I noticed an excessive number of filesystem calls near the end of the build. I narrowed this down to the serverless compiler pass, and eventually the custom resolver function that is the subject of this PR.  As it turns out, around half of the calls to the `externals` custom resolver function are for a `request` path that is a relative import. Next doesn't have any specific logic to apply to relative imports - it only needs to special-case bare module resolution.

Adding a simple bypass for relative module resolution reduces the number of blocking filesystem-bound `resolveRequest()` calls by 50% on a certain well-known Next.js website. This also results in a 30% reduction in production build times for incremental builds.

* Explain more in the comment
2019-10-29 23:36:22 -04:00
Christoph Tavan
17d7544f45 Remove concurrency option from next export (#9197)
Usage of this option was removed in
61b8b7323e but the cli was not updated.
2019-10-29 23:07:42 -04:00
JJ Kasper
c4bef164ce Add unique identifier to router instance (#9015)
* Update to use a historyId to track invalid popstates

* Remove log from debugging

* Use Math.random instead of Date.getTime to avoid mocks
2019-10-29 22:50:16 -04:00
Janicklas Ralph
d3293f7cd6 Dynamic granular chunking (#9090)
* Enable granular chunks config for all chunk types

Adding comment

Bug fix

* Update index.test.js

* Update index.test.js

* Fix test cases. Adding next/link to not trigger a different bug

* Removing obsolete comment
2019-10-29 21:27:41 -04:00
Joe Haddad
acf7d0ad3b
v9.1.2 2019-10-29 16:56:45 -04:00
Joe Haddad
cb7a184cd9
v9.1.2-canary.10 2019-10-29 11:14:39 -04:00
Joe Haddad
4dbd267c6a
Split TypeScript Flag Docs (#9231)
* Split TypeScript Flag Docs

* reword
2019-10-28 22:44:10 -04:00
Christoph Tavan
14ed867537 Disable worker_threads by default for firebase compatibility (#9199)
* Pass config.experimental.cpus to export during build

Currently, there is no way of specifying the number of worker threads of
`next export` when run as part of `next build`.

I suggest a sane default should be to just use the same amount of
workers that were used during the build process which currently seems to
be configured through `config.experimental.cpus`.

This setting is already respected in the two other places where
jest-workers are in use: The TerserPlugin and the staticCheckWorkers in
`next build`.

* Only enable worker threads if there is more than 1 worker

Multiple worker threads can cause problems when certain dependencies are
being used, see e.g. https://github.com/zeit/next.js/issues/7894

This patch allows disabling of worker threads by setting
`config.experimental.cpus = 1`.

The benefit of spawning 1 worker thread, if there is any at all, should
very limited anyways, so the workload can just as well be processed in
the main thread.

* Disable parallel build for firebase authentication example

* Add integration test to cover #7894

* Rename test suite and add worker_threads config

* Disable worker_threads by default

* Update index.test.js

* Use workerThreads config for TerserPlugin

* Update to use workerThreads config in
TerserPlugin for consistency

* Disable node 12 specific test
2019-10-28 20:01:24 -04:00
Alexander Kachkaev
ad2a3d65fd Add configuration flags to disable integrated type checker (#9138)
* Add a configuration flag to disable integrated type checker

* Add tests for typescript-transpileonly

* Restore removed argument

* Make output more coherent

* Split transpileOnly into ignoreDevErrors and ignoreBuildErrors

* Minor stylistic change
2019-10-28 11:02:03 -07:00
JJ Kasper
2d9f199105 Add warning for getStaticParams without getStaticProps (#9226)
* Add warning for getStaticParams without getStaticProps

* Throw error instead of logging to make sure it's noticed

* Lower default concurrency for tests
2019-10-28 10:24:29 -07:00
Joe Haddad
34e0ce6f05
Remove react-ssr-prepass from Next Deps (#9224) 2019-10-28 06:49:07 -07:00
Jan Potoms
ab0a8647dc API: Take multiple values into account for the query (#9196)
* Take multiple values into account

* make typescript happy
2019-10-26 20:10:06 +02:00
Tim Neutkens
20978af0b0 v9.1.2-canary.9 2019-10-26 19:44:44 +02:00
htbvo
211c84e1c9 allow NextScript to optionally defer javascript (#8980)
* allow NextScript to optionally defer javascript

* move defer options to experimental feature

* combine defer flags into a single option

* Update deferScripts to work with serverless target

* Add test for defer and async property

* Read the async property

* Check versions of chrome and chromedriver

* Update to chromedriver 76

* Fix test
2019-10-26 19:27:22 +02:00
Tim Neutkens
2fcff3de49
Update Babel dependencies (#9203)
* Update Babel dependencies

* Update sizes
2019-10-26 15:59:15 +02:00
Christoph Tavan
e506c41e8c Ensure that all <link> elements have a key prop (#9204)
Before this patch users would see the following warning during initial
compilation:

```
Warning: Each child in a list should have a unique "key" prop. See https://fb.me/react-warning-keys for more information.
    in link
    in Head
    in html
    in Html
    in Document
    in Context.Provider
    in Context.Provider
```
2019-10-26 14:46:17 +02:00
Gerald Monaco
4421448f03 Add StrictMode toggle (#9161)
* Add StrictMode toggle

* Rename option to reactStrictMode

* Default to false initially
2019-10-26 00:20:38 +02:00
JJ Kasper
be42300e1f Ensure directory before flushing cache file (#9187)
* Ensure directory before flushing cache iSSG file

* Add test for prerender cache flush

* Nest the dynamic route test one more level

* update fetch for test

* Update error check
2019-10-25 13:56:00 -07:00
Miguel Ángel Durán
8227baf42c docs(api-routes): fix micro-cors example (#9184)
The correct option to use with `micro-cors` package is `allowMethods` instead `allowedMethods`. This PR fixes the example.
2019-10-23 17:14:51 -04:00
Joe Haddad
60ff5cc77e
v9.1.2-canary.8 2019-10-23 15:53:37 -04:00
JJ Kasper
d38da874cf Record src directory usage with version (#9023)
* Add tracking src dir usage to telemetry

* Move isSrcDir back to eventVersion

* Move spinner back

* Add test for isSrcDir telemetry

* Add test for dev mode
2019-10-22 22:42:16 -04:00
Joe Haddad
4328eea3a7
Add WSL to Metadata (#9171) 2019-10-22 21:13:18 -04:00
JJ Kasper
573fbff88a Add yarn check to tests (#9163)
* Add yarn check to tests

* Update yarn.lock

* Update lockfile some more

* Use resolutions to bump browserslist
2019-10-22 21:02:59 -04:00
Joe Haddad
b5d8767f44
Cache No-Revalidate Pages (#9170)
* Cache No-Revalidate Pages

* Specifically check for `false`
2019-10-22 20:40:33 -04:00
Joe Haddad
ae3410c3f3
Upgrade Lockfile (#9158)
* Upgrade Lockfile

* Fix types version mismatch

* Upgrade amphtml-validator

* Revert "Upgrade amphtml-validator"

This reverts commit 05068b2ad9f2f53429cf514b47b4f7924b0b9623.

* Disable AMP Tests

* Skip 2x more AMP tests
2019-10-22 11:42:43 -04:00
Joe Haddad
94c2c084ad
Upgrade React dependencies (#9152)
* Upgrade React dependencies

* Disable data tests

* Increase allowed default sizes
2019-10-21 14:27:21 -04:00
Joe Haddad
3a7603c44f
Update Prerender Error Message (#9143) 2019-10-20 18:11:29 -04:00
JJ Kasper
cd52fc9e91
v9.1.2-canary.7 2019-10-18 16:28:09 -05:00
Alex Castle
a82b5aed9b Update granular chunks to produce up to 25 chunks per entrypoint on high-complexity apps (#9129) 2019-10-18 13:36:03 -04:00
Joe Haddad
4d3cca3382
Warn on No Cache in CI (#9116)
* Warn on No Cache in CI

* Bold the note lead

* Add custom clarification for netlify

* Reorder

* Add tests

* Fix detection
2019-10-18 12:40:47 -04:00
Gerald Monaco
d28e46ac15 Support Concurrent Mode in Loadable (#9026) 2019-10-18 17:23:06 +02:00
Liran Cohen
b7efb3fffb Allow manually setting amphtml (#9098)
* allow to remove amphtml from desktop page

* only 1 link with amphtml rel

* clean up

* remove checkup for amphtml link

* Dedupe looping
2019-10-18 10:22:53 -05:00
JJ Kasper
499808fa2b
Make sure to update scope for page export declaration (#9115)
* Register page export declaration to scope

* Update to not need to traverse to update scope
2019-10-18 09:37:09 -05:00
Melanie Seltzer
c650ed9a2a Dedupe meta tags (#8960)
* Dedupe meta tag in favor of custom tag defined in _app

* Add test

* Fix comments
2019-10-18 01:40:54 -04:00
Joe Haddad
c5caa89209
v9.1.2-canary.6 2019-10-17 11:56:33 -04:00
JJ Kasper
31b2f51a03 Don't mark page as nextExport if it's SPR (#9113)
* Don't mark page as nextExport if it's SPR

* Add test for fetching prerender data after mount
2019-10-17 11:52:13 -04:00
Joe Haddad
4374e7c5d2
v9.1.2-canary.5 2019-10-16 17:38:17 -04:00
JJ Kasper
a3eb73240c Update to return JSON if data request (#9106)
* Update to return json if data request

* Update sending data

* Add test using serverless bundle directly

* Don't early return if fromExport
2019-10-16 17:24:28 -04:00
Joe Haddad
117d02359f
v9.1.2-canary.4 2019-10-16 14:56:32 -04:00
Joe Haddad
393af8e6b3
Fix SPR header name (#9104) 2019-10-16 14:54:07 -04:00
Gerald Monaco
beed775e55 Update legacy _app context (#9083) 2019-10-16 11:39:49 +02:00
Alex Castle
0886a1234d Optimize script tags (#9048)
* Update _document.tsx to optimize script loading

* Update maxInitialChunks to 15

* Undo change chunk count

* Adjust impl a bit

* Add CSS preload test

* Ensure build manifest not preloaded

* Correct file name

* break comment
2019-10-16 00:01:10 -04:00
JJ Kasper
d3cbb163be Fix SPR always revalidating in production (#9091)
* Add failing tests for SPR

* Fix SPR always revalidating in production

* Remove extra changes
2019-10-15 22:00:50 -04:00
Joe Haddad
07502ba2dd
v9.1.2-canary.3 2019-10-15 16:38:30 -04:00
Joe Haddad
0208356f67
Temporary: SPR: Use Group Index Mapping (#9089)
This pull request is a temporary addition that uses the `x-now-route-params` header in serverless.

This header returns the regex groups with indexes, not their named variants.
As a result, we must use the getRouteMatcher utility to reverse this into Next.js' expected names.

Since this got complex, I've added a test for it. We should probably remove this behavior sooner than later.
2019-10-15 16:30:10 -04:00
Joe Haddad
c77338bd31
Temporary: Add Support for Now Platform Headers (#9085) 2019-10-15 14:44:50 -04:00
Alex Castle
3263af513e Update framework chunk test regex to not select nested dependencies (#9012)
* Update framework chunk test regex to not select nested dependencies

* Update webpack-config.ts
2019-10-14 14:02:11 -04:00
Gerald Monaco
b2adfde983 Remove _document context (#9068) 2019-10-14 12:45:56 -04:00
Nishant Singh
09681cd597 [Docs] Update static file serving section (#9062)
This block seemed redundant 

```
To serve static files from the root directory you can add a folder called `public` and reference those files from the root, e.g: `/robots.txt`.
```

The block above this already mentions the same thing:
```
Create a folder called `public` in your project root directory. From your code you can then reference those files starting from the baseURL `/`
```

We could add the `robots.txt` eg to the first block itself if necessary
2019-10-13 19:18:10 +02:00
Joe Haddad
6efa1daf34
v9.1.2-canary.2 2019-10-11 17:25:32 -04:00
Joe Haddad
58cc1d3be4
Remove static optimization from message (#9045)
* Remove static optimization from message
This check does not pertain to automatic static optimization.

Closes https://github.com/zeit/next.js/issues/9042

* Update help message
2019-10-11 10:39:38 -04:00
JJ Kasper
c941b6129c Trigger error overlay for dynamic route mismatch (#9031) 2019-10-11 11:49:18 +02:00
JJ Kasper
5b574fc778
Update to error on usage of serverRuntimeConfig with serverless (#9030)
* Update to error on usage of serverRuntimeConfig with serverless

* Add tests for errors for serverless and runtime configs

* Update docs wording
2019-10-10 16:56:38 -05:00
Joe Haddad
de670b3834
Do Not Rely on Module State (#8968)
* Do Not Rely on Module State

* Update storage.ts
2019-10-10 13:18:07 -04:00
JJ Kasper
ac42beae86 Add buildId to SPR data routes (#8929)
* Add buildId to SPR data routes

* Update buildId replace in serverless loader

* Use new RegExp and add comment

* Apply suggestions from code review

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

* Test to ensure client transition and handle / data route
2019-10-10 13:07:50 -04:00
JJ Kasper
7f92c26498
Fix global Bluebird causing HMR connection to fail (#9009) 2019-10-09 10:50:32 -05:00
JJ Kasper
e5202ffb24
Add CSS fixture for src dir (#9001)
* Add CSS fixture for src dir

* Revert relative customAppFile dir and update tests
2019-10-09 10:41:49 -05:00
Yamagishi Kazutoshi
32633c83dd Add src directory support for global CSS (#8999) 2019-10-08 18:48:09 -05:00
Joe Haddad
3c97879277
v9.1.2-canary.1 2019-10-08 17:26:18 -04:00
Joe Haddad
afaff59f96
Monkeypatch @zeit/next-css@0.2.1-canary.4 (#8996) 2019-10-08 14:28:15 -04:00
JJ Kasper
5bce442d0a
v9.1.2-canary.0 2019-10-08 11:42:02 -05:00
JJ Kasper
5cd0b0c40f
Update resetting log for spinners (#8995) 2019-10-08 11:33:51 -05:00
Sebastian Benz
5f1bcd32d6 Update AMP Optimizer to 1.1.1 (#8994)
* This fixes #8932
* Positive side effect: the csp tag for inline amp-script will
automatically be added.
2019-10-08 18:04:40 +02:00
Joe Haddad
46168def31
v9.1.1 2019-10-08 00:24:59 -04:00
Joe Haddad
0002ea31bf
v9.1.1-canary.0 2019-10-07 23:14:49 -04:00
Joe Haddad
f81c5d5454
Match public/static/ folder before static/ (#8986)
* Test `public/static/` folder

* Public routes should be matched before static catch-all
2019-10-07 23:12:41 -04:00
Ismael Martínez
7674bab7b1 Change /static directory in favor of /public directory for create-next-app (#8984) 2019-10-07 18:38:42 -04:00
Tim Neutkens
b862d85156 v9.1.0 2019-10-07 20:44:10 +02:00
Joe Haddad
7bf4cdbefa
v9.0.9-canary.2 2019-10-07 13:23:04 -04:00
Joe Haddad
023863d975
Revert "Remove config export (#8895)" (#8982)
This reverts commit 67f7cf5627.
2019-10-07 13:22:47 -04:00
Joe Haddad
004319fa10
v9.0.9-canary.1 2019-10-07 10:24:57 -04:00
Mike Fisher
80767cd0ec Remove default export from constants.d.ts (#8979) 2019-10-07 14:30:07 +02:00
Tim Neutkens
7f1aaa3323 v9.0.9-canary.0 2019-10-06 14:54:34 +02:00
JJ Kasper
28377a783b Add static directory deprecation warning (#8636)
* Add static directory warning

* Simplify migration to public directory

* Update static-dir-deprecated.md
2019-10-06 13:57:41 +02:00
JJ Kasper
e2d713f93e De-experimentalize the public/ folder (#8661)
* Remove experimental.publicDirectory config

* Error when public is set as an output dir

* Remove experimental.publicDirectory checks

* Update publicFiles checking in next build
2019-10-06 13:44:03 +02:00
Joe Haddad
1a02dfd842
v9.0.8 2019-10-05 20:23:01 -04:00
Joe Haddad
a918d4ecb2
v9.0.8-canary.5 2019-10-04 22:53:39 -04:00
Joe Haddad
e2ca0ac0e8
Fix Legacy CSS Modules on the Server (#8970)
CSS Modules run their loader on the server, so we need to patch both variants of the webpack configuration.
2019-10-04 22:53:14 -04:00
Joe Haddad
e9b2e25c44
Convert Dev Server to TypeScript (#8966)
* Convert Dev Server to TypeScript
This converts the Next.js Development Server to TypeScript in prep for upcoming changes.

* Convert remaining necessary

* Fix some type errors

* Adjust types
2019-10-04 12:11:39 -04:00
Joe Haddad
c9d9ff6a8b
Informative Error for Invalid Global CSS (#8958)
* Informative Error for Invalid Global CSS
This adds a helpful error message with a (basic) err.sh link for invalid Global CSS usage.

We'll want to expand on this topic more and offer alternatives when CSS Modules support lands.

* Update expected error message
2019-10-04 11:55:18 -04:00
Joe Haddad
d299811bfa
Convert Export to TypeScript (#8965)
This pull request converts Next.js' export CLI command to use TypeScript. This is useful for upcoming changes.
2019-10-04 11:26:44 -04:00
Joe Haddad
9af587930f
v9.0.8-canary.4 2019-10-03 20:36:43 -04:00
Joe Haddad
3f51f0ed80
Add support for CSS Module patching (#8957) 2019-10-03 20:01:40 -04:00
Joe Haddad
3762e75704
Inline relayPaintMetrics function (#8954)
This function was only used once. I missed it in review, but this should save us a few bytes.
2019-10-03 17:34:54 -04:00
Prateek Bhatnagar
5929e9da20 Add unstable_onPerformanceData helper for performance entries (#8480)
* Performance relayer for client side performance

* adding paint metrics

* fixing titles

* fixing route change measure

* accessing exports without loop

* adding more tests

* renaming the method

* adds experimental prefix to method name

* applying the suggested patch

* Update index.js
2019-10-03 15:15:23 -04:00
Jigo Palillo
923547c056 Removes importance link attribute (#8951) 2019-10-03 15:05:07 -04:00
Joe Haddad
8945cbcee0
v9.0.8-canary.3 2019-10-03 13:13:20 -04:00
Joe Haddad
89cf68dd1c
Also patch standalone usage of @zeit/next-css (#8950) 2019-10-03 13:10:42 -04:00
Joe Haddad
50bd10f5f8
Use Better Telemetry Directory (#8942)
* Use Better Telemetry Directory
So, as it turns out, storing in `node_modules` is a bad idea.

Both npm and Yarn will remove additional files when you run `npm install` or `yarn install`.

Instead, we'll store this inside of Next.js' `distDir`. This should also be cached by users, if it's not, it probably won't be any worse as compared to `node_modules`.

* Fix directory name

* Fix build setup

* Record when export session is started

* Move more into branch
2019-10-03 10:21:15 -04:00
Joe Haddad
955ea42288
Monkey patch next-sass and next-less (#8944)
* Monkey patch `next-sass` and `next-less`
These two Next.js plugins use poor webpack practices: they define plugins without resolving themselves.

As a result, the resolution root is unknown by webpack and you get into package hoisting bugs.

To fix this, we emulate the logic these packages should've performed themselves on a best-effort basis.

* Add comments explaining the monkey patch

* Fix comment

* Update packages/next/build/webpack-config.ts

Co-Authored-By: Tim Neutkens <tim@timneutkens.nl>
2019-10-03 10:08:49 -04:00
Joe Haddad
3d5af360a4
v9.0.8-canary.2 2019-10-02 19:28:51 -04:00
Joe Haddad
40b0b9b958
Reduce Timeframe That FOUC Styles Are Active (#8937)
* Show content as soon as <style> tags are added

* Add fallback removal

* Add test for when unused

* Ensure the function is ES5 compatible

* IE support

* Test it works on broken pages
2019-10-02 19:08:19 -04:00
Joe Haddad
67f7cf5627
Remove config export (#8895)
* Remove `config` export
This removes the `config` export instead of all exports.

Reverts #8889 (but with fixed behavior)

* Add test to ensure config object is dropped from client-bundle
2019-10-02 18:49:56 -04:00
Joe Haddad
9a4234cf54
Remove Recipes from Readme (#8939)
These Recipies are not regularly audited to ensure they're using the most up-to-date and suggested practices.

We'll reintroduce the idea of "recipies" in the future, for now, the examples directory is a great place to start.
2019-10-02 18:17:21 -04:00
Joe Haddad
29c1b93c89
s/Automatic Prerendering/Automatic Static Optimization/ (#8940)
* s/Automatic Prerendering/Automatic Static Optimization/

* Update more links
2019-10-02 18:03:00 -04:00
Joe Haddad
80d574ec05
Do not mix null in getCssLinks return value (#8938) 2019-10-02 17:47:34 -04:00
Joe Haddad
8391d48fc7
Change default body display setting (#8941) 2019-10-02 16:48:42 -04:00
Joe Haddad
b3cc32e9f4
v9.0.8-canary.1 2019-10-02 10:13:09 -04:00
Joe Haddad
294f835592
Add srcRoute attribute to SPRv2 Manifest (#8928)
* Add new `srcRoute` attribute to SprRoute

* Update prerender manfiest test snapshot

* Fix types
2019-10-02 09:28:38 -04:00
JJ Kasper
026d52fb4d Update to not copy static and public folders during auto export (#8923) 2019-10-02 09:19:23 -04:00
Joe Haddad
1ff5005524
v9.0.8-canary.0 2019-10-01 14:27:31 -04:00
Joe Haddad
afa73ae46b
Update Prerender Manifest (#8918)
* Update Prerender Manifest

* Fix typescript
2019-09-30 22:08:01 -04:00
Tim Neutkens
0bcd1fc39b
Mirror actual /_error behavior in documentation 2019-09-30 11:19:03 +02:00
JJ Kasper
d483fa4969 Don't run findPagesDir in production mode (#8896) 2019-09-30 11:08:15 +02:00
Tim Neutkens
4e1f1131bc v9.0.7 2019-09-28 14:45:57 +02:00
Tim Neutkens
f68556473a v9.0.7-canary.10 2019-09-28 14:16:03 +02:00
JJ Kasper
6312a49e77 Don't remove path in page-config plugin (#8889) 2019-09-28 14:14:43 +02:00
Tim Neutkens
1c58c5f461 v9.0.7-canary.9 2019-09-28 12:45:56 +02:00
Joe Haddad
d9c6f20023 Remove React Suspense from Client Runtime (#8887) 2019-09-28 12:44:07 +02:00
Joe Haddad
e930961f42
v9.0.7-canary.8 2019-09-28 00:28:30 -04:00
Joe Haddad
296cfacd12
Add SPR Dynamic Routes to Manifest (#8885)
* Add SPR Dynamic Routes to Manifest
This adds dynamic routes for SPR pages to the prerender manifest so we can configure the Now Builder to handle these routes as SPR routes. Otherwise, they're treated like normal `getInitialProps` pages.

* Fix types
2019-09-27 16:34:37 -04:00
Joe Haddad
c566b322a8
v9.0.7-canary.7 2019-09-27 14:49:01 -04:00