Commit graph

4423 commits

Author SHA1 Message Date
Joe Haddad
1ff5005524
v9.0.8-canary.0 2019-10-01 14:27:31 -04:00
Henrik Wenz
b5da739f56 Simplify with-redux example (#8875)
## Changes

- [x] Remove _app.js usage
- [x] Migrate withRedux HOC to functional component
- [x] Add correct display name
- [x] Remove abstractions/boilerplate from example
- [x] Add useInterval HOC from Dan
2019-10-01 12:11:20 -05: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
takehiro-takahashi
0410a43d5a update package (#8906) 2019-09-29 20:39:32 +02:00
Tim Neutkens
4e1f1131bc v9.0.7 2019-09-28 14:45:57 +02:00
JJ Kasper
1a6a6c99c1 Add test case to prevent regression for page config (#8890) 2019-09-28 14:43:38 +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
9152a2a00d
Better test case for serverless export (#8865)
This checks that the program output actually claims there was a build error.
2019-09-26 13:58:42 -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
fabienheureux
297d1466e7 Fix typo and wording in README.md (#8867)
The first corrected sentence did not feel very natural.
The second one contained a typo.
2019-09-26 17:44:49 +02: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
Henrik Wenz
ba246446ef Remove useMemo from apollo examples (#8815)
We don’t need useMemo here since its functionality is already covered by initApolloClient.

Thanks to @mpoisot

closes #8810
2019-09-21 13:17:21 +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
JJ Kasper
fdd5f7391e
Add caching yarn cache to Azure (#8787)
* Add caching yarn cache to Azure

* bump

* Update cache key

* Apply suggestions from code review

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

* Remove extra check
2019-09-18 12:50:25 -05:00
Joe Haddad
a9c8261392
Test CSS Source Map generation (#8785)
Ensure CSS Source maps are emitted correctly.
2019-09-18 12:03:12 -04:00
JJ Kasper
cc177561e4 Run all Azure tests with node v10 (#8782)
* Run all Azure tests with node v10

* Update job names

* Update CSS test
2019-09-18 11:42:59 -04:00