1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
Commit graph

39 commits

Author SHA1 Message Date
Arunoda Susiripala 8f874f050c [WIP] Use buildId in chunk urls as well (#2873)
Use buildId in chunk urls as well
2017-08-31 05:47:06 +05:30
Ian Mitchell ac3c59b9f4 Removes Windows Webpack Polling (#2359) 2017-06-30 12:20:18 +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 24f511f343 When detecting changed pages in hot-reloader use only pages. (#2171) 2017-06-05 20:37:20 +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
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
Tim Neutkens b8f336c747 Add custom webpack dev middleware config (#1931) 2017-05-13 16:44:21 -07:00
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 0007cd2a97 [custom server] Handle internal routes automatically (#1658)
* Implement the initial version.

* Improve the render logic a bit.

* Move all the webpack paths under /_next/

* Keep the log:false flag.
2017-04-07 10:58:35 -07:00
Arunoda Susiripala fd430e53bf Revert "Ignore .next from hot reload watcher" (#1313) 2017-02-28 09:46:11 +01:00
Tim Neutkens 4620cd8cd6 Ignore .next from hot reload watcher (#1307)
* Move on-demand-entries-ping to _next namespace

* Ignore .next from watching
2017-02-27 13:35:17 -08:00
Arunoda Susiripala d3b1ead149 Implement "on demand entries" (#1111)
* Add a plan for dynamic entry middleware.

* Use dynamic pages middleware to load pages in dev.

* Add the first version of middleware but not tested.

* Integrated.

* Disable prefetching in development.
Otherwise it'll discard the use of dynamic-entries.

* Build custom document and error always.

* Refactor code base.

* Change branding as on-demand entries.

* Fix tests.

* Add a client side pinger for on-demand-entries.

* Dispose inactive entries.

* Add proper logs.

* Update grammer changes.

* Add integration tests for ondemand entries.

* Improve ondemand entry disposing logic.

* Try to improve testing.

*  Make sure entries are not getting disposed in basic integration tests.

* Resolve conflicts.

* Fix tests.

* Fix issue when running Router.onRouteChangeComplete

* Simplify state management.

* Make sure we don't dispose the last active page.

* Reload invalid pages detected with the client side ping.

* Improve the pinger code.

* Touch the first page to speed up the future rebuild times.

* Add Websockets based pinger.

* Revert "Add Websockets based pinger."

This reverts commit f706a49a3d886d0231259b7a1fded750ced2e48f.

* Do not send requests per every route change.

* Make sure we are completing the middleware request always.

* Make sure test pages are prebuilt.
2017-02-26 11:45:16 -08:00
Naoyuki Kanezawa 141ab99888 build on tmp dir (#1150) 2017-02-15 10:03:33 -03:00
Thomas Lindstrøm acc1983f80 Don't delete .next folder before a replacement is built (#1139) 2017-02-14 20:14:30 -03:00
Naoyuki Kanezawa 43149bdb08 fix not to overwrite the ignored option on Windows (#824) 2017-01-19 08:09:40 +01:00
Naoyuki Kanezawa 0c82d8a483 hot-reloader: return when rejected (#689) 2017-01-07 18:02:29 -08:00
Naoyuki Kanezawa 0a3313d1b9 add the watch ignored setting (#636) 2017-01-03 10:05:04 -08:00
Arunoda Susiripala 165924b71b Add Gzip support for JSON pages (#571)
* Server JSON pages directly from the filesystem.

* Make Json pages even if there's an error.

* Implement much better page serving.

* Use JsonPagesPlugin in the production mode as well.

* Add gzip support for JSON pages.

* Use glob-promise instead of recursive-readdir

* Handle renderStatic 404 properly.

* Simply the gzip code.

* Cache already read JSON pages.

* Change JSON pages extension to .json.

* Fix HMR related issue.

* Fix hot-reload for .json solely on server.

* Properly clear cache on hot-reloader.

* Convert .js pages into .json page right inside the plugin.

* Fix gzipping .json pages.

* Remove unwanted json pages cleanup.

* Get rid of deprecated fs.exists for fs.access
2016-12-31 21:46:23 +09:00
Naoyuki Kanezawa 798fd3c1e8 Fix custom document compilation (#534)
* compile _document using webpack

* don't emit the bundle file of _document.js

* exclude _document.js from minChunks of CommonsChunkPlugin

* handle creation/removal of pages/_document.js

* improve path handlings
2016-12-27 15:28:19 -08:00
Naoyuki Kanezawa 4faa281f23 suppress logging on test (#455) 2016-12-21 06:39:08 -08:00
nkzawa 59d514e071 stop watching files after running tests 2016-12-17 13:04:40 +09:00
Naoyuki Kanezawa 1708222381 Programmatic API (#310)
* add 'next' api

* add render APIs

* add 'as' prop to Link

* check Accept header to serve json response

* check if response was finished on getInitialProps call

* move server/app to server/index

* load webpack-hot-middleware-client by absolute path

* server: options for testing

* add tests

* example: improve

* server: make dir optional

* fix client routing

* add parameterized routing example

* link: fix display url

* Add custom-server-express example (#352)

* Add custom-server-express example

* Remove extraneous nexts in express routes defs

* Update next config in server.js

* Handle accept headers totally inside Next.js (#385)

* Handle accept headers totally inside Next.js
Now user doesn't need to handle it anymore.

* Move json pages serving to /_next/pages base path.

* Join paths correctly.

* remove next/render
2016-12-16 12:33:08 -08:00
Naoyuki Kanezawa 8ddafaea5c custom document support (#405) 2016-12-16 10:42:40 -08:00
nkzawa 4a71fb6b3c Merge branch 'master' into pr/264 2016-12-02 10:21:21 +09:00
Ian Mitchell 7a66870af9 Add Polling for Bash on Windows (#302)
* Add Polling for Bash on Windows

Fixes #166

* Add Windows Bash Dependency
2016-11-28 09:04:59 -05:00
Naoyuki Kanezawa c7ba914f52 Handle runtime errors (#268)
* display runtime errors by error-debug

* server: fix status

* render Error component on client error

* server: render runtime errors of error template

* server: handle errors of error template on render404

* server: add a comment

* server: refactor renderJSON

* recover from runtime errors

* _error: check if xhr exists

* _error: improve client error

* _error: improve error message
2016-11-24 23:03:16 +09:00
Naoyuki Kanezawa a14cc66720 Remove webpack-dev-server (#276)
* remove webpack-dev-server

* webpack: fix publicPath
2016-11-23 10:32:49 -08:00
Chris Cunniff 880b71047b fixes #175, no longer sets process.env.NODE_ENV='production' or runs uglify in next dev mode (#274) 2016-11-18 16:26:17 +09:00
Florian Didron becf2f2a62 Adds friendly error plugin 2016-11-16 11:46:58 +09:00
nkzawa a3548a6717 hot-reloader: remove fileSystem property 2016-11-01 01:15:50 +09:00
Naoyuki Kanezawa f335c21c7c hot-reload failed and succeeded chunks (#167) 2016-10-31 19:51:03 +09:00
nkzawa 7569ef6ca9 hot reload compilation errors 2016-10-25 00:20:50 +09:00
nkzawa 7ec46d512b hot reload added/removed pages 2016-10-24 16:22:15 +09:00
nkzawa 07b95ae080 dynamically add/remove pages 2016-10-24 01:42:13 +09:00
nkzawa 2e2db37ccb add error page for debug 2016-10-19 21:41:45 +09:00
nkzawa f2d456b986 less logs to display on compile error 2016-10-18 18:33:49 +09:00
nkzawa ae5098599a hot-reloader: refactoring 2016-10-17 16:05:46 +09:00
nkzawa 3032ade283 write assets to disk 2016-10-16 04:49:42 +09:00
nkzawa 26e6193a97 hot-reload: initial 2016-10-15 00:05:08 +09:00