崔宁
67697afa44
Remove the extra plugin ( #2670 )
2017-07-28 10:45:04 +05:30
Arunoda Susiripala
10241fe610
Fix the route redirect error when we've multiple path params. ( #2652 )
...
For an example, with a URL like: /static/data/hello.txt
2017-07-26 22:31:49 +05:30
Arunoda Susiripala
564dbdd237
Add a test case to prevent issue #2617 to happen again.
2017-07-24 11:43:45 +05:30
Arunoda Susiripala
7965cb299d
Merge master into v3-beta.
2017-07-24 10:10:29 +05:30
Arunoda Susiripala
c03c86ee5e
Make sure /static/ and /_next/ are valid internal urls. ( #2631 )
2017-07-24 10:04:06 +05:30
Tim Neutkens
2c7d0ec47a
Uppercase location for consistency ( #2622 )
2017-07-23 19:50:48 +02:00
Arunoda Susiripala
2f7e459210
Make dynamic import spec compliant. ( #2612 )
...
* Make dynamic import spec compliant.
Now we simply return the whole module incl. default field
In 'next/dynamic' we pick the default field if there is.
Since modules with default is mostly used next/dynamic, for the enduser, this change has no effect.
* Rename module into m
Using module could be confusing.
2017-07-20 23:21:04 +05:30
Arunoda Susiripala
c97aca50e5
Show webpack errors in all pages. ( #2588 )
...
* Show webpack errors in all pages.
When there's a webpack error that means HMR failed too.
So, showing other pages won't makes sense since user
can't edit them and get changes via HMR.
That's why now we show the error on all pages.
* Remove exact propType checks from the error component.
When there's an error, something this check shows in the console.
That means it could accept more props.
Also this is not a public API. So, we don't want to do propType checks.
2017-07-18 12:30:23 +05:30
Arunoda Susiripala
d831e6d39c
Webpack's ModuleConcatenationPlugin plugin doesn't work well with HMR. ( #2584 )
...
So, now we only use it for production.
2017-07-17 22:16:39 +05:30
Arunoda Susiripala
af7b875a18
Make sure module.context exist always ( #2580 )
...
Fixes #2578
2017-07-17 11:11:37 +05:30
Arunoda Susiripala
b1b0b88945
Move react-dom into commons.js always. ( #2572 )
2017-07-16 15:48:21 +05:30
Arunoda Susiripala
f25055c9f7
Load the hot-reloader when only needed. ( #2566 )
...
This reduce the server boot-up time a lot.
With a 2015 MacBook Pro, it went down from 1000ms to 200ms
2017-07-15 18:29:10 +08:00
Kevin Decker
bd24e74a98
Support webpack harmony modules in self accept ( #2510 )
2017-07-10 10:10:32 +05:30
Arunoda Susiripala
783ecdefd2
Merge branch 'master' into v3-beta
2017-07-09 09:57:56 +05:30
fridays
9cc8d26a68
fix regex for pages that end with index ( #2505 )
2017-07-09 09:50:30 +05:30
Arunoda Susiripala
4563f68ad5
Revert "Emit ES6 code for module source in emit file load" ( #2501 )
...
* Revert "Update emotion example to use css instead of fragment (#2497 )"
This reverts commit 5bd3a5f1d1
.
* Revert "Fix "Deploy to now" link (#2489 )"
This reverts commit df1cd7ebf3
.
* Revert "Emit ES6 code for module source in emit file load (#2478 )"
This reverts commit 3f50abcb51
.
2017-07-08 11:07:17 +05:30
Kevin Decker
3f50abcb51
Emit ES6 code for module source in emit file load ( #2478 )
...
Previously the commonjs modules were being passed into webpack dependency layer, preventing tree shaking.
2017-07-07 09:48:00 +05:30
Arunoda Susiripala
1c7b2603d4
Block special pages from the public. ( #2479 )
...
Otherwise, users could invoke 500 errors.
2017-07-06 17:59:25 +05:30
Arunoda Susiripala
c5c270c576
Merge master into v3-beta.
2017-07-06 12:24:31 +05:30
Kyle Kelley
5a840cc39e
allow cleaning from non-cwd ( #2451 )
2017-07-05 10:49:35 +05:30
Arunoda Susiripala
9395718ee1
Consider using distDir config for dynamic chunks. ( #2436 )
2017-07-02 11:23:15 +05:30
Tim Neutkens
c8e8cb5e52
Check if parsedUrl is an object ( #2066 )
2017-07-02 11:22:39 +05:30
Arunoda Susiripala
304225d9ea
Optimize the bundle size of Next.js core ( #2422 )
...
* Try to the slim the webpack output.
* Remove react-hot-loader completely from production.
2017-07-01 12:54:16 +05:30
Ian Mitchell
ac3c59b9f4
Removes Windows Webpack Polling ( #2359 )
2017-06-30 12:20:18 +05:30
Arunoda Susiripala
247dd98cf3
Add a better filename to the dynamic import chunk. ( #2397 )
...
With this we can see the import name in the filename.
This helps a lot in debugging and analyzing the webpack
bundle.
2017-06-29 05:55:13 +05:30
Arunoda Susiripala
655018c0e7
Merge master into v3-beta
2017-06-29 00:51:05 +05:30
Arunoda Susiripala
23c2f02f56
Make it easy and meaningful to analyze the bundle. ( #2393 )
2017-06-29 00:46:21 +05:30
Xuezheng Ma
4eb86dc5f8
Added proper error for running next start
on dev build ( #2337 )
...
* Added proper error for running `next start` on dev build
* Check if build exist before usage
* Move BUILD_ID check from bin/next-start to server/index.js
* Check env before checking build
2017-06-26 22:18:56 +02:00
Dan Zajdband
87e01f681b
Fix #2353 - server render parameters ( #2356 )
2017-06-24 04:38:05 +05:30
C. T. Lin
213d7a82d1
update webpack to v3 ( #2349 )
...
* update webpack to v3
* Use exact versions.
2017-06-23 10:44:40 +05:30
Felix-Antoine Paradis
d2149da54d
Add the ability to pass next configuration to production builds ( #2345 )
2017-06-23 09:18:06 +05:30
Sasha Aickin
9c2db29166
Fixed an issue where two-page sites didn't split code. ( #2329 )
2017-06-21 09:57:24 +05:30
Arunoda Susiripala
fe77397f26
Make sure internal url always has 200 status code. ( #2299 )
...
Even the user set it to something else via custom server api.
2017-06-19 12:57:35 +05:30
Arunoda Susiripala
0c4362e440
Load chunks in SSR mode only if they exists in the filesystem ( #2196 )
...
* Always check with the fs when gettings chunks.
* Add a new set of test cases for dynamic imports in dev.
* Add dynamic import test cases for production.
* Add availableChunks support for static exports.
2017-06-08 19:41:22 +02:00
Henrik
9c1898f2c8
Allow custom head attributes ( #2189 )
...
* fix(package): update babel-preset-env to version 1.5.2
* Allow Custom head attributes
This PR allows to add static attributes to the `document/head
2017-06-08 19:27:54 +02:00
David Corwin
ca9146c421
support custom build directory in next export ( #2135 )
...
* use custom build directory instead of .next if specified, helpful log messages.
* Remove some unwanted newlines.
2017-06-08 07:09:45 +05:30
Arunoda Susiripala
13a51e0a75
Merge master into v3-beta.
2017-06-07 11:43:05 +05:30
Arunoda Susiripala
7cd2bb69ea
Squashed commit of the following:
...
commit ced48c3fcfd1880016b08590e1b50827247b7cfb
Author: Arunoda Susiripala <arunoda.susiripala@gmail.com>
Date: Wed Jun 7 11:28:43 2017 +0530
Make sure XSS fix doesn't break our 404 support.
commit d40c833aa16660d547df785bb52e69ecf9a717f2
Author: Arunoda Susiripala <arunoda.susiripala@gmail.com>
Date: Wed Jun 7 09:08:41 2017 +0530
Prevent url path based XSS attacks.
2017-06-07 11:37:28 +05:30
Arunoda Susiripala
8cb3e89455
Merge master into v3-beta.
2017-06-07 04:24:36 +05:30
Arunoda Susiripala
937d0e2bb6
[WIP] Reload webpack if needed ( #2076 )
...
* Reload webpack via hot-reloader when needed.
We need to do this specially we removed a previosly
built page from the filesystem.
* Make sure reloading is happen only once
* Reload only if there's a missing page error.
* Remove debug logs.
* 2.4.2
* Refactor the codebase a bit.
* Move some commonly used regexp to a utils module.
* Handle the reloading well when there's a custom error page.
* Add a HMR test case.
* Close the browser in the test case.
2017-06-06 15:32:02 -07:00
Arunoda Susiripala
0191d2eb1b
Merge branch 'master' into v3-beta
2017-06-05 20:39:07 +05:30
Arunoda Susiripala
24f511f343
When detecting changed pages in hot-reloader use only pages. ( #2171 )
2017-06-05 20:37:20 +05:30
Arunoda Susiripala
f342624f14
Merge master with v3-beta
2017-06-05 15:19:33 +05:30
Arunoda Susiripala
443abba94a
Fix HMR http request timeout issue under node 8. ( #2166 )
...
The fix is to add a heartbeat less than 5 secs.
2017-06-05 11:02:13 +02:00
Guillermo Rauch
850a931e88
Merge branch 'master' into v3-beta
2017-06-01 18:30:57 -07:00
Arunoda Susiripala
43c447edd0
Implement the fix.
2017-06-01 05:46:32 +05:30
Felix-Antoine Paradis
442c611d49
Add next configuration as an option for custom servers ( #2058 )
...
* Add a configuration parameter to custom server startup
* Adding related documentation
* Do not access filesystem if configuration is supplied
* Make the configuration log clearer
* Make the conf default value to `null`
2017-05-31 13:36:07 +05:30
George Pantazis
2953a01c43
Make file-system based routes optional for custom servers ( #914 )
2017-05-27 21:10:15 +05:30
Arunoda Susiripala
9121a9d22e
Never cache assets and HTML in the dev mode. ( #2045 )
...
* Never cache assets and HTML in the dev mode.
* Move etags test to the production.
Now it won't work in dev because of no-cache settings.
2017-05-25 18:28:08 +02:00
Arunoda Susiripala
3c95f21d8c
Do not try to server unnessesary files in either dev or prod. ( #2048 )
2017-05-23 10:30:14 -07:00
Xuezheng Ma
d36118ab02
Check if _document.js returns a react element before using ( #2013 )
...
* Check if _document.js returns a react element before using
* Use capital letter R in 'React'
2017-05-20 00:02:01 +02:00
Arunoda Susiripala
92b0a690be
Add a default value of '{}' to query in the export mode. ( #2003 )
2017-05-18 10:54:57 +05:30
Tim Scanlin
a8fdbb261e
delete files only from outDir ( #2001 )
2017-05-18 09:58:22 +05:30
Guillermo Rauch
b0a9161462
fix typo
2017-05-16 09:41:35 -07:00
Arunoda Susiripala
aeaccf441b
Add dynamic-import support for next-export.
2017-05-15 10:03:35 +05:30
Arunoda Susiripala
4d0147385c
Merge v3-beta in dynamic-imports
2017-05-15 09:41:42 +05:30
Arunoda Susiripala
55c7553a98
Merge master into next-export.
2017-05-15 09:15:50 +05:30
Arunoda Susiripala
c40ded0c12
Copy the static directory for static file serving.
2017-05-14 05:41:13 +05:30
Tim Neutkens
b8f336c747
Add custom webpack dev middleware config ( #1931 )
2017-05-13 16:44:21 -07:00
Arunoda Susiripala
430789b99f
By default print some messages to the console.
...
Also added a silent option if someone don't want
those messages.
2017-05-11 09:23:08 -07:00
Arunoda Susiripala
4be25270c6
Do not include /_document.js when running 'next export'
2017-05-11 08:59:29 -07:00
Arunoda Susiripala
2796c08ef7
Fix '/' page serving issue.
...
It was xxxx/page//index.js
2017-05-11 06:20:58 -07:00
Arunoda Susiripala
6f674b8c0a
Get rid of realPathname for consistant page file structure.
2017-05-10 20:01:42 -07:00
Arunoda Susiripala
98ed666ca6
merge master into next-export
2017-05-10 19:01:01 -07:00
Arunoda Susiripala
2f4a662a48
Fix windows sub-path dev rebuild failed issue. ( #1930 )
...
* Fix windows sub-path dev rebuild failed issue.
* Make sure we apply the '\' replace only on windows.
2017-05-10 08:09:48 +02:00
Arunoda Susiripala
450277f294
Make sure next export doesn't break other modes.
2017-05-09 00:42:48 -07:00
Arunoda Susiripala
147a5ce641
Fix server rendering issue for normal apps.
2017-05-08 23:42:37 -07:00
Arunoda Susiripala
42f1d2efda
Add a way to customize the output directory.
2017-05-08 19:10:55 -07:00
Arunoda Susiripala
71296cceb3
Add the verbose mode.
2017-05-08 18:53:08 -07:00
Arunoda Susiripala
311e4ca0ee
Make sure the router is aware of the nextExport
...
Based on the we can change the routing to do SSR always.
Also make sure pageLoader don't download the page via
client side twice.
2017-05-08 18:20:50 -07:00
Arunoda Susiripala
d4aa2b0408
Allow create dynamic content.
2017-05-08 10:22:32 -07:00
Arunoda Susiripala
dcc3228429
Allow next export to build html pages.
2017-05-07 23:10:26 -07:00
Arunoda Susiripala
be2e5a8c23
Use the realPathname for script tags in document.js
...
This will help us to fetch these scripts directly from a
static server since these paths are resolved.
2017-05-07 19:36:11 -07:00
Arunoda Susiripala
f602f6dc1e
Copy all the static assests to .out
2017-05-07 15:47:40 -07:00
Arunoda Susiripala
5153d6958b
Use development babel presets if it's we are not in production. ( #1895 )
...
Otherwise, user has to expose it's env variable as development.
Usually, that's unlikely to happen.
2017-05-06 00:07:50 -07:00
Arunoda Susiripala
8268905d2f
Use cheap module inline source map ( #1894 )
...
* Fix the page-loader-normalization issue on '/index' page.
* Use cheap-module-inline-source-map as the default devtool.
2017-05-05 23:54:47 -07:00
ateev
3fbccff936
remove elliptic precomputed folder
2017-05-05 02:14:25 +05:30
Arunoda Susiripala
383eec3604
We are using some divs to wrap some script tags. ( #1867 )
...
We don't need them.
So, this change will remove them.
2017-05-03 15:03:39 -07:00
Arunoda Susiripala
ee9dba9ea7
React react-dom/server minified alias. ( #1862 )
...
That's simply because it has no effect since we don't run webpack on the server.
And for the server, file size difference doesn't matter a lot.
2017-05-03 13:59:21 -07:00
Arunoda Susiripala
24f3f143a6
Introduce "asPath" into router and getInitialProps ( #1857 )
...
* Add asPath to next/router and getInitialProps context.
* Add test cases.
* Update docs.
* Build as-path pages before they use.
2017-05-03 09:40:09 -07:00
Luke Edwards
87773b98dc
add react production aliases ( #1855 )
2017-05-02 18:27:18 -07:00
Dieter Luypaert
cb635dd9a5
use configured distDir where required ( #1816 )
2017-05-01 17:42:01 -07:00
Arunoda Susiripala
358cfb3a29
Make dynamic import support to work with HMR.
2017-04-27 12:41:02 -07:00
Arunoda Susiripala
686dd4c4dd
Merge master into dynamic-import.
2017-04-27 08:48:43 -07:00
Arunoda Susiripala
84d00ad14d
Always send an error to client if there is. ( #1800 )
...
In the production, we need to send a dummy error.
2017-04-25 09:45:58 +05:30
Arunoda Susiripala
da775f2e11
Fix error pages' cdn cache issue. ( #1794 )
...
We do this by providing some headers mentioning not to cache.
2017-04-24 13:48:34 -07:00
Arunoda Susiripala
ea77b41570
Use babel-loader 7 beta. ( #1495 )
...
* Use babel-loader 7 beta.
This will get rid of the DeprecationWarning printed while
starting next.
Also this is the version recommened to use with Webpack 2.
* Update to the babel-loader-7
2017-04-22 07:18:53 +05:30
Arunoda Susiripala
17329edcc9
Handle require.ensure errors well.
...
Introduce a new Promise library which runs on the same eventloop.
2017-04-19 23:55:06 +05:30
Arunoda Susiripala
90ea471aa7
Merge master into dynamic-import.
2017-04-18 21:42:21 +05:30
Arunoda Susiripala
f82e52935d
Implement ETag support for server rendered pages. ( #1693 )
2017-04-18 21:15:42 +05:30
Arunoda Susiripala
e0f71d8448
Use babel-preset-env instead of babel-preset-latest. ( #1701 )
...
Here we don't use the full capabilities of babel-preset-env.
But it's recommended to use it without browser configs as
a substitute for babel-preset-latest.
That's why we did this.
2017-04-18 19:28:34 +05:30
Arunoda Susiripala
b3f15f8d5c
Fix a typo. ( #1749 )
2017-04-18 19:14:26 +05:30
Arunoda Susiripala
dec85fe6c4
Add CDN support with assetPrefix ( #1700 )
...
* Introduce script tag based page loading system.
* Call ensurePage only in the dev mode.
* Implement router using the page-loader.
* Fix a typo and remove unwanted code.
* Fix some issues related to rendering.
* Fix production tests.
* Fix ondemand test cases.
* Fix unit tests.
* Get rid of eval completely.
* Remove all the inline code.
* Remove the json-pages plugin.
* Rename NEXT_PAGE_LOADER into __NEXT_PAGE_LOADER__
* Rename NEXT_LOADED_PAGES into __NEXT_LOADED_PAGES__
* Remove some unwanted code.
* Load everything async.
* Remove lib/eval-script.js
We no longer need it.
* Move webpack idle wait code to the page-loader.
Because that's the place to do it.
* Remove pageNotFound key from the error.
* Remove unused error field 'buildError'
* Add much better logic to normalize routes.
* Get rid of mitt.
* Introduce a better way to register pages.
* Came back to the mitt() based page-loader.
* Add link rel=preload support.
* Add assetPrefix support to add support for CDNs.
* Add assetPrefix support for preload links.
* Update readme.md
2017-04-17 21:18:43 -07:00
Arunoda Susiripala
dfa28815a5
Add server side rendering for dynamic imports.
2017-04-18 01:45:50 +05:30
Arunoda Susiripala
f51300f14b
Add core import() support.
2017-04-17 21:03:40 +05:30
Arunoda Susiripala
6f735eeb05
Fix a typo.
2017-04-12 21:42:04 +05:30
Arunoda Susiripala
95558ae47c
Add link rel=preload support.
2017-04-12 16:11:54 +05:30
Arunoda Susiripala
7997c1fd3c
Introduce a better way to register pages.
2017-04-11 20:03:18 +05:30
Arunoda Susiripala
b5bd0daf62
Remove unused error field 'buildError'
2017-04-11 14:55:53 +05:30
Arunoda Susiripala
6f9b51fce6
Remove pageNotFound key from the error.
2017-04-11 14:51:28 +05:30