Commit graph

259 commits

Author SHA1 Message Date
Tim Neutkens
6feca310d7
Revert ncc webpack (#7370)
* Revert "Add retrying to CircleCi and fixes for ncc'ed webpack (#7366)"

This reverts commit 5beb365d12.

* Revert "ncc Webpack build (#7301)"

This reverts commit bd8f3c625f.

# Conflicts:
#	packages/next/package.json
2019-05-17 13:25:46 +02:00
Guy Bedford
bd8f3c625f
ncc Webpack build (#7301)
* add back ncc

* fixup ncc build
2019-05-16 11:55:54 -05:00
Lukáš Huvar
fedfbd9d5c Experimental API support (#7296)
* First basic API support

* Change require functionality

* Change 501 to 404

* Change wording

* Fix test
2019-05-11 13:18:56 +02:00
JJ Kasper
0eab07b7e8
Add automatic TypeScript setup (#7125)
* replace fkill with tree-kill
2019-05-08 21:51:23 -05:00
Joe Haddad
9f4904ff10 Integrate type checking into compilation pipeline (#7278) 2019-05-07 20:11:56 -05:00
JJ Kasper
41c6d92d25 Revert migrating babel-loader into Next.js (#7265)
clearing of stale babel cache
2019-05-07 14:24:47 +02:00
JJ Kasper
cd4e2a2214 Update to latest version of browserstack-local (#7236) 2019-05-06 15:16:21 +02:00
Cory Sherman
e2535575d2 update webpack to 4.30.0 (#7238)
* update webpack to 4.30.0

* update yarn.lock for webpack 4.30.0
2019-05-04 14:11:41 +02:00
JJ Kasper
8b92b8b7ce Clear stale files from Next.js' babel-loader cache (#7221)
* Move babel-loader into next all the way converting
it to TypeScript and added tracking of babel-loader
cache so we can clear previous files

* Add license from babel-loader

* Apply suggestions from code review

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

* Make sure to catch errors in next-babel-loader
2019-05-02 16:30:41 -04:00
JJ Kasper
ceb60b650a
revert nccing webpack (#7189) 2019-04-28 15:35:40 -05:00
Connor Davis
f66546f950
Use ncc to bundle webpack (#6347) 2019-04-26 17:24:30 -05:00
Sebastian Benz
7a16379435 Upgrade amp-optimizer to 0.5.3 (#7134) 2019-04-24 08:46:16 -05:00
Luis Fernando Alvarez D
08a6066681 Replace the typescript compiler with @babel/preset-typescript (#7016)
* Added babel typescript for the core files

* Add __NEXT_VERSION

* Added noop.js to the babel taskfile

* Only include dynamic-import-node for the bin task

* Added babel-plugin-dynamic-import-node

* Use loose option to prevent Object.defineProperty

* Enable loose in preset and enable compact mode

* Disable compact and loose to compare

* Re-enable compact and loose
2019-04-23 09:05:49 +02:00
Luis Fernando Alvarez D
29f71bfcba Add more TypeScript types (#7054)
* Moved server/lib/utils.js to Typescript

* moved _app.js to Typescript

* Moved _error.js to Typescript

* Added argument for custom props in _app and _error

* Moved _document.js to Typescript

* updated one test

* Updated types and added a validation for _document props

* Improved types

* Fixed some types

* Updated AppType

* Fixed some tests

* Added missing import

* Removed a not very useful type

* Fix missing type

* Move @types/styled-jsx

* Fix typescript errors
2019-04-22 19:55:03 +02:00
Joe Haddad
f5be84e4ff Upgrade Terser (#6981)
The new version of Terser seems to be significantly slower than the previous.  I wanted to see what our stats PR says.
2019-04-22 06:03:57 +09:00
Luis Fernando Alvarez D
08937807f6 Remove dynamic-import-node from the preset (#7096)
Related to [this spectrum post](https://spectrum.chat/next-js/general/next-8-minor-update-breaks-dynamic-import-in-jest-tests~1e7b58e7-e301-4ef9-9de4-eef6ed3639d4).

I'm not removing the `babel-plugin-dynamic-import-node` package as it's going to be used by #7016
2019-04-22 05:25:48 +09:00
Joe Haddad
74cb4f4b7b
Switch to using .next/cache for flying shuttle and terser (#7013) 2019-04-11 17:09:12 -04:00
Joe Haddad
510815a7ac
Add Flying Shuttle tests (#7000)
* Add Flying Shuttle tests

* Test second version of server

* Finish first version of tests

* Apply suggestions from code review

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

* Apply suggestions from code review

Co-Authored-By: Timer <timer150@gmail.com>
2019-04-10 17:08:19 -04:00
JJ Kasper
711d45b698 Use next.config env and packages to calculate hashes (#7001)
* Use next.config env and packages to calculate
hashes for chunk-graph

* Remove example from testing

* remove left over import

* Tweak behavior
2019-04-10 15:19:50 -04:00
Joe Haddad
c2d0a4ef0e
Add Flying Shuttle v1 (#6991)
* Add Flying Shuttle v1

* Add serverless file restoration

* Add another message

* Update test

* Resolve page version last

* Print number of changed pages

* Remove old tests

* Re-add head build ID writing

* Change syntax appearance

* Start adding test components

* Fix react loadable manifest

* Complicate dynamic testing

* Fix first build missing head build id

* Remove flying shuttle tests
2019-04-10 12:41:59 -04:00
Luis Fernando Alvarez D
ae5eeb39f4 Brought escape-string-regexp source to next (#6979)
* Brought escape-string-regexp source to next

* Added Copyright comment
2019-04-09 15:06:55 -04:00
Luis Fernando Alvarez D
f89bd8237b Replace imurmurhash with string-hash (#6964)
Closes #6939
2019-04-09 12:49:30 +02:00
Joe Haddad
b586dbf5ef
Upgrade Async to Promises (#6958) 2019-04-08 11:00:01 -04:00
Tim Neutkens
84bb620bef
Temporarily only do one pass (#6900)
* Temporarily only do one pass

* Add types
2019-04-05 12:32:00 +02:00
Joe Haddad
e7ca6aa45e
Correctly compute unknown module ids (#6898) 2019-04-04 20:41:07 -04:00
Joe Haddad
19c635175b
Make Client request BUILD_ID from the Server (#6891)
* Generate two versions of pages

* Add code VSCode deleted

* Add dynamicBuildId option to __NEXT_DATA__

* Reduce amount of diff

* Make getPageFile code easier to read

* Minimize diff

* minimize diff

* Fix default value for dynamicBuildId

* Fix weird bug

* Fetch the head build id on client

* Move __selectivePageBuilding

* Add tests

* Remove _this

* Add console warning
2019-04-04 17:54:01 -04:00
Tim Neutkens
8d73af8232 Upgrade amp-toolbox-optimizer (#6890) 2019-04-04 09:45:43 -04:00
JJ Kasper
3d76c9f9bf
Update to latest version of amp-toolbox-optimizer (#6885) 2019-04-03 18:18:09 -05:00
JJ Kasper
6344c5f0c1
Add optimizing AMP pages (#6835)
* Added amp-toolbox-optimizer and added
optimizing AMP pages as dirty and clean

* Fix amp-optimizer breaking serverless build

* Exclude amp-toolbox-optimizer from serverless build

* Added check to make sure hybrid AMP pages
optimize cleanly during export

* Add check to make sure noDirtyAmp is applied
2019-04-02 13:01:34 -05:00
Tim Neutkens
b1fdffec75
amp-bind data injection (#6840) 2019-04-02 16:09:34 +02:00
Luis Fernando Alvarez D
84fbd4b594 added async-to-promises transform (#6797)
Replaced regenerator with async-to-promises
2019-04-02 15:42:09 +02:00
Luis Fernando Alvarez D
f81e5f4cad Added babel-plugin-dynamic-import-node (#6811)
Replaces `import()` with `require` only for the testing environment.
2019-03-30 01:50:24 +01:00
JJ Kasper
533018f7d0 Update tests for BrowserStack (#6810)
Update tests to setup webdriver stuff in `jest-environment` and re-use one browser session instead of spawning one for each webdriver call to prevent creating too many BrowserStack sessions.
2019-03-29 16:05:53 +01:00
Alexander Nanberg
20768ff372 Upgrade unfetch to v4.1.0 (#6807)
`unfetch` ^4.0.0 is already used by `isomorphic-unfetch` so this simplifies the dependency tree a tiny bit.

Release notes
https://github.com/developit/unfetch/releases/tag/4.0.0
https://github.com/developit/unfetch/releases/tag/4.1.0
2019-03-27 19:56:46 +01:00
Connor Davis
a79c004de0 Remove magic-string (#6772)
* Remove magic-string

* Add back input

* change if statement back

* Fix typo

* remomve useless import
2019-03-24 23:50:58 -04:00
Tim Neutkens
3e7b932b2b
ncc resolve and arg (#6771)
More modules to follow.
2019-03-24 23:38:03 +01:00
Tim Neutkens
eb28d4cdcf
Remove hoist-non-react-statics from with-router (#6765)
* Remove hoist-non-react-statics from with-router

* Drop hoist-non-react-statics from package.json
2019-03-23 21:31:44 +01:00
JJ Kasper
7d0919a784 Break up basic test suite (#6730)
* Break out client-navigation and rendering
test from basic test

* Try with parallelism dialed back to 3

* Update jest-junit for more compatible timings in CircleCI

* Bump to test timings

* Use filepath for suitename in jest-junit

* Store reports as artifacts

* Try using classname for timings

* Bump

* Remove reports from artifacts
2019-03-20 11:01:32 +01:00
Joe Haddad
ff5c8465de
First pass of runtime amp validator (#6708) 2019-03-18 19:21:18 -04:00
Joe Haddad
e5636dcdb0
Inject the build ID after webpack runs (#6618)
* Inject the build ID after webpack runs

* add webpack sources types

* use webpack plugin instead

* reset file

* Skip source maps if none were provided

Co-Authored-By: Timer <timer150@gmail.com>
2019-03-12 16:39:44 -04:00
JJ Kasper
995460d7dd
Replace md4 hashing with murmurhash (#6611) 2019-03-11 16:23:04 -05:00
Tim Neutkens
dd60199cec
Remove case-sensitive-paths-plugin (#6587)
While this is a nice feature it does filesystem operations to check if the resolved file matches the filesystem.
2019-03-10 01:44:51 +01:00
JJ Kasper
ff7299d184 Update react-error-overlay and use reportRuntimeError (#6577)
Fixes: #5481
2019-03-08 16:24:15 +01:00
JJ Kasper
a3356c5edb Try restarting chromedriver on timeout (#6566)
Also added `HEADLESS` env var for local testing
2019-03-08 10:23:57 +01:00
Tim Neutkens
9b62f208bb
Remove cacheKeys option and improve filtering (#6559)
More cleanup of terser-plugin.
2019-03-07 14:28:32 +01:00
Connor Davis
861edad459 Implement Recursive Delete (#6489)
Removes `rimraf` for a smaller custom lib

Benchmarks (in ms):
```
rimraf 1
518.536376
rimraf 2
416.112451
rimraf 3
451.905842
rimraf 4
525.117395
rimraf 5
434.230384
---- Average: 469.18ms
-----------
recursive delete 1
121.493979
recursive delete 2
130.335272
recursive delete 3
149.798316
recursive delete 4
182.184688
recursive delete 5
130.346207
--- Average: 142.83ms
```
`recursiveDelete` finishes in ~30% of the time it takes `rimraf` (3.3 times faster)
2019-03-05 14:01:42 +01:00
JJ Kasper
491f9a2c49 Move next-mdx from zeit/next-plugins to zeit/next.js (#6443)
At request of @timneutkens I moved the `next-mdx` plugin from the next-plugins repo into Next.js. Also fixed small typo in README under setup.
2019-03-04 18:02:45 +01:00
Joe Haddad
436fc54212
Correct yarn.lock (#6503) 2019-03-01 13:59:30 -05:00
Connor Davis
7dc50f3867
Remove cross-spawn (#6450) 2019-02-26 14:57:32 -06:00
Connor Davis
5514949df0 Remove glob package (#6415)
We don't use a lot of the features of `glob`, so let's remove it in favor of a leaner approach using regex.

It's failing on windows and I have no idea why and don't own a windows machine 🤦🏼‍♂️

(Ignore some of the commits in here, I forgot to create the new branch before I started working)
2019-02-24 22:08:35 +01:00