Commit graph

536 commits

Author SHA1 Message Date
Tim Neutkens
57dcdd90b5
Bypass OPTIONS handling for API routes (#12978) 2020-05-16 17:15:12 -04:00
Jan Potoms
32057c849d
Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
JJ Kasper
9df9d4aea5
Fix build stalling with styled-jsx plugins (#12952) 2020-05-15 17:15:15 -04:00
Joe Haddad
0d49f22e11
Remove react-error-overlay (#12942) 2020-05-15 14:14:44 -04:00
JJ Kasper
7f28e8bf9b
Correct multi-match param behavior (#12930) 2020-05-15 12:45:29 -04:00
Alessandro Cifani
615f658da4
chore(deps): upgrade url-polyfill (#12829) 2020-05-13 11:39:41 -04:00
Tim Neutkens
93c81494c6
Make fetch polyfill work with ky-universal (#12804) 2020-05-12 15:58:21 -04:00
Joe Haddad
8b51e003f5
Upgrade deps (#12700) 2020-05-10 20:48:57 -04:00
JJ Kasper
92edfb953d
Cont. Update performance relayer and remove unstable prefix (#12665)
* updates relayer, uses web-vital lib, removes fid polyfill and removes unstable prefix from relayer

* simplify logic, fix null check

* update docs

* Update tests

* Rename relayWebVitals to reportWebVitals

Co-authored-by: housseindjirdeh <houssein@google.com>
2020-05-09 21:48:52 +02:00
Simon Knott
be02fe183f
Allow @babel/preset-typescript to be configured (#11840)
* Allow `@babel/preset-typescript` to be configured

Some usages, e.g. [getting parameter decorators to work properly](https://github.com/WarnerHooh/babel-plugin-parameter-decorator/pull/19), require configuring `@babel/preset-typescript`.

This commit adds that functionality to `next/babel`.

* Add unit test for babel/preset allowing to pass options to @babel/preset-typescript

* Add integration test for onlyRemoveTypeImports

* Update babel dependencies

* Update to compatible typescript version and fix types

* Fix linting and run pre-nccing

* Update size-limit test

* Add additional tests

* Re-Apply delta to be calculated using -262

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-05-09 17:12:02 +02:00
Joe Haddad
6627f57b59
[Fast Refresh] Upgrade react-refresh for SC (#12627) 2020-05-08 10:28:51 -04:00
JJ Kasper
d37891a921
Update to latest version of stacktrace-parser (#12597) 2020-05-07 08:26:15 -05:00
Sebastian Benz
5dfb2e40d1
Update AMP dependencies (#12536) 2020-05-06 10:18:18 -04:00
Maël Nison
a7bf8c211d
Adds missing deps (#12519) 2020-05-06 10:33:06 +02:00
Joe Haddad
f024814057
[Fast Refresh] Correctly Trap Focus in Overlay (#12502)
* [Fast Refresh] Correctly Trap Focus in Overlay

* Adjust escape behavior to be more correct

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-05-05 11:05:40 -04:00
Joe Haddad
e0449a5b9c
[Fast Refresh] New Overlay for Prerender Error (#12485) 2020-05-04 17:16:03 -04:00
Joe Haddad
d81f23d74f
Upgrade Flexbugs Dependency (#12459)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-05-04 12:33:34 -05:00
matamatanot
5787cbd9de
Update lint-staged (#12225) 2020-05-02 15:47:16 -04:00
Joe Haddad
4624c09fe5
fix lockfile 2020-05-02 01:11:30 -04:00
Shotaro Watanabe
eb9d10fa80
Update @ampproject/toolbox-optimizer to v2.3.0 (#12039) 2020-05-02 00:38:04 -04:00
Joe Haddad
37e3ec8d17
[Fast Refresh] Click to open in editor (#12397) 2020-05-01 22:04:03 -04:00
Joe Haddad
42daf7f47c
Upgrade source-map package (#12355)
* Abort after 10s instead of 3s while testing

* skip tests to unlock CI

* re-enable tests

* fix

* Catch `performReactRefresh` errors
2020-04-30 13:13:40 -04:00
Joe Haddad
fbea795ad9
[Fast Refresh] Redesigned Runtime Error Experience (#12222) 2020-04-30 10:50:25 -04:00
Tim Neutkens
0713ba4e78
Fix wildcard paths causing infinite resolving (#12318) 2020-04-29 17:04:42 +02:00
JJ Kasper
9482bfb906
Downgrade node-notifier to fix Azure tests (#12261) 2020-04-28 10:44:55 +02:00
JJ Kasper
3094016cc3
Downgrade terser to fix invalid minifying (#12178) 2020-04-26 15:16:43 -04:00
matamatanot
6ce3c7b435
Update node-notifier (#12205) 2020-04-26 17:24:21 +02:00
Joe Haddad
fcc6d7d483
Fix CSS Module HMR (#12177) 2020-04-25 13:08:06 +02:00
matamatanot
29f86d9076
Remove @types/find-up (#12120) 2020-04-23 09:39:31 +02:00
Joe Haddad
5d8709946a
[internal] Dedupe monorepo deps (#12093)
* Dedupe webpack

* Dedupe deps

* Update compiled deps
2020-04-22 01:25:43 -04:00
Joe Haddad
d8c71b1537
Evaluate App before Page in Dev for CSS Ordering (#12090) 2020-04-21 23:55:02 -04:00
Fonger
fc830b25de
Upgrade ora to 4.0.4 to prevent undefined progress on CI build (#12088) 2020-04-21 22:52:07 -04:00
Joe Haddad
07b24e6fa1
Upgrade webpack (#12082)
* Upgrade webpack

* rebundle
2020-04-21 16:05:29 -04:00
Joe Haddad
450d4bd0f3
Experimental: React Refresh Support (#12008)
* Add Fast Refresh Support

* Add Basic Acceptance Test

* Increase delay

* fix version

* Ignore test files

* Update packages/next/build/webpack/loaders/next-babel-loader.js

* Copy tests

* Redo test style

* drop directory

* fix compile

* fix remove function

* Update helpers
2020-04-19 13:58:31 -04:00
Joe Haddad
ec3f8e5815
Create React Refresh Utils (#12006)
* Create React Refresh Utils

* Fix Linting

* Update Prettier Ignore

* fix rules
2020-04-18 13:55:10 -04:00
Joe Haddad
fe09c10383
Upgrade terser-webpack-plugin for Webpack 5 (#11922)
* Upgrade `terser-webpack-plugin` for Webpack 5

* Upgrade again

* cacache cannot be bundled

* cacache cannot be bundled

* fix file

* remove cacache dep

* Update LICENSE
2020-04-15 14:20:25 -04:00
Joe Haddad
9fdd6ed2e4
Fix Lockfile 2020-04-13 14:48:23 -04:00
matamatanot
e686545c0d
Update @types in create-next-app (#11815)
* remove self made types

* add types

Co-authored-by: matamatanot <matamatanot@gmail.com>
2020-04-13 13:06:19 -04:00
Joe Haddad
041384bdda
Upgrade ci-info (#11758)
* Upgrade `ci-info`
This adds support for Nevercode, GH Actions, and Render.

* Repackage compiled deps

* Try to fix test
2020-04-09 10:23:04 -04:00
JJ Kasper
fa167e3346
Update to latest version of AMP optimizer (#11753)
* Update to latest version of AMP optimizer

* Update test

* Update another test

* Update another test
2020-04-09 10:23:31 +02:00
matamatanot
1f15072e99
Update got in create-next-app (#11725)
Co-authored-by: “kosuke_matano” <kosuke_matano@cyberagent.co.jp>
2020-04-07 09:24:57 -04:00
matamatanot
c89ddc97e2
Remove node-promisepipe library (#11700)
* remove promisepipe

* commit yarn.lock

Co-authored-by: “kosuke_matano” <kosuke_matano@cyberagent.co.jp>
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-04-06 10:46:04 -04:00
Madeline Ziolko
301cca3802
Update webpack and mkdirp (#11165)
* Update mkdirp to a version that no longer has a dependency on minimist: https://npmjs.com/advisories/1179

* Update webpack to the most recent minor version to remove minimist vulnerability.

* Update deps

Co-authored-by: Tim Neutkens <timneutkens@me.com>
2020-04-06 13:12:14 +02:00
Tim Neutkens
6e84c0c12a
Add dependencies used by compiled files (#11699)
* Add dependencies used by compiled files

* Update utils.ts
2020-04-06 11:52:19 +02:00
Joe Haddad
b747a366ab
Fix Preview Mode in <iframe> (#11638) 2020-04-03 13:18:04 -04:00
Guy Bedford
ce3f7d05b3
Drop url dependency (#11503) 2020-03-31 10:00:17 +02:00
Joe Haddad
b88f20c90b Fix lockfile 2020-03-30 16:26:25 -04:00
Guy Bedford
c16f60067b path-to-regexp 2020-03-30 16:26:25 -04:00
Guy Bedford
5619f990cf refactor ncc optimization, babel optimization 2020-03-30 16:26:25 -04:00
JJ Kasper
2713369e40
Update to not add path segments to redirect query automatically (#11497)
* Update to not add path segments to redirect query automatically

* Move check up
2020-03-30 18:43:24 +02:00
Tim Neutkens
e7ea27645d Add support for comments in tsconfig.json
Fixes #11390
2020-03-27 11:20:13 +01:00
JJ Kasper
d8155b22ff
Add initial support for new env handling (#10525)
* Add initial support for new env config file

* Fix serverless processEnv call when no env is provided

* Add missing await for test method

* Update env config to .env.json and add dotenv loading

* ncc dotenv package

* Update type

* Update with new discussed behavior removing .env.json

* Update hot-reloader createEntrypoints

* Make sure .env is loaded before next.config.js

* Add tests for all separate .env files

* Remove comments

* Add override tests

* Add test for overriding env vars based on local environment

* Add support for .env.test

* Apply suggestions from code review

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

* Use chalk for env loaded message

* Remove constant as it’s not needed

* Update test

* Update errsh, taskr, and CNA template ignores

* Make sure to only consider undefined missing

* Remove old .env ignore

* Update to not populate process.env with loaded env

* Add experimental flag and add loading of global env values

Co-authored-by: Tim Neutkens <timneutkens@me.com>
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-03-26 13:32:41 +01:00
JJ Kasper
eeea53c04b
Fix warning for API routes with next export (#11330)
* Fix warning for API routes with next export

* Update warning copy
2020-03-24 13:38:22 -04:00
Tim Neutkens
876ae3fc87
Upgrade loader-utils (#11324) 2020-03-24 09:57:23 -04:00
Joe Haddad
f19dcf9b6e
Add Numeric Separator Support for TypeScript (#11308)
* Add Numeric Separator Support for TypeScript

* Check for number in render
2020-03-23 17:41:35 -05:00
Dulmandakh
d3fb262958
remove mkdirp, bump fs-extra to 9.0.0 (#11251)
* bump mkdirp to 1.0.3, which support promise

* fix mkdirp in spr-cache.ts

* bump fs-extra to 9.0.0

* remove mkdirp
2020-03-21 17:02:05 +01:00
Sebastian Benz
4b1ce16e12
upgrade @ampproject/toolbox-optimizer to 2.0.1 (#11168)
Fixes #11159
2020-03-18 14:20:29 +01:00
JJ Kasper
203f43c1fe
Add error when attempting to export GSSP page (#11154)
* Add error when attempting to export GSSP page

* Update errors/gssp-export.md

* Update errors/gssp-export.md

* Update errors/gssp-export.md

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2020-03-18 09:33:10 +01:00
Kaito Sugimoto
4cac93a75e
Update @next/bundle-analyzer dependencies (#11068)
* Update @next/bundle-analyzer

* update module

* Update yarn.lock
2020-03-15 12:24:07 +01:00
Joe Haddad
1e53a4961a
Correctly Count Object References (#10903)
* Correctly Count Object References

* Make error message better

* add more tests
2020-03-09 14:58:51 -04:00
Tim Neutkens
1a47dbea69
Upgrade webpack (#10895)
Fixes #10890
2020-03-09 13:11:06 +01:00
Prateek Bhatnagar
16672a4353
Adding conformance checks (#10314)
* adding tests  for rect sync conformance check

* adding test for react sync script conformance check

* reverting yarn lock changes

* adding duplicate polyfill conformance

* bug fixes in dulpicate polyfill conformance check

* adding settings capability to conformance plugin

* removing minification check from server build

* bug fix

* settings for react sync script check
2020-03-02 22:53:18 +01:00
Janicklas Ralph
7848615bd6
Fix url-polyfill dep and re-enable native-url (#10726)
* Adding native-url package

* Bumping native-url version

* Upgrading native-url

* Logging stats object for debugging

* Logging stats object for debugging

* Adding try catch to the error lines

* Experimenting with regex

* Experimenting with regex

* Experimenting with regex

* Testing regex changes

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

* Meging changes with existing polyfill work

* Bumping version

* adjust webpack config

* Reduce size in size test

* Remove 1kb from legacy

* Bumping native-url version, includes fix for IE11

* Update lock file

* Updating native-url, fixes issue on IE11

* Fix sourcemap being added in document

* Adding Router as an app level dep. Fixes Router not being added as a dep to pages without Link when granularChunks is enabled

* Fix typescript error

* Fix modern + granularChunks hydration failing

* Fix TS error

* Update native-url version

* Adding native-url with safari fix

* Update url-polyfill in polyfill-nomodule package

* Remove url-polyfill from next package.json

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-02-27 22:08:58 -05:00
Joe Haddad
40217b75b9
Revert "Re-Enable Native url Module (#10530)" (#10623)
This reverts commit b329f6a2d6.
2020-02-21 01:16:07 -05:00
Janicklas Ralph
b329f6a2d6
Re-Enable Native url Module (#10530)
* Adding native-url package

* Bumping native-url version

* Upgrading native-url

* Logging stats object for debugging

* Logging stats object for debugging

* Adding try catch to the error lines

* Experimenting with regex

* Experimenting with regex

* Experimenting with regex

* Testing regex changes

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

* Meging changes with existing polyfill work

* Bumping version

* adjust webpack config

* Reduce size in size test

* Remove 1kb from legacy

* Bumping native-url version, includes fix for IE11

* Update lock file

* Updating native-url, fixes issue on IE11

* Fix sourcemap being added in document

* Adding Router as an app level dep. Fixes Router not being added as a dep to pages without Link when granularChunks is enabled

* Fix typescript error

* Fix modern + granularChunks hydration failing

* Fix TS error

* Update native-url version

* Adding native-url with safari fix

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-02-21 00:25:49 -05:00
JJ Kasper
00855de60a
Add navigation test specific for Safari 10 (#10616)
* Add testing in Safari 10.1 on merge

* Add nav test specific for Safari 10
2020-02-20 13:35:28 -05:00
Joe Haddad
d7167e28e0
Fix AMP Validator Version (#10600) 2020-02-19 13:18:17 -05:00
Joe Haddad
c58f45f42d
Add Failing CSS Test Case (#10590)
* Add Failing CSS Test Case

* update tests
2020-02-19 08:46:58 -05:00
Jason Robinson
56a45f061a
Bump amphtml-validator to 1.0.30 (#10588) 2020-02-19 13:34:44 +01:00
JJ Kasper
9e8f173319
Update to latest watchpack with dynamic route rename fix (#10351)
* Fix dynamic route rename failing for case change

* Update normalizing curPageFiles

* Remove using webpacks file info since its inaccurate

* Revert changes in favor of fixing upstream

* Update to latest watchpack with case rename fix
2020-02-19 11:05:59 +01:00
Tim Neutkens
0222a09cd0
Enable polyfillsOptimization (#10574)
* Enable polyfillsOptimization

* Update sizes

* Commons is no longer there

* Update test
2020-02-18 19:26:55 +01:00
Sebastian Benz
ae9b13e0be
Migrate to AMP Optimizer 2.0 (#10535)
* Migrate to AMP Optimizer 2.0

Most notable changes:

* Automatically import all missing AMP component scripts.
* Automatically add any missing mandatary AMP tags.
* 40% faster

I've updated the docs to mention component auto import and added a corresponding
test case.

* change validator tests which now pass validation

* Improve wording

Co-Authored-By: JJ Kasper <jj@jjsweb.site>

* Update adding-amp-components.md

Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-02-14 16:01:43 -05:00
Joe Haddad
71019e70d3
Remove native-url Again (#10526)
* Remove `native-url` Again

* update comment

* update sizes
2020-02-13 17:54:25 -05:00
Joe Haddad
3cb3498324
SSG Preview Mode (#10459)
* checkpoint: api impl

* Add support for tryGetPreviewData

* snapshot: server(less) support

* Add X-Prerender-Bypass-Mode header support

* Pass preview data to getStaticProps call

* add TODO

* setPreviewData

* 100k iterations

* Handle jwt error

* Write out preview values

* forgot file

* set preview props

* Send preview props

* add preview props

* Pass around more data

* update yarn lock

* Fail on Invalid Prerender Manifest

* Make Missing Prerender Manifest Fatal

* fix ts errors

* fix test

* Fix setting cookies + maxage

* Secure is not needed as we encrypt necessary data

* Set on domain root

* Set cookie max ages

* Render a fallback on-demand for non-dynamic pages

* Test preview mode

* remove old build

* remove snapshots

* Add serverless tests

* use afterAll

* Remove object assigns

* fix cookie spread

* add comment
2020-02-11 20:16:42 -05:00
Jan Potoms
5e4850ceee
Remove unused dependency @types/babel-types (#10448)
`@types/babel-types` doesn't seem to be in use anymore. `babel-types` is not used anywhere and `@babel/types` has its own typings included.
2020-02-07 11:13:59 +01:00
JJ Kasper
5ae7fe534e
De-dupe paths returned in getStaticPaths (#10423)
* De-dupe paths returned in getStaticPaths

* Remove warning
2020-02-04 21:55:11 -05:00
Joe Haddad
ecd628b7e0
Re-enable native-url (#10419)
* Re-enable `native-url`

* update sizes
2020-02-04 14:58:22 -05:00
JJ Kasper
e3d298dc62
Add support for rewriting to external resources (#10041)
* Add support for rewriting to external resources

* Update rewrite proxying test

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-02-04 14:08:03 -05:00
Tim Neutkens
e35005c214
[Experimental] Nomodule polyfills chunk (#10212)
* Polyfill Promise in polyfills chunk

* Override promise polyfill to use built-in

* Update sizes

* Update polyfills

* Test

* Add dep

* Use iife

* Unscope

* Revert "Unscope"

This reverts commit ab26bcefd551c544d5b3c577b7ce91e5ecfb9bb9.

* trigger

* Remove unused code

* Set helpers to true

* Update yarn.lock

* Fix test

* Update polyfills size

* Add comment

* Add back comment

* Put polyfills optimization under experimental flag

* Fix filename

* bring back promise for backwards compat until experimental feature is landed

* fix resolve alias check

* correct loader

* fix logic branches

* adjust !!

* adjust cache key

* Conditionally branch polyfill

* fix promise polyfill branching

* Re-add runtime

* fix base object

* fix yarn lock

* Add cache key

* correctly set caller

* add basic test

* Increment h=>i

* increment to j just in case

Co-authored-by: Joe Haddad <timer150@gmail.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-01-30 01:04:29 -05:00
James Mosier
c9dc17b852 Added support for BigInt to API routes (#10215)
* Added support for bigint to API routes

Closes #7980

* added BigInt test to get result

Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-01-27 08:19:49 -05:00
Prateek Bhatnagar
0edd6a031a Adding conformance webpack plugin (#9716)
* adding Conformance Plugin behind a flag

* fixing compiler ts error

* fixing spelling errors 🤦🏻‍♂️

* addressing comments

* bug fix

* making it const enum

* reverting const enum

Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-01-23 16:09:12 -05:00
Alexander Dreith
8449ebc221 [Experimental] Add built-in Sass support (#10133)
* Add built-in Sass support

* Add copy of CSS tests for SCSS

* Fix failing tests

* Fix url-loader tests

* Remove css file generated by tests

* Fix nprogress import for css file

* Fix SCSS modules (still 2 tests that need investigating)

* Update documentation for Sass support

* Fix plain CSS import test

* Fix formatting with prettier fix

* Update test output to reflect scss usage

* Revert "Fix plain CSS import test"

This reverts commit 380319d9d0c4bfb19e28c210262ccd82d19f3556.

# Conflicts:
#	test/integration/scss-modules/test/index.test.js

* Update loader structure

* Resolve loaders before passing to compile function

* Remove dead filter  code

* Arrange loaders in order and push to array

* Fix loader order bug

* Fix global Sass loader and make module prepocessor optional

* Adjust Sass Modules Implementation

* Fix typo

* Adjust regexps

* Use regexes

* Simplify global setup

* Adjust comments

* fix regex

* Simplify identifier file

* Update Sass Instructions

* Remove unneeded fixtures

* Adjust global tests

* Remove wrapper

* Update source maps

* Flag scss behavior

* Fix css property value

* Update fixtures with Sass vars

* Turn on Scss support

* fix HMR test

* Fix snapshots

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-01-22 15:26:51 -05:00
Joe Haddad
a3f1d65eba
Fix ESLint Ignores and Extract Fn (#10205) 2020-01-22 09:32:51 -05:00
Joe Haddad
2e668e6b31
Remove native-url (#10176)
* Remove `native-url`

* Increase sizes
2020-01-20 14:47:42 -05:00
Joe Haddad
8686fca6a4
Fix Browserslist Integration for CSS (#9985)
* Fix Browserslist Loading

* Fix Browserslist Integration for CSS

* Add missing file
2020-01-07 16:59:58 -05:00
Joe Haddad
a50a0577d2 Fix Tests (#9963) 2020-01-06 10:43:26 -06:00
Tim Neutkens
1fd57d22d5
Remove experiment (#9945)
* Remove experiment

* Add back ssr-prepass for serverless test

* Update size as they both decreased

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-01-04 17:40:18 +01:00
Joe Haddad
fe1af7b38c
Update yarn.lock 2019-12-30 10:40:41 -05:00
Tim Neutkens
df97f2d93c
Update native-url for peerdep (#9882)
Fixes https://github.com/zeit/next.js/issues/9687#issuecomment-569632942
2019-12-30 11:30:50 +01:00
JJ Kasper
f89d55f10d Add selenium-webdriver and testing cross-browser in PRs (#9821)
* Migrate from wd to selenium-webdriver

* Add chaining for next-webdriver

* Re-add browserStackLocal global for teardown

* Add additional element methods

* Use freshWindow helper for chrome

* Add selenium-server

* Add cross-env for windows compat

* Fix single quote windows

* Update production preload tests

* Update preload tests count

* Update CircleCi for testing other browsers

* Update CI configs

* Update config

* Add browser.url command

* Add more methods

* Update xcode version

* Make sure to add chromedriver to path

* Add forceExit flag

* Update config

* Update config

* Disable safari

* Fix bug in test

* Add teardown logging

* Update jest teardown

* Move testing ie11 to Azure

* Update job names

* Remove force exiting on long teardown

* Update Azure config

* Re-add safari testing with BrowserStack

* Update config

* Update prefetch tests for ie11

* Update prefetch for safari and ids for ie11 testing

* trigger prefetching manually in ie
2019-12-26 15:01:22 -05:00
Joe Haddad
3013c539b4
Update yarn.lock 2019-12-26 13:02:10 -05:00
JJ Kasper
8267c8a6eb
Normalize RegEx source between node versions (#9749) 2019-12-14 11:25:55 -06:00
Joe Haddad
845dc0827d Compute Gzip Sizes of Files (#9745) 2019-12-14 00:39:59 -06:00
Joe Haddad
32cb5e105a Disable CSS Support When Manually Configured (#9735)
* Disable CSS Support When Manually Configured

* upgrade TS

* adjust yarn lock

* Remove another version of TypeScript

* Remove possibly leftover loader

* Revert "Remove possibly leftover loader"

This reverts commit 7ce2d1a8854f3d7a833867f8ac3be7923a6cb1d8.

* Update to use no-op loader
2019-12-13 14:23:28 -06:00
Joe Haddad
25ee71f3ca
Add CSS Resolve Test (#9724) 2019-12-12 10:51:38 -05:00
Joe Haddad
c593171db1
Add Tailwind and PurgeCSS Test (#9714) 2019-12-11 18:54:40 -05:00
Joe Haddad
179e627a36
Redesign PostCSS Configuration Loading (#9704)
* Redesign PostCSS Configuration Loading

* Test array configuration

* Test new configuration handling

* Remove unnecessary async
2019-12-11 11:51:10 -05:00
Joe Haddad
734989d836 [Experimental] CSS Module Support (#9686)
* CSS Module Support

* Fix Server-Side Render of CSS Modules

* Fix Jest Snapshots
https://github.com/facebook/jest/pull/8492

* Fix snapshots

* Add test for CSS module edit without remounting

* Add tests for dev and production style being applied

* Add missing TODOs

* Include/exclude should only be applied to issuer, not the CSS file itself

* Add CSS modules + node_modules tests

* Test that content is correct

* Create Multi Module Suite

* Add client-side navigation support for CSS

* Add tests for client-side nav

* Add some delays

* Try another fix

* Increase timeout to 3 minutes

* Fix test

* Give all unique directories
2019-12-11 11:46:12 +01:00
Joe Haddad
bc7fd2d80d Upgrade Jest (#9693) 2019-12-10 20:37:25 -06:00
Joe Haddad
9b6ea9d466 Refactor Webpack Configuration (#9651)
* WIP

* Move data experiment

* Do not throw away rules

* Remove test code

* Correct next data behavior

* Add support for async composing

* Remove unnecessary workaround

* Rename Field
2019-12-09 14:08:15 -06:00
Sayuti Daniel
26a6a37316 feat: optional chaining and nullish coalescing (#9615) 2019-12-08 12:46:44 +01:00
Natalie Marleny
14c553c932 Enhancement: Upgrade devalue version to 2.0.1 (#9611) 2019-12-03 16:25:51 -06:00
Joe Haddad
fcea1cd86e
Update yarn.lock 2019-12-03 14:14:34 -05:00
Joe Haddad
2477bd30b7 Upgrade Webpack and Terser (#9608)
Closes #9602
2019-12-03 10:35:31 -06:00
Joe Haddad
a6656a0b84
Upgrade path-to-regexp (#9553)
* Upgrade `path-to-regexp`

* Correct import

* Update delimiter

* Fix path match

* Fix hot loader

* Fix params.path usage and pathToRegexp import

* Revert changes for params.path

* Fix lint

* Simplify path match function

* Delimiter should always be `/`

* Fix passed in params

* Add new regex wrapping

* Wrap another route

* Fix error message match
2019-11-27 16:48:28 -05:00
JJ Kasper
f476960ccd Lint in parallel (#9560) 2019-11-27 14:26:40 -05:00
Janicklas Ralph
6517246b22 Native url (#9561)
* Adding native-url package

* Bumping native-url version

* Upgrading native-url

* Logging stats object for debugging

* Logging stats object for debugging

* Adding try catch to the error lines

* Experimenting with regex

* Experimenting with regex

* Experimenting with regex

* Testing regex changes

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

* Meging changes with existing polyfill work

* Bumping version

* adjust webpack config

* Reduce size in size test

* Remove 1kb from legacy

* Bumping native-url version, includes fix for IE11

* Update lock file

* Updating native-url, fixes issue on IE11
2019-11-27 13:17:05 -06:00
JJ Kasper
6ec56d3750 Update to latest fork-ts-checker version (#9555) 2019-11-27 11:16:55 -05:00
Janicklas Ralph
be496a260c Update native-url package for IE compat (#9539)
* Adding native-url package

* Bumping native-url version

* Upgrading native-url

* Logging stats object for debugging

* Logging stats object for debugging

* Adding try catch to the error lines

* Experimenting with regex

* Experimenting with regex

* Experimenting with regex

* Testing regex changes

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

* Meging changes with existing polyfill work

* Bumping version

* adjust webpack config

* Reduce size in size test

* Remove 1kb from legacy

* Bumping native-url version, includes fix for IE11

* Update lock file
2019-11-26 14:14:24 -05:00
Joe Haddad
5030bda9c2
Update Yarn Lockfile 2019-11-26 07:43:27 -05:00
Janicklas Ralph
04a7f1e85d Replace url polyfill with self.URL (#9200)
* Adding native-url package

* Bumping native-url version

* Upgrading native-url

* Logging stats object for debugging

* Logging stats object for debugging

* Adding try catch to the error lines

* Experimenting with regex

* Experimenting with regex

* Experimenting with regex

* Testing regex changes

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

* Meging changes with existing polyfill work

* Bumping version

* adjust webpack config

* Reduce size in size test

* Remove 1kb from legacy
2019-11-25 23:10:02 -05:00
JJ Kasper
12cbb2e95a
Add custom timings for CircleCi (#9523)
* Add custom timings for CircleCi

* Re-add split-by flag

* Add testcase item to junit.xml

* Log tests being run

* Update junit.xml path

* bump
2019-11-25 16:50:46 -06:00
Joe Haddad
4656f52d15
CSS Support Customization (#9502)
* CSS Support Customization

* Sort imports

* Correct PostCSS plugin loading

* Add css customization test

* Test "bad" css configuration

* Add load config test

* adjust spacing

* adjust spacing 2x

* Only allow config through JSON

* Support excluding false plugins

* Test tailwind css behavior

* Test plugin exclusion

* Fix unit test

* Fix config file

* Remove more variants

* Update test cases
2019-11-25 16:52:29 -05:00
Joe Haddad
61f4e70135
Upgrade Babel Dependencies (#9478)
* Upgrade Babel Dependencies

* Update test for new size
2019-11-20 21:53:12 -05:00
Maël Nison
213c243c18 Adds missing dependency (#9453)
* Adds missing dependency

* Update package.json

* Update yarn.lock
2019-11-19 00:13:25 -05:00
Joe Haddad
f3b376fae5
Upgrade TypeScript version (#9417) 2019-11-14 22:32:50 -08:00
Joe Haddad
00badd4d58
Initialize Git repo on app creation (#9376)
* Initialize Git repo on app creation
This PR initializes a Git repository after Create Next App runs.

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

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

Closes #9077 (replaces)

* Add test

* Update index.test.js
2019-11-10 21:42:51 -08:00
Joe Haddad
18a9c7e371
Improve linting rules to catch more errors (#9374)
* Update `packages/`

* Update examples

* Update tests

* Update bench

* Update top level files

* Fix build

* trigger
2019-11-10 19:24:53 -08:00
JJ Kasper
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
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
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
JJ Kasper
cbb846bed6 Update default chromedriver version (#9252) 2019-10-30 12:51:36 -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
Joe Haddad
6b54e9ed66 Fix Prettier Commit Hook (#9245)
* Apply format to webpack config

* hit all files
2019-10-30 12:35:51 +01:00
Joe Haddad
34e0ce6f05
Remove react-ssr-prepass from Next Deps (#9224) 2019-10-28 06:49:07 -07: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
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
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
Gerald Monaco
d28e46ac15 Support Concurrent Mode in Loadable (#9026) 2019-10-18 17:23:06 +02: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
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
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
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
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
JJ Kasper
ba07cc6237 Revert "Add hard retrying for Azure test runs (#8761)" (#8772)
This reverts commit 664cd3fa04.
2019-09-17 19:01:46 +02:00
JJ Kasper
664cd3fa04 Add hard retrying for Azure test runs (#8761)
* Test killing proceses before retrying on Azure

* catch error while killing process
2019-09-17 12:17:34 -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
7b933f675a Optimize test setup (#8644)
* Tweak test set-up

* Update azure config

* Add cleaning test files and windows handling

* Limit windows test to one at a time

* Tweak test settings

* Update tests splitting

* remove custom concurrency for azure

* Test Azure var

* Update Azure config

* bump

* Simplify cleaning up
2019-09-10 13:11:55 -04: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
JJ Kasper
110c83fa44 Update commons glob for granular chunks (#8622) 2019-09-05 00:48:09 +02: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
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
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
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
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
Joe Haddad
df4f600291
🗜 Optimize client-side routing manifest (#8429)
* Optimize client-side routing manifest

* Turn on granularChunks for tests

* Add row for build manifest

* Hack it
2019-08-20 02:28:09 -04:00