Commit graph

1490 commits

Author SHA1 Message Date
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
Joe Haddad
2aa1203171
Configure the Default Revalidate (#8880)
* Configure the Default Revalidate
The default revalidate behavior should be configured by Next.js. Otherwise, the behavior might drift or change in non-semver compliant ways between Next.js and the builder (or other 3rd party setups).

* Add additional comment
2019-09-27 13:36:00 -04:00
Joe Haddad
01e5471816
Enforce natural numbers for SPR (#8882)
Per the HTTP specification, only natural numbers may be used for caching durations. We should enforce this with a really helpful error message.
2019-09-27 12:46:19 -04:00
Joe Haddad
e8522f4032
Favicon should have low importance (#8878)
* Favicon should have low importance

* Update index.js
2019-09-27 11:05:31 -04:00
Joe Haddad
e3d15f98dc
Remove stale-if-error header from SPR (#8866)
The Now CDN does not support the `stale-if-error` header and already behaves like that for `stale-while-revalidate`.

Removing this header allows Now CDN to use its default headers instead of sending _only_ `stale-if-error` after stripping `s-maxage` and `stale-while-revalidate`.
2019-09-26 13:46:24 -04:00
Joe Haddad
37a50cd387
Add support for ZEIT Now CI detection (#8864)
* Add support for ZEIT Now CI detection

* Add isNowDev to meta fields
2019-09-26 10:59:24 -04:00
Joe Haddad
ebf1fe3da5
v9.0.7-canary.6 2019-09-25 11:39:43 -04:00
JJ Kasper
2ae475e07c SPR follow ups (#8846)
* Add revalidate header and error when invalid
object from getStaticProps

* Make sprCache no-op in dev mode

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

* Update tests for fixes

* Update getStaticProps error and add test

* Update manifest test

* Add validating revalidate value

* Apply suggestions from code review

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

* Change from error to warning high revalidate value
2019-09-25 11:29:21 -04:00
JJ Kasper
fd50e51e2a
Remove extra build logs (#8839) 2019-09-24 11:37:03 -05:00
JJ Kasper
a8e3b02236 Add src directory support (#8735)
* Add find-pages-dir

* Add support for src directory

* Add test for pages dir preference

* Update comment
2019-09-24 17:15:14 +02:00
Tim Neutkens
fb9d777f6c v9.0.7-canary.5 2019-09-24 15:41:12 +02:00
Maël Nison
62fce6f572 TS / PnP compatibility (#8744)
* Fixes PnP + TS support

* Uses import on the resolved TS path (since it's not a dep)

* Fixes TS
2019-09-24 14:54:52 +02:00
Janicklas Ralph
ebb39f1004 Allow only JS files when loading dynamic chunks (#8831) 2019-09-24 11:26:51 +02:00
JJ Kasper
85e720a092 Add experimental SPR support (#8832)
* initial commit for SPRv2

* Add initial SPR cache handling

* update SPR handling

* Implement SPR handling in render

* Update tests, handle caching with serverless next
start, add TODOs, and update manifest generating

* Handle no prerender-manifest from not being used

* Fix url.parse error

* Apply suggestions from code review

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

* Replace set with constants in next-page-config

* simplify sprStatus.used

* Add error if getStaticProps is used with getInitialProps

* Remove stale TODO

* Update revalidate values in SPR cache for non-seeded routes

* Apply suggestions from code review

* Remove concurrency type

* Rename variable for clarity

* Add copying prerender files during export

* Add comment for clarity

* Fix exporting

* Update comment

* Add additional note

* Rename variable

* Update to not re-export SPR pages from build

* Hard navigate when fetching data fails

* Remove default extension

* Add brackets

* Add checking output files to prerender tests

* Adjust export move logic

* Clarify behavior of export aggregation

* Update variable names for clarity

* Update tests

* Add comment

* s/an oxymoron/contradictory/

* rename

* Extract error case

* Add tests for exporting SPR pages and update
/_next/data endpoint to end with .json

* Relocate variable

* Adjust route building

* Rename to unstable

* Rename unstable_getStaticParams

* Fix linting

* Only add this when a data request

* Update prerender data tests

* s/isServerless/isLikeServerless/

* Don't rely on query for `next start` in serverless mode

* Rename var

* Update renderedDuringBuild check

* Add test for dynamic param with bracket

* Fix serverless next start handling

* remove todo

* Adjust comment

* Update calculateRevalidate

* Remove cache logic from render.tsx

* Remove extra imports

* Move SPR cache logic to next-server

* Remove old isDynamic prop

* Add calling App getInitialProps for SPR pages

* Update revalidate logic

* Add isStale to SprCacheValue

* Update headers for SPR

* add awaiting pendingRevalidation

* Dont return null for revalidation render

* Adjust logic

* Be sure to remove coalesced render

* Fix data for serverless

* Create a method coalescing utility

* Remove TODO

* Extract send payload helper

* Wrap in-line

* Move around some code

* Add tests for de-duping and revalidating

* Update prerender manifest test
2019-09-24 10:50:04 +02:00
David Darnes
82f7bb4b67 Ghost URL Typo (#8828) 2019-09-23 12:15:27 +02:00
JJ Kasper
d0b982b020
v9.0.7-canary.4 2019-09-20 15:50:53 -05:00
JJ Kasper
5f4e606e84 Fix using withRouter in _app opting out of auto-export (#8811) 2019-09-20 16:49:49 -04:00
David Darnes
b4946ae23c Add Working with Ghost and Next.js to Recipes (#8800) 2019-09-19 17:32:43 -04:00
Joe Haddad
8d765b0209
Enable Experimental CSS Source Maps (#8805)
Source maps should be enabled in development so that original styles can be inspected.
This is in-line with other Next.js behavior (source maps in dev).
2019-09-19 14:38:12 -04:00
Janicklas Ralph
deeaa9230f Update page sizes displayed on build (#8777)
* Fixing page sizes displayed during build

* Adding comments

* Update variable name

* Fixed support for modern mode

* Remove braces

* Memoize fs.stat result

* Memoize fs.stat result
2019-09-19 11:16:51 -05:00
Joe Haddad
b3d1b776df
v9.0.7-canary.3 2019-09-19 11:38:18 -04:00
Joe Haddad
db7d7c7dfa
Add Experimental CSS Before Anchor (#8803)
This simplifies the CSS insert function and fixes its edge cases around nextSibling by inserting before the anchor instead of after it.
2019-09-19 11:37:47 -04:00
Luc
9b0c641b25 Insert <style> tags after anchor element (#8795)
* insert css *after* noscript tag in dev mode

* use arrow function
2019-09-19 10:53:32 -04:00
Luis Alvarez D
0eda4d5988 Update broken links (#8793) 2019-09-19 10:50:50 -04:00
Joe Haddad
4466e8ccb5
v9.0.7-canary.2 2019-09-18 20:24:00 -04:00
Joe Haddad
ed84bee503
Fix Experimental CSS Ordering (#8790)
* Fix CSS Ordering
This fixes CSS ordering between development and production.

Before this change, globally imported CSS would come _after_ `<style jsx global>` in development, but _before_ in production.

After this change, it'll always be applied before.

* Move to correct element

* Add tests

* Fix obnoxious indents

* Update test/integration/css/fixtures/with-styled-jsx/pages/index.js

Co-Authored-By: JJ Kasper <jj@jjsweb.site>
2019-09-18 20:18:41 -04:00
Joe Haddad
1aec686c80
v9.0.7-canary.1 2019-09-18 16:29:09 -04:00
Joe Haddad
3cd37b29ea
Simplify development hiding (#8789)
We were trying to be too tricky. `visibility: hidden` is great for layout speed, but it allows child elements to make themselves visible.

Since styles are going to change anyway, this doesn't make sense. We should completely hide the body which prevents a reflow by avoiding any style computation until Global CSS is ready to go.
2019-09-18 16:15:08 -04:00
Joe Haddad
e920e579f2
v9.0.7-canary.0 2019-09-18 15:16:05 -04:00
Joe Haddad
b4d349e6c1
Reduce Install Size (#8788)
* Reduce Install Size
This should shave a decent amount off our install size.

* Fix CSS source map emitting

* Fix generation

* Enable source maps for testing purposes

* Disable double comment

* Fix test regex
2019-09-18 13:59:46 -04:00
Joe Haddad
2612b48e3f
Update webpack typings (#8783)
This is in preparation of a new plugin.
2019-09-18 11:24:37 -04:00
Joshua Byrd
9b3d9f4255 Make favicon work (#8776) 2019-09-18 11:15:21 -04:00
Joe Haddad
65358b7a33
Global CSS Support (#8710)
* Global CSS Support

* Fix webpack configuration

* oneOf rule isn't necessary yet

* Adjust CSS chunk naming

* Begin testing CSS behavior

* Add another test TODO

* Replace null-loader with ignore-loader

* Turn on chunks for new CSS feature

* Fix multi test suite

* Test CSS import order

* Test style HMR

* Test CSS compilation

* Test compilation and prefixing together

* Verify CSS styling works for Development and Production

* Add missing TODO

* Remove unnecessary test

* Adjust TODO message

* Hide page until React hydrates

* Revert "Hide page until React hydrates"

This reverts commit 898d4e0ee547b003d5790e2b11476740d645b907.

* Hide FOUC during development

* Test CSS imports

* Update tests TODO

* Add fixture for url() test

* Test `file-loader` support in CSS files

* Use a simple variant of cssnano

* Self-import

* Undo bundling

* Implement suggestion
2019-09-17 16:05:20 -04:00
Joe Haddad
20aa1e4d21
v9.0.6 2019-09-17 14:21:38 -04:00
Joe Haddad
85f84a040a
v9.0.6-canary.7 2019-09-17 13:24:34 -04:00
JJ Kasper
b210133907 Show dots for non-TTY (#8771) 2019-09-17 13:22:51 -04:00
Joe Haddad
aa98323ed0
v9.0.6-canary.6 2019-09-17 00:22:13 -04:00
JJ Kasper
129e32f8ad
Fix windows paths mismatching for type errors (#8766) 2019-09-16 21:30:09 -05:00
JJ Kasper
4e9e51035e Match public files priority in dev (#8641)
* Match public files priority in dev

* Remove un-needed old public file handling

* Run public file priority test for non-dev also

* Make sure to enable publicDirectory

* Add checking for conflicting pages in dev and during build

* Add error for public dir middleware conflict

* Add err.sh for _next conflict

* Move up public dir conflict checking

* Only run _next conflict check in dev when path contains it
2019-09-16 23:06:30 +02:00
Tim Neutkens
369eceb0e7 v9.0.6-canary.5 2019-09-16 20:35:55 +02:00
JJ Kasper
583b4677ae Prevent URL from being updated while asPath is delayed (#8756)
* Prevent updating URL when delaying asPath

* Ignore TypeScript not liking __NEXT_DATA__

* Update another global to fix standard check
2019-09-16 12:15:18 -04:00
JJ Kasper
204028d6ab Update build feedback with dots indicating activity (#8382)
* Add progress for analyzing and auto-prerendering

* Add typing for tty-aware-progress and use stdout

* Add fancier spinners

* Update spinner and add handling for logs while spinning

* Remove un-needed types package

* Remove progress and combine analyzing/prerendering messages
2019-09-16 17:37:00 +02:00
JJ Kasper
44bbf9ad27 Catch error from failing to unobserve (#8578)
* Catch error from failing to unobserve

* Update link.tsx
2019-09-16 16:56:56 +02:00
Lukáš Huvar
7863b60ef6 Prettier fix (#8754) 2019-09-16 15:24:42 +02:00
Azim Atefi
a0341ea150 Convert Readme Custom Error Pages To Functional Component (#8513)
* Convert Readme Custom Error Pages To Functional Component

* Update packages/next/README.md

Co-Authored-By: Tim Neutkens <tim@timneutkens.nl>

* Run readme through prettier
2019-09-16 14:30:50 +02:00
JJ Kasper
fe7c7342c7 Add link to docs for prerender indicator and allow disabling (#8610)
* Add link to docs for prerender indicator and allow disabling

* Fix lint error from example

* Disable by default when electron is detected

* Add button to dismiss indicator for session

* Update disabling indicator in electron
2019-09-15 23:18:11 +02:00
JJ Kasper
ed5dc2107f Add autoExport to __NEXT_DATA__ (#8746)
* Add autoExport to __NEXT_DATA__

* Update render variable
2019-09-15 20:35:14 +02:00
Joe Haddad
00e0281d71
v9.0.6-canary.4 2019-09-14 17:42:59 -04:00
Joe Haddad
d031cf64df
Ensure requests are resolved as directories (#8742)
* Ensure requests are resolved as directories
`resolveRequest` will strip down to baseDir if there's no trailing slash as it assumes you passed a file.

* Disable telemetry for PR Stats
2019-09-14 17:41:05 -04:00
Joe Haddad
cbd427bf3c
Document the intended behavior of our externals (#8741)
This fully annotates our externals code to explain how it should be functioning. This will be useful as tests cases are made to ensure this is working correctly.
2019-09-14 16:58:45 -04:00
Maël Nison
9770d192f2 Prevents externalizing non-hoisted packages (#8739) 2019-09-14 16:12:25 -04:00
Tim Neutkens
8cc6071347
Update readme.md 2019-09-14 21:21:41 +02:00
JJ Kasper
b5d61579c8 Make sure to fail export when prerender fails with serverless bundle (#8738)
* Make sure to error on serverless prerender failure

* Add test case

* Update index.test.js
2019-09-13 19:02:15 -04:00
JJ Kasper
2ae8b345db
v9.0.6-canary.3 2019-09-13 14:49:59 -05:00
JJ Kasper
c8e1e141e1
Make sure renderOpts is available before checking (#8734)
* Make sure renderOpts is available before checking

* Apply suggestions from code review

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

* Update check
2019-09-13 14:43:45 -05:00
Joe Haddad
fb83462713
Externalize experimental package (#8731)
* Add missing dependency

* Ignore prepass for Next.js internal

* Revert "Add missing dependency"

This reverts commit 9ef0030b56255577364ff7cab46f513216a290ae.
2019-09-13 12:38:25 -04:00
Joe Haddad
25451ce47a
v9.0.6-canary.2 2019-09-13 10:53:16 -04:00
Romain
98f368f545 Add missing Link import to routing doc (#8728) 2019-09-13 14:43:14 +02:00
Lukáš Huvar
9731e7e99c [Docs] Prefetch disabled for 2g or SaveData header (#8717) 2019-09-12 13:11:34 +02:00
JJ Kasper
2139f66ac3 Add test for duplicate scripts and add extra de-duping (#8709) 2019-09-11 17:20:47 -04:00
Joe Haddad
eb8c11bbda
Organize webpack configuration imports (#8711)
This PR simply organizes the webpack config imports.
2019-09-11 16:41:29 -04:00
Joe Haddad
55369051f5
Warn build on duplicate pages (#8646)
* Fail build on duplicate pages
This will fail the `next build` command when a duplicate page is found.
In development, we'll emit a warning instead of crashing the dev server.

* Add test for warning in development

* Only issue a warning

* Fix production test

* Fix development test

* Remove useless arg

* Warn in development, too
2019-09-11 14:26:10 -04:00
Joe Haddad
594851111b
Nit: sort experimental keys (#8707) 2019-09-11 14:10:51 -04:00
JJ Kasper
5a0dcbc95b Update pages-loader to return one value (#8629)
* Update pages-loader to return one value

* de-dupe page mod update also
2019-09-11 13:21:10 -04:00
Joe Haddad
fcadad9960
TypeScript report on active pages only (#8703)
* TypeScript report on active pages only
The TypeScript integration needs to report on active pages only.
When inactive pages are reported, they block the compilation and prevent the user from fixing the error (because the file isn't watched).

We cannot add the file to the webpack watcher because the compilation has already been sealed.

* Remove TODO message

* Test that inactive pages are not type checked
2019-09-11 13:06:48 -04:00
JJ Kasper
a5ebe41a9a Delay updating asPath for auto exported pages (#8681)
* Delay updating asPath for auto exported pages

* Add additional test ensuring asPath is updated
2019-09-10 13:30:25 -04:00
Joe Haddad
ba683b3fab
Support non-flag variant of telemetry cmds (#8695)
This adds support for `next telemetry disable` (and keeps support for `next telemetry --disable`).

This also informs the user telemetry was already disabled if they re-run the command to give peace of mind.
2019-09-10 12:31:18 -04:00
Filip Wojciechowski
92e26ce1b1 better type for AppTree in NextPageContext (#8662)
* better type for AppTree in NextPageContext

* updated tests

* new AppTreeType type and updated tests

* removed a commented out line

* another take on the type of AppTree, with updated tests

* allow passing additional props to AppType

* Update suite name
2019-09-09 11:23:34 -05:00
Maël Nison
9fa8baa03a Uses the PnP API when available (#8668)
* Uses the PnP API when available

* Moves the resolution into an helper

* Update packages/next/lib/resolve-request.ts

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

* Apply Prettier
2019-09-09 11:47:42 -04:00
Joe Haddad
93d6a670fe
Resolve externals using webpack's context (#8669) 2019-09-08 13:53:33 -04:00
Joe Haddad
b10f797889
Re-enable anonymous telemetry (#8667) 2019-09-07 14:11:17 -04:00
Joe Haddad
3052a8ff92
Remove Telemetry Registration (#8664) 2019-09-07 10:51:09 -04:00
Joe Haddad
3000d71955 Add intl and Apollo to packages of interest (#8665) 2019-09-07 15:00:08 +02:00
Maël Nison
d3c1731c09 Adds the PnP plugin by default (#8653)
* Adds the PnP plugin by default

* Covers loaders

* Fixes linting
2019-09-06 09:49:38 -04:00
Joe Haddad
73b6c1e633
[docs] useRouter cannot be used with classes (#8649)
The `useRouter` function is a hook and cannot be used with Classes.

A few React beginners have brought this up, so we document the alternatives to hooks.
2019-09-05 23:05:59 -04:00
Joe Haddad
6444889c9b
Update Create Next App Template (#8648)
This updates the Create Next App template to remove the "Create Next App" card.

Instead, we now display cards to the docs, learn, and the examples.
2019-09-05 22:51:42 -04:00
Alex Matseshe
e78324a742 Fix typo in README.md #8640 (#8642) 2019-09-05 14:43:37 -05:00
Tim Neutkens
5a9b0ba2ce v9.0.6-canary.1 2019-09-05 16:11:08 +02:00
Joe Haddad
6e77c071c7
Update Next.js Telemetry Event Shapes (#8628)
* Update Next.js Telemetry Event Shapes

* Force value as-is
2019-09-04 20:31:35 -04:00
JJ Kasper
61b8b7323e Update workers for next export (#8623)
* Add failing test

* Add jest-worker to export
2019-09-04 19:56:11 -04:00
Tim Neutkens
2ba352da39 Move next-server back into next package (#8613)
* Initial move

* Make emitting work

* Update paths

* Remove leftover files

* Add correct externals configuration

* Import correct path

* Update path to work with ts-server test

* Update lib directory

* Compile next-server/lib
2019-09-04 10:00:54 -04:00
Tim Neutkens
d501b941f0 v9.0.6-canary.0 2019-09-04 10:54:38 +02:00
Joe Haddad
b587281162
Disable Telemetry (#8614)
We need to disable telemetry until we figure out how we want to store the data.
2019-09-03 11:34:34 -04:00
JJ Kasper
fbf784d76f Add data-ampdevmode attribute for AMP scripts (#8524)
* Add data-ampdevmode attribute

* Apply suggestions from code review

Co-Authored-By: Joe Haddad <joe.haddad@zeit.co>
2019-09-03 11:11:22 -04:00
Joe Haddad
ffc205ba8c
Use URL-friendly chunk names (#8609)
* Use URL-friendly chunk names

* Fix example linting
2019-09-03 10:55:48 -04:00
Ali eslamifard
dd9448c574 Update README and data-fetch example to use function components. (#8546)
* This example show how to use STOMP inside a Next.js application.

* Fix useEffect

* Add _app.js implementation

* Fix lint error

* Fix lint error

* Update examples/with-stomp/README.md

Co-Authored-By: Luis Fernando Alvarez D. <luis@zeit.co>

* withStomp removed

* The url address changed

* _app.js removed. useClient added.

* remove

* revert

* remove

* Update README.md according to Hooks concept.

* Update example

* Update README.md

* Components should use functional syntax

* Update packages/next/README.md

Co-Authored-By: Tim Neutkens <tim@timneutkens.nl>

* Update packages/next/README.md

Co-Authored-By: Tim Neutkens <tim@timneutkens.nl>

* Update packages/next/README.md

Co-Authored-By: Tim Neutkens <tim@timneutkens.nl>

* Update packages/next/README.md

Co-Authored-By: Tim Neutkens <tim@timneutkens.nl>

* Update README.md
2019-09-02 12:47:30 +02:00
Natalie Marleny
efa368d427 Update README.md badge text (#8593) 2019-09-01 20:30:18 +02:00
Giuseppe
ad0cca9549 Update styled-jsx (#8583)
* Update styled-jsx

Fixes an escaping issue in template literals that @lfades found

* Update next-server's styled-jsx also
2019-08-31 10:08:43 -05:00
Houssein Djirdeh
689b1319b6 Update performance marking (#8527)
* creates perf marks object constant

* updates clearmarks to only clear core marks

* adds test + fixes object constqnt reference

* hardcodes perf marks and removes constant

* adds test to check custom marks are not cleared
2019-08-30 22:40:05 -04:00
JJ Kasper
7310e6bca6
Remove extra default export from readme (#8579) 2019-08-30 12:28:04 -05:00
Lukáš Huvar
5cc3b8a531 Fix docs (#8577) 2019-08-30 18:51:48 +02:00
Joe Haddad
67e7753c85
Fix serverless chunking (#8569)
* Fix Serverless Chunking

* Remove old test & environment variable

* Update serverless trace test case
2019-08-30 07:26:30 -04:00
JJ Kasper
340594398e
Make sure to 404 for /_next/static (#8564) 2019-08-29 15:00:54 -05:00
JJ Kasper
4eb7dde490 Add err.sh for incompatible href and as (#8561)
* Add err.sh for incompatible href and as

* Add note for only showing when Link is clicked
2019-08-29 13:25:42 -04:00
Jacky Shikerya
4adf710788 Encode URL paths in HTML and CSR (#8435)
* added filename encoder for testing

* fixes in page-loader

* fix possibly undefined

* conflict resolution

* Update packages/next/pages/_document.tsx

Co-Authored-By: Joe Haddad <timer150@gmail.com>

* move encoding into individual tags as Joe suggested
2019-08-29 12:56:24 -04:00
Joe Haddad
1f4e34ca00
Anonymous Telemetry (#8529)
* Add anonymous telemetry

* Fix types

* Remove semver package

* Rename build time variable

* Track CSS-in-JS solutions

* Single retry and 5s timeout
2019-08-29 12:43:06 -04:00
Mark
7bd4f4f3bf Remove link (#8539) 2019-08-27 23:05:47 -04:00
Jason Miller
1b6e455807 Add modern-preset Babel option (#8521)
* Add `modern-preset` Babel option

* fix test failure

* prefix configuration option with "experimental-"

* fix issues noted by @janicklas-ralph
2019-08-27 17:20:07 -04:00
Sebastian Silbermann
bb0ccd9a4d Specify loader paths for PnP support (#8531)
* fix(next): Loader not found using yarn v2

* Use Object.fromKeys pattern instead
2019-08-27 16:37:47 -04:00
Daniel Almaguer
af9099c2a5 Add missing dependency to next-server (#8507) 2019-08-24 22:01:09 -04:00
JJ Kasper
f81b6d56e0 Replace worker-farm with jest-worker (#8496)
* Replace worker-farm with jest-worker

* Apply suggestions from code review

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

* Remove semaphores on top of jest-worker, unwind
terser worker, and remove extra error log
2019-08-24 14:55:42 -04:00
Joe Haddad
2c7b4d8aaa
v9.0.5 2019-08-24 12:45:04 -04:00
Joe Haddad
0f92a8770a
v9.0.5-canary.3 2019-08-24 11:34:12 -04:00
Houssein Djirdeh
010059915d Add version property to Next.js instance (#8499)
* adds global for next version

* updates to use env variable and keeps it local

* Test Next.js version presence

* Unfocus test
2019-08-24 00:49:24 -04:00
JJ Kasper
1dbacda576
Remove extension from err.sh link (#8500)
* Remove extensions from err.sh link

* Remove .md from test also
2019-08-23 17:00:57 -05:00
JJ Kasper
30cd8c2840
v9.0.5-canary.2 2019-08-23 16:19:30 -05:00
JJ Kasper
674ba17211
Update prerender-manifest structure (#8497) 2019-08-23 16:17:40 -05:00
Luis Fernando Alvarez D
64e8c61dcf Update ./static/ folder documentation (#8477)
* Improve the static folder note

* Update README.md
2019-08-23 11:10:30 -04:00
Alex Castle
3970a26b92 Tweaks and test for library chunks fixes (#8482)
* Adjust lib chunk naming algorithm and prevent duplicate react-dom

* Remove alias for react-dom and update separator replacement logic

* Add comment to webpack-config

* Add integration test for react-dom duplication

* Switch to using hash for lib chunk names

* remove extra file from PR

* Remove another extraneous change

* Remove test based on lib chunk name

* Update index.test.js
2019-08-23 10:28:48 -04:00
Joe Haddad
f890482871
Check for TypeScript files for auto setup (#8479)
* Check for TypeScript files for auto setup
This re-adds the behavior and only checks the `pages` directory for speed reasons.

* Adjust logic

* Handle not found too
2019-08-22 22:01:12 -04:00
迷渡
4a864ca951 fix duplicate spaces in readme (#8484) 2019-08-22 20:47:43 -05:00
JJ Kasper
56a134409c Debug TypeScript test suite (#8476)
* Tweak typescript test suite

* Revert "Tweak typescript test suite"

This reverts commit 9e0108da7c70e7ae45b412b60c07162383de65f3.

* Make sure HMR connection isn't being closed
while testing

* Update to not re-use NODE_ENV

* Break up/rework TypeScript test suite

* bump
2019-08-22 16:34:24 -04:00
JJ Kasper
bf11421992 Add deprecation warning for App Container (#8475)
* Add deprecation warning for App Container

* Apply suggestions from code review

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

* Tweak for more dead-code elimination
2019-08-22 16:19:15 -04:00
JJ Kasper
be850d0353
Add warning when empty object is returned from getInitialProps (#8474)
* Add warning when empty object is returned
from getInitialProps

* Apply suggestions from code review

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

* Apply suggestions from code review

Co-Authored-By: Jan Potoms <potoms.jan@gmail.com>
2019-08-22 12:06:30 -05:00
Joe Haddad
d85dfecd5e
v9.0.5-canary.1 2019-08-22 11:53:08 -04:00
Sojin Park
7c0ac82264 Fix bug in hook destructuring optimization when ignoring array elements (#8455)
* Fix bug in hook destructuring optimization when ignoring array elements

* Add test cases
2019-08-22 11:21:34 -04:00
Alex Castle
3896cbe712 Adjust lib chunk naming algorithm and prevent duplicate react-dom (#8450)
* Adjust lib chunk naming algorithm and prevent duplicate react-dom

* Remove alias for react-dom and update separator replacement logic

* Add comment to webpack-config
2019-08-22 10:46:11 -04:00
Ran Yitzhaki
c3b18fdeaa Fix a broken link in webpack config (#8456)
* Fix a broken link in webpack config

* Update test
2019-08-21 11:58:31 -04:00
Henrik Wenz
878a92f101 Remove Duplicate Assignment (#8464) 2019-08-21 09:23:25 -05:00
Julien Bouquillon
1007777471 doc: typo fix (#8460)
* doc: typo fix

* fix glitch
2019-08-21 14:38:14 +02:00
Joe Haddad
f41f630d19
v9.0.5-canary.0 2019-08-20 17:25:46 -04:00
JJ Kasper
9c8aaf9d4b Fix build-manifest not removing _app files for modern (#8447) 2019-08-20 15:32:03 -04:00
Jason Miller
8bd2e433de Initial optimizeLibraries experimental flag (#8345)
* Add experimental optimizeLibraries flag, currently prunes Moment.js locales

* expose moment for use in assertion

* try with the same setup as the production integration test

* Apply optimiztaions in dev and on server so they're consistent.

* fix build (oh dear)

* Update index.test.js

* Rename flag to future.excludeDefaultMomentLocales

* Adjust impl
2019-08-20 15:19:45 -04:00
Lukáš Huvar
f0b6d0a1e2 Fix custom page extension in development (#8446)
* Fix page extension in development

* Remove un-used file

* Fix standard
2019-08-20 13:38:30 -04:00