Commit graph

3098 commits

Author SHA1 Message Date
JJ Kasper
cedd9b03f5
v8.0.5-canary.34 2019-04-15 18:50:45 +09:00
JJ Kasper
a0473e1f2a
v8.0.5-canary.33 2019-04-12 21:18:11 -05:00
Joe Haddad
dd98bddfb6
v8.0.5-canary.32 2019-04-11 17:11:25 -04:00
Joe Haddad
74cb4f4b7b
Switch to using .next/cache for flying shuttle and terser (#7013) 2019-04-11 17:09:12 -04:00
JJ Kasper
c1eba49289
v8.0.5-canary.31 2019-04-11 14:05:35 -05:00
Joe Haddad
3add5380b6
v8.0.5-canary.30 2019-04-11 10:29:24 -04:00
Joe Haddad
b7091104b7
v8.0.5-canary.29 2019-04-10 23:50:44 -04:00
Joe Haddad
54e9454788
v8.0.5-canary.28 2019-04-10 17:08:51 -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
Joe Haddad
ef9c39e249
v8.0.5-canary.27 2019-04-09 15:22:45 -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
JJ Kasper
b72396f2a1
v8.0.5-canary.26 2019-04-09 11:03:25 -05:00
Luis Fernando Alvarez D
f89bd8237b Replace imurmurhash with string-hash (#6964)
Closes #6939
2019-04-09 12:49:30 +02:00
Joe Haddad
9e4636572d
v8.0.5-canary.25 2019-04-08 11:00:30 -04:00
Joe Haddad
b586dbf5ef
Upgrade Async to Promises (#6958) 2019-04-08 11:00:01 -04:00
Joe Haddad
62462fb18c
v8.0.5-canary.24 2019-04-08 10:46:12 -04:00
Tim Neutkens
c0e6918b8c v8.0.5-canary.23 2019-04-07 21:02:09 +02:00
Joe Haddad
91fd3a851d
v8.0.5-canary.22 2019-04-06 23:34:47 -04:00
Joe Haddad
a9648c447e
v8.0.5-canary.21 2019-04-06 22:26:32 -04:00
Joe Haddad
31dc4549de
v8.0.5-canary.20 2019-04-06 21:07:57 -04:00
Joe Haddad
54f21e984d
v8.0.5-canary.19 2019-04-06 16:23:48 -04:00
Joe Haddad
d404879071
v8.0.5-canary.18 2019-04-06 13:13:15 -04:00
Joe Haddad
96fe5afe51
v8.0.5-canary.17 2019-04-05 16:35:56 -04:00
JJ Kasper
54d5d7aae4
v8.0.5-canary.16 2019-04-05 14:44:50 -05:00
Tim Neutkens
c34dc14918 v8.0.5-canary.15 2019-04-05 12:36:14 +02: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
d2a994db3c
v8.0.5-canary.14 2019-04-05 00:29:37 -04:00
Joe Haddad
ed1207f78a
v8.0.5-canary.13 2019-04-04 22:00:18 -04:00
Joe Haddad
9ed4467618
v8.0.5-canary.12 2019-04-04 20:50:29 -04: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
JJ Kasper
9225eb822b
v8.0.5-canary.11 2019-04-04 16:48:57 -05:00
Connor Davis
6528d19417
v8.0.5-canary.10 2019-04-04 15:18:13 -05:00
JJ Kasper
1d45d84f72
v8.0.5-canary.9 2019-04-04 12:52:10 -05:00
Joe Haddad
6ac079f130
v8.0.5-canary.8 2019-04-03 19:44:20 -04:00
JJ Kasper
2b7fb7ce28
v8.0.5-canary.7 2019-04-03 18:19:16 -05:00
JJ Kasper
289f74c29e
v8.0.5-canary.6 2019-04-03 16:43:25 -05:00
JJ Kasper
565193314e
v8.0.5-canary.5 2019-04-03 15:25:13 -05:00
Tim Neutkens
3f3430919f v8.0.5-canary.4 2019-04-03 20:43:53 +02:00
Tim Neutkens
84ca9a7b10 v8.0.5-canary.3 2019-04-03 14:55:16 +02:00
Joe Haddad
4b44778b67
v8.0.5-canary.2 2019-04-02 21:48:18 -04:00
JJ Kasper
7c57d2f5e2
v8.0.5-canary.1 2019-04-02 18:53:51 -05:00
JJ Kasper
aac50e4501
Add error message for AMP bind syntax (#6865)
* Add error message for AMP bind syntax

* Fix custom AMP scripts getting dropped

* Add data.js to package.json to include it
in releases
2019-04-02 17:32:07 -05:00
JJ Kasper
355ded5c86
v8.0.5-canary.0 2019-04-02 13:44:39 -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
Joe Haddad
e6e4a15284
v8.0.4 2019-04-01 20:45:36 -04:00
JJ Kasper
3a7caa628a
v8.0.4-canary.31 2019-03-31 10:33:10 -05:00
JJ Kasper
41da136b14
v8.0.4-canary.30 2019-03-30 09:38:32 -05:00
Tim Neutkens
f6786b4140 v8.0.4-canary.29 2019-03-30 14:51:00 +01:00
Tim Neutkens
99023b97e0 v8.0.4-canary.28 2019-03-30 14:33:49 +01:00
Tim Neutkens
e48610ea68 v8.0.4-canary.27 2019-03-30 14:25:28 +01: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
Joe Haddad
4fd794e8ae
v8.0.4-canary.26 2019-03-27 15:22:03 -04: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
Joe Haddad
2efad5a2d8
v8.0.4-canary.25 2019-03-27 12:02:26 -04:00
JJ Kasper
96c628409a
v8.0.4-canary.24 2019-03-26 11:31:48 -05:00
Joe Haddad
1604862895
v8.0.4-canary.23 2019-03-25 12:18:42 -04:00
Tim Neutkens
7788849ad5 v8.0.4-canary.22 2019-03-25 15:09:01 +01:00
Tim Neutkens
24d8ec560f v8.0.4-canary.21 2019-03-25 13:01:14 +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
fa5125488b v8.0.4-canary.20 2019-03-24 14:34:44 +01:00
Tim Neutkens
a8d08d3920
ncc nanoid (#6768) 2019-03-24 14:21:30 +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
Joe Haddad
efdbd87625
v8.0.4-canary.19 2019-03-21 22:47:57 -04:00
Joe Haddad
34be001749
v8.0.4-canary.18 2019-03-20 16:06:57 -04:00
JJ Kasper
19f39511f4
v8.0.4-canary.17 2019-03-20 13:24:02 -05:00
Joe Haddad
773a3a21c5 v8.0.4-canary.16 2019-03-20 11:43:07 -04:00
Joe Haddad
b5880717e6
v8.0.4-canary.15 2019-03-20 09:21:21 -04:00
Joe Haddad
2cd0e99af4
v8.0.4-canary.14 2019-03-19 15:49:37 -04:00
JJ Kasper
2cc8365d82
v8.0.4-canary.13 2019-03-19 10:16:06 -05:00
Joe Haddad
ff5c8465de
First pass of runtime amp validator (#6708) 2019-03-18 19:21:18 -04:00
Tim Neutkens
ad856eb299 v8.0.4-canary.12 2019-03-18 13:30:22 +01:00
Joe Haddad
d5f736d623
v8.0.4-canary.11 2019-03-15 10:54:23 -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
b6dfb44a8f
v8.0.4-canary.10 2019-03-12 01:27:01 -05:00
JJ Kasper
995460d7dd
Replace md4 hashing with murmurhash (#6611) 2019-03-11 16:23:04 -05:00
JJ Kasper
eb0e83cea3 Remove cacache (#6610) 2019-03-11 16:24:07 -04: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
Tim Neutkens
654860e7b5 v8.0.4-canary.9 2019-03-07 19:57:48 +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
Tim Neutkens
f177ce4291 v8.0.4-canary.8 2019-03-06 13:10:21 +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
Tim Neutkens
8f25bc6871 v8.0.4-canary.7 2019-03-03 20:47:05 +01:00
Anton Egorov
5db0bef98e update webpack-dev-middleware to fix querystring in file names (#6498)
Fixes #6481
2019-03-01 17:28:09 +01:00
Joe Haddad
a8d7a6ce42 v8.0.4-canary.6 2019-02-28 15:38:12 -05:00
Joe Haddad
68123d8b8d v8.0.4-canary.5 2019-02-28 14:35:21 -05:00
Joe Haddad
41eaa9cf5a
Run ncc on unistore to fix install warning (#6459)
ncc unistore to fix install warning
2019-02-27 09:12:40 -05:00
Tim Neutkens
88388f79b4 v8.0.4-canary.4 2019-02-27 13:20:30 +01:00
Connor Davis
b8d3b7e69e
v8.0.4-canary.3 2019-02-26 16:07:42 -06:00
Connor Davis
7dc50f3867
Remove cross-spawn (#6450) 2019-02-26 14:57:32 -06:00
Joe Haddad
6ffc2ffc2a v8.0.4-canary.2 2019-02-25 17:55:33 -05: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
Tim Neutkens
f7ee137f9c v8.0.4-canary.1 2019-02-23 12:25:34 +01:00
Tim Neutkens
297f1a3fc0 Remove event-source-polyfill dependency 2019-02-23 11:51:54 +01:00
Tim Neutkens
41ed6803ac v8.0.4-canary.0 2019-02-23 11:21:29 +01:00
Connor Davis
b146eb5200
Replace del with rimraf package (#6411) 2019-02-22 13:49:30 -06:00
Tim Neutkens
bfb5224ce4
Remove schema-utils dependency (#6413) 2019-02-22 20:05:34 +01:00
Tim Neutkens
6d17a93b63
Upgrade async-sema (#6410) 2019-02-22 19:14:38 +01:00
Connor Davis
597c7d447a Add taskfile for ncc (#6409)
* Add ncc taskfile

* Add ncc dep and pass options

* dev dep
2019-02-22 17:33:53 +01:00
Tim Neutkens
e60a7cf529
Remove mkdirp-then in favor of promisify (#6408) 2019-02-22 17:33:28 +01:00
Tim Neutkens
9247c90177
Remove http-status dependency (#6405) 2019-02-22 16:25:11 +01:00
Tim Neutkens
a99323cbc0 v8.0.3 2019-02-22 13:35:24 +01:00
Tim Neutkens
ca7b77292b v8.0.3-canary.0 2019-02-22 10:39:39 +01:00
Tim Neutkens
299eeb4f4f Merge branch 'master' into canary 2019-02-22 10:37:20 +01:00
Tim Neutkens
016d41f2a8 v8.0.2 2019-02-22 00:17:13 +01:00
Tim Neutkens
d14d1704cb
Remove ansi-html dep (#6394)
It's not needed since we use react-error-overlay for webpack errors.
2019-02-22 00:12:47 +01:00
Tim Neutkens
ce7dcaeadb v8.0.2-canary.7 2019-02-21 15:43:00 +01:00
Joe Haddad
1757ad022c Drop cli-cursor dependency (#6387) 2019-02-21 15:34:35 +01:00
Tim Neutkens
faf69b45c2 v8.0.2-canary.6 2019-02-21 01:09:43 +01:00
Joe Haddad
8b784766f1 Remove alternate screen usage (#6377)
* Make console output well behaved

* Fix bad rebase
2019-02-21 00:42:27 +01:00
Connor Davis
61de215e04
Move webpack config to TypeScript (#6348) 2019-02-20 13:24:02 -06:00
Tim Neutkens
0bf5041ef4 v8.0.2-canary.5 2019-02-20 17:05:55 +01:00
Tim Neutkens
b0a9b99b7f v8.0.2-canary.4 2019-02-20 13:30:27 +01:00
Joe Haddad
90f9c64b74
Use alternate screen buffer if terminal supports it (#6364) 2019-02-20 07:20:09 -05:00
JJ Kasper
bf69357f27 Remove onDemandEntries WebSocket server in favor of EventSource connection (#6354)
After talking with @timneutkens it was decided it'd be more streamlined to replace the onDemandEntries WebSocket with an alternative. Using the EventSource connection gives us these benefits over the WebSocket one:

- less code needed
- no extra server running
- no extra config for onDemandEntries
2019-02-19 21:58:47 +01:00
Tim Neutkens
9f2eb85de3 v8.0.2-canary.3 2019-02-17 20:48:43 +01:00
Tim Neutkens
774af7fa0b v8.0.2-canary.2 2019-02-17 13:15:42 +01:00
Tim Neutkens
3882979236 v8.0.2-canary.1 2019-02-16 17:12:27 +01:00
Joe Haddad
56b1f81ace Fix development mode output (#6312)
* Remove usage of WebpackBar and Friendly Errors

* Add new clearConsole helper

* Add new simplified output for development mode

* Add an explicit bootstrapping mode

* Add missing returns

* Use existing output style

* Adjust first output to say Waiting on

* Only print URL if present
2019-02-16 17:09:49 +01:00
Tim Neutkens
036f5bf11b v8.0.2-canary.0 2019-02-16 16:41:30 +01:00
Tim Neutkens
708c537fc6 Merge branch 'master' into canary 2019-02-16 16:38:42 +01:00
Tim Neutkens
4051ffcb01 [experimental] Rendering to AMP (#6218)
* Add initial AMP implementation

* Implement experimental feature flag

* Implement feedback from sbenz

* Add next/amp and `useAmp` hook

* Use /:path*/amp instead

* Add canonical

* Add amphtml tag

* Add ampEnabled for rel=“amphtml”

* Remove extra type
2019-02-14 10:22:57 -05:00
Tim Neutkens
7fd9cb440d v8.0.1 2019-02-13 09:31:49 +01:00
Tim Neutkens
77a5a6f91a v8.0.1-canary.0 2019-02-13 07:20:54 +01:00
Tim Neutkens
e4f96e65d3 v8.0.0 2019-02-11 09:02:37 +01:00
Tim Neutkens
8ddf9c7f27 v8.0.0-canary.23 2019-02-11 08:28:49 +01:00
Tim Neutkens
100b733960 v8.0.0-canary.22 2019-02-11 08:17:22 +01:00
Giuseppe
ac0976affe Update styled-jsx (#6236)
Changelog https://github.com/zeit/styled-jsx/releases/tag/v3.2.1
2019-02-10 22:19:38 +01:00
Tim Neutkens
bfd2d08ff2 v8.0.0-canary.21 2019-02-10 05:10:24 +01:00
Tim Neutkens
2ecb2489ce v8.0.0-canary.20 2019-02-10 04:56:14 +01:00
Tim Neutkens
45f5663558
Bring in terser-webpack-plugin (#6231)
* Bring in terser-webpack-plugin

* Ignore terser from linting
2019-02-10 04:55:09 +01:00
Tim Neutkens
c0701e948f v8.0.0-canary.19 2019-02-08 16:04:44 +01:00
Konstantin Grushetsky
2f304bd10e Remove 'acorn' dependency (#6193) 2019-02-03 14:36:29 +01:00
Tim Neutkens
b2b2041e39 v8.0.0-canary.18 2019-02-01 13:23:56 +00:00
Tim Neutkens
0e21615245 v8.0.0-canary.17 2019-01-27 22:03:13 +01:00
Tim Neutkens
136c37eca9 v8.0.0-canary.16 2019-01-27 17:20:24 +01:00
Tim Neutkens
b3045cc7a9
Implement circular JSON err.sh link (#6149)
* Implement circular JSON err.sh link

* Add test for getInitialProps returning circular json

* Make test warn less

* Fix tests

* Add reference to original tests
2019-01-27 16:12:17 +01:00
Connor Davis
e46fdd6546 Add arcorn to fix webpack/npm bug (#6137) 2019-01-26 02:28:44 +01:00
Tim Neutkens
f05d339dcf v8.0.0-canary.15 2019-01-26 02:02:48 +01:00
Tim Neutkens
024323b6d8 v8.0.0-canary.14 2019-01-25 19:14:11 +01:00
Connor Davis
97bf2679aa
v8.0.0-canary.13 2019-01-24 16:27:05 -06:00
Tim Neutkens
1191843e17 v8.0.0-canary.12 2019-01-24 10:51:13 +01:00
Connor Davis
f28833c594 Upgrade Webpack to 4.29.0 with FutureEmitAssets for Massive Memory Optimizations (#6114)
We want our new memory optimizations (https://github.com/webpack/webpack/pull/8609)
2019-01-24 10:25:58 +01:00
Tim Neutkens
c5d5148bad v8.0.0-canary.11 2019-01-22 13:12:50 +01:00
Connor Davis
43b0b95e1d
v8.0.0-canary.10 2019-01-21 09:13:26 -06:00
Tim Neutkens
862e0a39b9 Update package.json description 2019-01-21 13:46:01 +01:00
Tim Neutkens
0949b4dd1a Make lerna always use exact version when updating packages 2019-01-21 12:20:05 +01:00
Tim Neutkens
0714300b8c v8.0.0-canary.9 2019-01-19 13:40:53 +01:00
Tim Neutkens
bbc346869e
Remove Typescript helpers in favor of babel helpers (#6087)
There's still a few Typescript helpers in use, but regenerator is added by Babel after this change, as it was already in the bundle it'll drop bundle sizes by quite a bit, eg _app.js becomes half the size.
2019-01-18 22:00:15 +01:00
Tim Neutkens
b52c416713 v8.0.0-canary.8 2019-01-18 12:15:56 +01:00
Giuseppe
b4e6ded289 Upgrade styled-jsx (#6069)
Introduces full support for Babel 7 including JSX Fragments shorthand. 
Switched to visiting the `Program` path and then start a traversal manually to solve conflicts with other Babel plugins.
2019-01-16 11:37:01 +01:00
Tim Neutkens
9ab8714f38 v8.0.0-canary.7 2019-01-14 16:19:20 +01:00
Alexander Nanberg
ff5cf6d4de Migrate next/head to use React.createContext (#6038)
Continuation of #5945
2019-01-14 01:59:26 +01:00
Tim Neutkens
02ab732096
Remove next/asset (#6046)
* Remove next/asset

Reasoning described in #5970

* Remove next/asset tests

* Bring back asset-page
2019-01-14 01:32:20 +01:00
Tim Neutkens
4939583c65 Move @types to devDependencies 2019-01-12 15:22:15 +01:00
Tim Neutkens
f94d24bffc v8.0.0-canary.6 2019-01-12 00:45:34 +01:00
Tim Neutkens
0607638e8f v8.0.0-canary.5 2019-01-11 22:29:15 +01:00
Alexander Nanberg
25fb3f9c2e Migrate next/router to use React.createContext (#6030)
Fixes parts of #5716. I had some issues with the test suite but I'm fairly certain that I got it working correctly.
2019-01-11 16:04:56 +01:00
Tim Neutkens
2a9b733715 v8.0.0-canary.4 2019-01-10 23:03:25 +01:00
Tim Neutkens
a9f71e449d v8.0.0-canary.3 2019-01-09 00:09:15 +01:00
Tim Neutkens
9ffd23eeef
Replace pages-plugin with loader (#5994)
* Remove unused argument

* Replace pages-plugin with loader

* Add loader-utils types

* Remove logs

* Bring back previous deposal behavior

* Remove console.log

* Remove webpack/utils as it’s no longer in use

* Remove hot-self-accept-loader

* Error Recovery tests

* Make hotSelfAccept a noop default loader

* Fix windows deleted/added

* Remove logging

* Remove unused variables

* Remove log

* Simplify entrypoint generation

* Don’t return the function

* Fix _app test

* Remove code that’s always true

* Move aliases to constants

* Use alias

* Join pages alias in reduce

* Default pages differently

* Loop over pages instead of manually defining

* Move entry generation into common function

* Update packages/next/build/webpack/loaders/next-client-pages-loader.ts

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

* Update packages/next/build/webpack/loaders/next-client-pages-loader.ts
2019-01-08 23:10:32 +01:00
Tim Neutkens
7d080760a8 v8.0.0-canary.2 2019-01-02 16:29:19 +01:00
Tim Neutkens
fd3cb2a190 v8.0.0-canary.1 2019-01-02 15:07:33 +01:00
Tim Neutkens
672a87d981 v8.0.0-canary.0 2019-01-02 13:59:52 +01:00
Tim Neutkens
aabc72015c v7.0.2-canary.50 2018-12-28 11:41:47 +01:00
Tim Neutkens
0f23faf81f
Serverless Next.js (#5927)
**This does not change existing behavior.**

building to serverless is completely opt-in.

- Implements `target: 'serverless'` in `next.config.js`
- Removes `next build --lambdas` (was only available on next@canary so far)

This implements the concept of build targets. Currently there will be 2 build targets:

- server (This is the target that already existed / the default, no changes here)
- serverless (New target aimed at compiling pages to serverless handlers)

The serverless target will output a single file per `page` in the `pages` directory:

- `pages/index.js` => `.next/serverless/index.js`
- `pages/about.js` => `.next/serverless/about.js`

So what is inside `.next/serverless/about.js`? All the code needed to render that specific page. It has the Node.js `http.Server` request handler function signature:

```ts
(req: http.IncomingMessage, res: http.ServerResponse) => void
```

So how do you use it? Generally you **don't** want to use the below example, but for illustration purposes it's shown how the handler is called using a plain `http.Server`:

```js
const http = require('http')
// Note that `.default` is needed because the exported module is an esmodule
const handler = require('./.next/serverless/about.js').default
const server = new http.Server((req, res) => handler(req, res))
server.listen(3000, () => console.log('Listening on http://localhost:3000'))
```

Generally you'll upload this handler function to an external service like [Now v2](https://zeit.co/now-2), the `@now/next` builder will be updated to reflect these changes. This means that it'll be no longer neccesary for `@now/next` to do some of the guesswork in creating smaller handler functions. As Next.js will output the smallest possible serverless handler function automatically.

The function has 0 dependencies so no node_modules are required to run it, and is generally very small. 45Kb zipped is the baseline, but I'm sure we can make it even smaller in the future.

One important thing to note is that the function won't try to load `next.config.js`, so `publicRuntimeConfig` / `serverRuntimeConfig` are not supported. Reasons are outlined here: #5846

So to summarize:

- every page becomes a serverless function
- the serverless function has 0 dependencies (they're all inlined)
- "just" uses the `req` and `res` coming from Node.js
- opt-in using `target: 'serverless'` in `next.config.js`
- Does not load next.config.js when executing the function

TODO:

- [x] Compile next/dynamic / `import()` into the function file, so that no extra files have to be uploaded.
- [x] Setting `assetPrefix` at build time for serverless target
- [x] Support custom /_app
- [x] Support custom /_document
- [x] Support custom /_error
- [x] Add `next.config.js` property for `target`

Need discussion:
- [ ] Since the serverless target won't support `publicRuntimeConfig` / `serverRuntimeConfig` as they're runtime values. I think we should support build-time env var replacement with webpack.DefinePlugin or similar.
- [ ] Serving static files with the correct cache-control, as there is no static file serving in the serverless target
2018-12-28 11:39:12 +01:00
Giuseppe
56744253c6 Upgrade styled-jsx (#5953)
The latest version includes a fix to resolve conflicts with other libraries that use the `css` prop. Details https://github.com/zeit/styled-jsx/releases/tag/v3.1.3
2018-12-27 11:50:19 +01:00
Jeroen Knoops
46c9deb064 Upgrades webpack related libraries (#5949)
Upgrades webpack from 4.26.0 -> 4.28.2

Adds webpackbar for build. Fixes #5777
2018-12-26 12:06:58 +01:00
Tim Neutkens
bd2dee21d4 v7.0.2-canary.49 2018-12-17 19:30:35 +01:00
Tim Neutkens
6e2cbfaff3 v7.0.2-canary.48 2018-12-17 16:13:05 +01:00
Kyle Holmberg
72e7929242 Change page export validity check on client and server in development (#5857)
Resolves #4055 

Credit: https://github.com/zeit/next.js/pull/5095

I didn't use the ignore webpack plugin from the original PR and tested bundle size with https://github.com/zeit/next.js/pull/5339 - seems to be safe on that front.

Was able to get tests to pass locally, unsure of what goes wrong in CI 🤷‍♂️ 

**Questions**
1) The initial PR didn't include changes to `next-server/lib/router` in `getRouteInfo()`. Should the same changes be made within?

2) Should we add a test for rendering a component created via `forwardRef()`?

`component-with-forwardedRef`:
```javascript
export default React.forwardRef((props, ref) => <span {...props} forwardedRef={ref}>This is a component with a forwarded ref</span>);
```

some test:
```javascript
test('renders from forwardRef', async () => {
  const $ = await get$('/component-with-forwardedRef')
  const span = $('span')
  expect(span.text()).toMatch(/This is a component with a forwarded ref/)
})
```
2018-12-17 16:09:23 +01:00
Tim Neutkens
346915eb9d v7.0.2-canary.47 2018-12-16 16:37:17 +01:00
Tim Neutkens
be24aaa0d2 v7.0.2-canary.46 2018-12-16 14:30:50 +01:00
Tim Neutkens
b5b0c743b3 Add ws dependency 2018-12-16 14:28:11 +01:00
Tim Neutkens
e96d694445 v7.0.2-canary.45 2018-12-16 02:01:21 +01:00
Tim Neutkens
f4a2cbb403 v7.0.2-canary.44 2018-12-15 23:45:34 +01:00
DevSide
ebf217cb16 add --node-args option (#5858)
This message is from @timneutkens after making changes:
- Convert executables to Typescript
- Remove `minimist` in favor of `arg` 
- Implement `--node-args` usage: `--node-args="--throw-deprecation"`
- Adds tests for usage of the `next` cli
2018-12-15 22:55:59 +01:00
Tim Neutkens
00a14d696d v7.0.2-canary.43 2018-12-13 19:47:10 +01:00
Benjamin Kniffler
e6c3686629 multi-threaded export with nice progress indication (#5870)
This PR will

- allow nextjs export to use all available CPU cores for rendering & writing pages by using child_process
- make use of async-sema to allow each thread to concurrently write multiple paths
- show a fancy progress bar while processing pages (with non-TTY fallback for CI web consoles)

The performance gain for my MacBook with 4 CPU cores went from ~25 pages per second to ~75 pages per second. Beefy CI machines with lots of cores should profit even more.
2018-12-12 13:59:11 +01:00
Tim Neutkens
2dec1fcd63 v7.0.2-canary.42 2018-12-11 21:59:30 +01:00
Tim Neutkens
0e6d190706
Move sendHTML and rewrite in ts (#5839)
* Move send-html function and rewrite in typescript

* Move getPageFiles and convert to ts

* Move getPageFiles and convert to ts (#5841)

* Move getPageFiles and convert to ts

# Conflicts:
#	packages/next-server/server/render.js

* Fix unit tests
2018-12-07 15:52:29 +01:00
Tim Neutkens
902c5244f3 v7.0.2-canary.41 2018-12-05 22:41:26 +01:00
Tim Neutkens
dd556bf90b
Add tsc type checking (#5826)
* Add tsc type checking

* Add linting on circle

* Add node-fetch types

* Use strict mode
2018-12-05 21:45:50 +01:00
Tim Neutkens
7098501547 v7.0.2-canary.40 2018-12-05 15:05:59 +01:00
Tim Neutkens
a62a6276c7 v7.0.2-canary.39 2018-12-05 14:45:14 +01:00
Tim Neutkens
84223d39e7 v7.0.2-canary.38 2018-12-04 20:10:53 +01:00
Tim Neutkens
dada692bd6 v7.0.2-canary.37 2018-12-04 15:28:36 +01:00
Tim Neutkens
dd3b5bf81d v7.0.2-canary.36 2018-12-04 11:04:21 +01:00
Tim Neutkens
082db2877d v7.0.2-canary.35 2018-12-03 19:50:59 +01:00
Tim Neutkens
58f5dd297a
Add Typescript types for builds functions (#5791) 2018-12-03 14:18:52 +01:00
Tim Neutkens
a9cf735f50
Convert babel plugins to typescript (#5789)
Slowly moving files over 💯
2018-12-02 18:30:00 +01:00
Tim Neutkens
a66e1c0d7c v7.0.2-canary.34 2018-11-30 19:51:54 +01:00
Tim Neutkens
f1fe237ba8 v7.0.2-canary.33 2018-11-29 19:33:20 +01:00
Tim Neutkens
1c64e59564 v7.0.2-canary.32 2018-11-29 12:36:48 +01:00
Tim Neutkens
c1037949fd v7.0.2-canary.31 2018-11-28 17:55:37 +01:00
Tim Neutkens
fb92fdef54
Make sure const/async is transpiled (#5760)
* Make sure const/async is transpiled

* Use babel common compilation instead
2018-11-28 17:53:49 +01:00
Tim Neutkens
af893bf740 v7.0.2-canary.30 2018-11-28 15:12:43 +01:00
Tim Neutkens
15bb1c5e79
Use Typescript to transpile Next.js core files instead of Babel (#5747)
- Replaces taskr-babel with taskr-typescript for the `next` package
- Makes sure Node 8+ is used, no unneeded transpilation
- Compile Next.js client side files through babel the same way pages are
- Compile Next.js client side files to esmodules, not commonjs, so that tree shaking works.
- Move error-debug.js out of next-server as it's only used/require in development
- Drop ansi-html as dependency from next-server
- Make next/link esmodule (for tree-shaking)
- Make next/router esmodule (for tree-shaking)
- add typescript compilation to next-server
- Remove last remains of Flow
- Move hoist-non-react-statics to next, out of next-server
- Move htmlescape to next, out of next-server
- Remove runtime-corejs2 from next-server
2018-11-28 15:03:02 +01:00
Tim Neutkens
c801a96631 v7.0.2-canary.29 2018-11-27 22:21:00 +01:00
Tim Neutkens
818cf8e77a v7.0.2-canary.28 2018-11-27 12:39:07 +01:00
Tim Neutkens
9f03fad5e9 v7.0.2-canary.27 2018-11-25 00:57:02 +01:00
Tim Neutkens
cad19c808c
Use <link rel=“prefetch”> for prefetching (#5737)
* Use <link rel=“prefetch”> for prefetching

Fixes #5734

* Fix unit tests for router

* Add test for prefetch

* Rename test

* Check all logs for message
2018-11-25 00:47:39 +01:00
Richard Park
44d661af67 Upgrade to webpack@4.26 (#5729)
* Upgrade terser-webpack-plugin

* Upgrade webpack

* Extract common terserPluginConfig
2018-11-22 10:14:14 +01:00
Tim Neutkens
9b2782a6d0
Add engines to next and next-server (#5724) 2018-11-21 21:56:24 +01:00
Tim Neutkens
c2eaf26ea9
Remove flow types (#5704)
* Remove flow-typed

* Remove flow types

* Remove the last types

* Bring back taskr dependency

* Revert "Bring back taskr dependency"

This reverts commit 38cb95d7274d63fe63c6ac3c95ca358a28c17895.

* Bring back preset-flow as it’s used for tests

* Revert "Revert "Bring back taskr dependency""

This reverts commit b4c933ef133f4039f544fb10bf31d5c95d3b27a2.
2018-11-21 16:04:37 +01:00
Tim Neutkens
76202f2fb2 v7.0.2-canary.26 2018-11-20 12:17:23 +01:00
Giuseppe
e1f6f34f86 Update styled-jsx (#5617) 2018-11-18 23:33:23 +01:00
Alexander Kachkaev
233a6042d9 Bump bump-babel-plugin-react-require to 3.0.1 (#5693) 2018-11-18 20:40:18 +01:00
Tim Neutkens
cfd46acde5 v7.0.2-canary.25 2018-11-18 13:53:45 +01:00
Tim Neutkens
e930d1e821 v7.0.2-canary.24 2018-11-13 22:58:21 +01:00
Tim Neutkens
a7c440d88e v7.0.2-canary.23 2018-11-13 21:58:33 +01:00
Tim Neutkens
2776caacde v7.0.2-canary.22 2018-11-09 14:10:24 +01:00
Jerónimo Carrizo
3bc415d8b5 canary - just updating to the latest stable version of webpack (#5623)
In order to trying to resolve the bug [#5480](https://github.com/zeit/next.js/issues/5480), I create this PR which update the webpack version.
2018-11-09 14:09:12 +01:00
Tim Neutkens
5ffbb34841 v7.0.2-canary.21 2018-11-07 18:46:35 +01:00
Tim Neutkens
b46d7e8f6f v7.0.2-canary.20 2018-11-07 15:39:23 +01:00
Tim Neutkens
a82a2d8d1b v7.0.2-canary.19 2018-11-07 14:42:00 +01:00
Tim Neutkens
88f2c1716a
Clean up dependencies between next and next-server (#5615) 2018-11-07 14:41:00 +01:00
Tim Neutkens
43dc610196 v7.0.2-canary.18 2018-11-05 17:53:12 +01:00
Tim Neutkens
3c1c972b33 v7.0.2-canary.17 2018-11-05 01:49:35 +01:00
Tim Neutkens
ed56d69155 v7.0.2-canary.16 2018-11-05 00:03:16 +01:00
Tim Neutkens
7876406723 v7.0.2-canary.15 2018-11-04 23:44:14 +01:00
Tim Neutkens
0136db7a00 v7.0.2-canary.14 2018-11-04 23:05:54 +01:00
Tim Neutkens
a97c15d399 v7.0.2-canary.13 2018-11-04 22:17:07 +01:00
Tim Neutkens
cb6fc6b8a8 v7.0.2-canary.12 2018-11-04 03:33:08 +01:00
Tim Neutkens
ef2995d1fa v7.0.2-canary.11 2018-11-04 01:23:14 +01:00
Tim Neutkens
54b9df535d
Handle decoding errors correctly (#5589)
Fixes #4887
Fixes #3612

Also removes http-errors dependency from next-server, leaving a smaller install size
2018-11-04 01:22:33 +01:00
Tim Neutkens
745b2da006 v7.0.2-canary.10 2018-11-03 19:52:45 +01:00
Radovan Šmitala
bf157015fb Remove WriteFilePlugin (#5541)
It is native by webpack-dev-middleware 3.1.0 up
2018-11-02 19:47:56 +01:00
Henrik Wenz
18488f47b0 Fix linter (#5350)
* Fix linter

* Add test env

* Fix lint errors
2018-10-20 17:00:01 +02:00
Tim Neutkens
384fbdc3aa v7.0.2-canary.9 2018-10-11 11:42:53 +02:00
Henrik Wenz
ef01f13e5d Improve test setup (#5388)
* Update jest

* Let jest start chromedriver

This makes sure chromedriver always ends even if the test was canceled by the user.

* Properly close browser in production-config test

* Properly close browser in production/security test

* Properly close browser in export test

* Properly close browser in app-aspath test

* Remove taskr from project root

This isn’t needed anymore

* Readd taskr to project root (temporary)

* Improve global setup/teardown

* Properly close browser in basic/client-navigation test

Clicking an target=_blank link will open a second browser window. We can only close this by using broser.quit()
2018-10-07 15:04:43 +02:00
Tim Neutkens
ee696683ca v7.0.2-canary.8 2018-10-05 23:41:38 +02:00
Tim Neutkens
93586573e8 v7.0.2-canary.7 2018-10-03 02:38:07 +02:00
Tim Neutkens
85c3ac94b8 v7.0.2-canary.6 2018-10-03 00:10:59 +02:00
Tim Neutkens
e3ef917077 v7.0.2-canary.5 2018-10-02 17:11:00 +02:00
Tim Neutkens
3246c32f63 v7.0.2-canary.4 2018-10-02 16:55:08 +02:00
Tim Neutkens
b1d8d775ee v7.0.2-canary.3 2018-10-02 16:16:22 +02:00
Tim Neutkens
85b1c1a6b6 v7.0.2-canary.2 2018-10-02 16:02:57 +02:00
Tim Neutkens
41a570f59a v7.0.2-canary.1 2018-10-02 15:38:22 +02:00
Tim Neutkens
1643165e9d v7.0.2-canary.0 2018-10-02 14:27:19 +02:00
Tim Neutkens
82d56e063a
next-server (#5357) 2018-10-02 00:55:31 +02:00
Tim Neutkens
b9461824ec
Remove unused prefetch.js (#5344) 2018-10-01 11:15:52 +02:00
Tim Neutkens
b18840b0ea
Update homepage (#5345) 2018-10-01 01:34:54 +02:00
Tim Neutkens
b1c4f3aec4
Monorepo (#5341)
- Implements Lerna
- Moves all source code into `packages/next`
- Keeps integration tests in the root directory
2018-10-01 01:02:10 +02:00