Commit graph

1114 commits

Author SHA1 Message Date
Luis Fernando Alvarez D
0b15540a48 Don't look up for TS files in dev (#8374)
* Only read for typescript files if there's no tsconfig

* Update verifyTypeScriptSetup.ts

* Remove the recursive check for TS files

* Remove unused import

* Updated tests

* Add a check for the content of tsConfig

* Clean up

* utf8
2019-08-15 11:27:02 -04:00
Prateek Bhatnagar
cffa2e3f21 Reverting clear measure (#8373) 2019-08-15 08:14:09 +02:00
Lukáš Huvar
b47348bdf8 Change componentWillMount to UNSAFE (#8357)
* Change to unsafe

* Ignore
2019-08-14 18:19:13 -04:00
Joe Haddad
d3f25ccbc5
v9.0.4-canary.5 2019-08-14 14:15:43 -04:00
Joe Haddad
3c611822ab
Create a unique instance of transform-define (#8371) 2019-08-14 14:10:55 -04:00
Joe Haddad
2d810950b2
v9.0.4-canary.4 2019-08-14 12:18:44 -04:00
William Li
a15e22e829 updated links from #useRouter to #userouter (#8362)
Links pointing to #useRouter doesn't work. They need to be #userouter
2019-08-13 23:04:42 -04:00
Joe Haddad
5a8ed815fc
Define typeof window for application code only (#8355) 2019-08-13 22:02:53 -04:00
Iurii Kucherov
99f2d2a109 Add a note for multiple dynamic route segments (#8359)
* Update README.md

* Update README.md

* Update README.md

* Update README.md
2019-08-13 21:35:27 -04:00
JJ Kasper
57d91f7d38 Fix AppTree type not allowing extra props (#8352) 2019-08-13 16:15:44 -04:00
JJ Kasper
d9abbaded1 Remove experimental async-to-promises code (#8353) 2019-08-13 16:04:17 -04:00
JJ Kasper
9fe95b5c7d Add note explaining empty query during prerendering (#8351) 2019-08-13 19:58:45 +02:00
Spencer Elliott
de4e16bf72 Add missing dependency "compression" to next-server (#8344)
* Add missing dependency "compression"

* Remove "compression" dependency from next
2019-08-13 12:03:50 -04:00
Houssein Djirdeh
55ccb09dee fixes nav start argument in user timing check (#8348) 2019-08-13 11:48:30 -04:00
JJ Kasper
8c19d78a08 Also provide AppTree in NextPageContext (#8223)
* Also provide AppTree in NextPageContext

* Don't predefine AppTree as null in ctx

* Make update smaller

* Don’t reassign variable

* Add test for AppTree in NextPageContext

* Update utils.ts
2019-08-13 11:33:48 +02:00
Lukáš Huvar
7e1d54cc09 Add warning for disabled minification during build (#8337)
* Add warning for disabled minification

* Adding err.sh

* Apply suggestions from code review

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

* Remove example

* Update packages/next/build/index.ts

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

* Update index.test.js
2019-08-12 23:13:12 -04:00
Alex Castle
3b31f957a1 Use 'initial' setting for SplitChunksPlugin (#8293)
* Use 'initial' setting for SplitChunksPlugin

* Initial chunking integration test shell

* Create integration tests for granular chunks build output
2019-08-12 20:35:33 -04:00
Joe Haddad
bc9f2b6139
Minify ncc'd packages for download speed (#8341) 2019-08-12 17:31:07 -04:00
Joe Haddad
df30f5e4b6
🐛 Support multiple Next.js versions in one file (#8339) 2019-08-12 16:53:11 -04:00
Joe Haddad
8d219c2371
Detect @types/ package for compiled packages (#8340) 2019-08-12 16:29:42 -04:00
Joe Haddad
ab0384deef Fix TypeScript setup with empty file (#8332)
New versions of TypeScript now throw an error when no matching TypeScript files are found. We still want to setup in this case.

-----

Closes #8324
2019-08-12 11:40:53 +02:00
Natalie Marleny
06876f1be0 fix: Warn when user specifies prefetch option as true (#8233)
* Warn when user specifies prefetch option as `true`

* Update index.test.js
2019-08-12 00:26:25 -04:00
Joe Haddad
6b516f6c84
Remove accidental support for invalid JavaScript (#8077)
* Remove accidental support for invalid JavaScript
Next.js inadvertently supported users mixing ES Modules and CommonJS due to a Babel bug that was fixed in v7.
This removes the hack in favor of the new Babel `sourceType` feature.

**This will result in broken code for users who relied on this non-standard conforming behavior.**

* Fix comment

* Toggle feature behind modern flag
2019-08-12 00:10:12 -04:00
JJ Kasper
77c5e36ba7 Escape output names for modern bundles to prevent replacing (#8232)
* Escape output names for modern bundles

* Update escaping for modern bundle
2019-08-11 23:32:18 -04:00
Gerald Monaco
04cf779702 Add warning for missing <Head> (#8276)
* Add warning for missing <Head>

* Update the warning to be eliminated away in production

* Update head-manager.js
2019-08-11 22:48:05 -04:00
Adam Misiorny
3eca88609a Prevent false positive experimental warning (#8284)
* Prevent false positive experimental warning

* Add tests for experimental warning
2019-08-11 22:26:37 -04:00
JJ Kasper
fc7e235f2c Followup optimizations for new experimentalPrerender (#8287)
* Add checking for hybrid AMP during static check

* Update to always hit server for prerender data

* Add removing of SPR code when not used

* Add checking for hybrid AMP during static check

* Update to always hit server for prerender data

* Add removing of SPR code when not used

* Update dead code elimination
2019-08-11 21:56:57 -04:00
Tim Neutkens
35e7b21df1 Remove extra variable (#8329) 2019-08-11 20:38:42 -04:00
Luis Fernando Alvarez D
36aabe05a2 Show warning if next export detects an API route (#8257)
* Throw error if next export detects an api route

* Moved the test to the export tests

* Added missing comma

* Move the API route comment

* Add comma after replace

* Show a warning instead
2019-08-12 00:37:20 +02:00
Borek Bernard
4ab56e8a8a Update custom app example in README (#8320)
The code example now uses simpler and safer approach to call page's `getInitialProps`.
2019-08-12 00:06:45 +02:00
Tim Neutkens
2b62c33f25
Only add flying-shuttle code when enabled (#8330)
Follow-up of #7536, small optimization / code removal when the feature is not enabled.
2019-08-12 00:03:11 +02:00
Tim Neutkens
963726d68e v9.0.4-canary.3 2019-08-11 22:44:23 +02:00
Tim Neutkens
a90a55545b
Deprecate Container usage (#8327)
* Remove Container from examples

* Update readme to reflect Container removal
2019-08-11 22:02:33 +02:00
Lukáš Huvar
869bf0f16c Remove 405 from render method (#8323)
* Revert 405 on pages

* Modify tests
2019-08-11 15:42:40 +02:00
Steven Sinatra
5b1150352f Add info about removing @zeit/next-typescript on .babelrc (#8321) 2019-08-11 13:09:01 +02:00
Tim Neutkens
da494dbb80 Document poweredByHeader option
Fixes #7657
2019-08-10 15:44:43 +02:00
Houssein Djirdeh
d190f2e112 Adds user timing marks and measures for hydration/render (#8069)
* adds user timing marks for hydration step

* changes measure names and removes window namespaces by adding performance as a global to standard

* separates hydrate and render marks

* Add performance mark to router change instead of link click

* Changes performance mark name at router change

* adds checks for performance

* creates constants utils for performance and user timings
2019-08-09 15:43:29 -04:00
JJ Kasper
1db69188ed Remove cache clearing from static-checker (#8290) 2019-08-08 21:52:24 -04:00
Joe Haddad
43370c1f8a
v9.0.4-canary.2 2019-08-08 14:19:46 -04:00
JJ Kasper
a4889f964e
Update handling of ref in next/link (#8254) 2019-08-08 13:11:17 -05:00
Alex Castle
3e8b36e879 Experimental: Granular build chunking (#7696)
* Refactor SplitChunksPlugin configs and add experimental chunking strategy

* Use typeDefs for SplitChunksConfig

* Modify build manifest plugin to create runtime build manifest

* Add support for granular chunks to page-loader

* Ensure normal behavior if experimental granularChunks flag is false

* Update client build manifest to remove iife & implicit global

* Factor out '/_next/' prepending into getDependencies

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

Co-Authored-By: Jason Miller <developit@users.noreply.github.com>

* Simplify dependency load ordering in page-loader.js

* Use SHA1 hash to shorten filenames for dependency modules

* Add scheduler to framework cacheGroup in webpack-config

* Update page loader to not duplicate script tags with query parameters

* Ensure no slashes end up in the file hashes

* Add prop-types to framework chunk

* Fix issue with mis-attributed events

* Increase modern build size budget--possibly decrement after consulting with @janicklasralph

* Use module.rawRequest for lib chunks

Co-Authored-By: Daniel Stockman <daniel.stockman@gmail.com>

* Dasherize lib chunk names

Co-Authored-By: Daniel Stockman <daniel.stockman@gmail.com>

* Fix typescript errors, reorganize lib name logic

* Dasherize rawRequest, short circuit name logic when rawRequest found

* Add `scheduler` package to test regex

* Fix a nit

* Adjust build manifest plugin

* Shorten key name

* Extract createPreloadLink helper

* Extract getDependencies helper

* Move method

* Minimize diff

* Minimize diff x2

* Fix Array.from polyfill

* Simplify page loader code

* Remove async=false for script tags

* Code golf `getDependencies` implementation

* Require lib chunks be in node_modules

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

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

* Replace remaining missed windows compat regex

* Trim client manifest

* Prevent duplicate link preload tags

* Revert size test changes

* Squash manifest size even further

* Add comment for clarity

* Code golfing 🏌️‍♂️

* Correctly select modern dependencies

* Ship separate modern client manifest when module/module enabled

* Update packages/next/build/webpack/plugins/build-manifest-plugin.ts

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

* Remove unneccessary filter from page-loader

* Add lookbehind to file extension regex in page-loader

* v9.0.3

* Update examples for Apollo with AppTree (#8180)

* Update examples for Apollo with AppTree

* Fix apolloClient being overwritten when rendering AppTree

* Golf page-loader (#8190)

* Remove lookbehind for module replacement

* Wait for build manifest promise before page load or prefetch

* Updating modern-only chunks inside the right entry point

* Fixing ts errors

* Rename variable

* Revert "Wait for build manifest promise before page load or prefetch"

This reverts commit c370528c6888ba7fa71162a0854534ed280224ef.

* Use proper typedef for webpack chunk

* Re-enable promisified client build manifest

* Fix bug in getDependencies map

* Insert check for granularChunks in page-loader

* Increase size limit temporarily for granular chunks

* Add 50ms delay to flaky test

* Set env.__NEXT_GRANULAR_CHUNKS in webpack config

* Reset size limit to 187

* Set process.env.__NEXT_GRANULAR_CHUNKS to false if selectivePageBuilding

* Update test/integration/production/test/index.test.js

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

* Do not create promise if not using chunking PR
2019-08-08 13:14:33 -04:00
Jason Miller
fa5be4971a Bugfix: Babel targets value can be a String (#8268)
* Fix modern SSR build when Babel configuration uses a String value for "targets". Fixes #8255.

* Add custom babelrc integration tests
2019-08-08 15:38:51 +02:00
Delba de Oliveira
484f988a3a Update README.md (#8282) 2019-08-08 15:31:28 +02:00
JJ Kasper
61d151ccd7 Handle backslashes in exportedFiles (#8277) 2019-08-07 11:27:01 -04:00
Sebastian Benz
91629a8e72 Migrate amp-toolbox-optimizer to @ampproject/toolbox-optimizer (#8275)
* migrate amp-toolbox-optimizer to @ampproject/toolbox-optimizer

* Add updated yarn.lock
2019-08-07 10:47:46 -04:00
JJ Kasper
8e4509caf2 Add warning for invalid href being passed to router (#8231)
* Add warning for bad href being passed to router

* Apply suggestions from code review

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

* Inline invalidHref for better code elimination
2019-08-07 10:47:13 -04:00
JJ Kasper
ca13752e24
Implement experimentalPrerender option (#7983)
* Revert "Remove Old Prerender Implementation (#8218)"

This reverts commit 2ab300dd81.

* Add contentHandler for page config

* Rename config from contentHandler to re-use
experimentalPrerender

* Remove un-needed changes

* Replace backslashes for manifest

* Update manifest output format

* Make prerender: true enable SPR behavior and update
to merge prerender-manifest for flying-shuttle

* Fix output path for / prerender file

* Add dynamic routes to test suite

* Add generating and previewing of skeletons
for prerendered dynamic routes

* remove inline prerender option

* update to not replace getInitialProps which allows
nested getInitialProps and add query when fetching prerender

* Apply suggestions from code review

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

* Remove legacy prerender option

* Apply suggestions from review

* Apply more suggestions from review

* Apply suggestions from code review

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

* Add handling of error when parsing json

* Update handling of moving exported pages

* Rename nextPreviewSkeleton to _nextPreviewSkeleton

* bump
2019-08-06 15:26:01 -05:00
Luis Fernando Alvarez D
d4d5ad4ba5 Remove propertyFields from the client router (#8219)
* Remove forEach over the components prop

* Remove propertyFields
2019-08-06 15:42:33 +02:00
Lukáš Huvar
beed65be40 Compression documentation (#8247)
* Documentation about gzip

* Update packages/next/README.md

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

* Improve docs

* Update packages/next/README.md

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

* Update packages/next/README.md

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

* Update README.md
2019-08-06 13:49:53 +02:00
Luis Fernando Alvarez D
9b02939c43 Define generic for _app state (#8256) 2019-08-06 13:23:50 +02:00