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

116 commits

Author SHA1 Message Date
Naoyuki Kanezawa 0a3313d1b9 add the watch ignored setting (#636) 2017-01-03 10:05:04 -08:00
Arunoda Susiripala 6d6ef1ca9f Remove the use of fs.access (#625) 2017-01-02 16:50:01 -08:00
Arunoda Susiripala 4b9f3fc431 Fix JSON pages not building on Windows (#611)
* Check for .json file extension before JSON parse. Was throwing when reading js files.

* Fix cross platform regex

* Revert back to the original content in read-page.js
2017-01-01 20:06:49 -08:00
Naoyuki Kanezawa 897c60b4fd Fix error routes (#595)
* fix router error handlings

* respond with JSON when error occurs on JSON routes
2017-01-01 11:36:37 -08:00
Arunoda Susiripala 33fa931207 Resolve the path in renderJSON before serving. (#599) 2017-01-01 19:07:56 +09:00
Naoyuki Kanezawa 1e308c7118 fix webpack resolve paths (#592) 2016-12-31 21:57:13 -08:00
Naoyuki Kanezawa 8d543bd148 remove the monkeypatch of watchpack (#580) 2016-12-31 11:40:18 -08:00
Arunoda Susiripala 3dae510d51 Add app's node_modules dir to resolveLoaders. (#583)
Otherwise, webpack will throw an error saying
it couldn't find entries.
That's because it couldn't find babel-loader and
other loaders installed into app's node_modules dir.
2016-12-31 22:17:52 +09: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 c210a2e73c check if response is already sent (#569) 2016-12-30 11:55:20 -08:00
Arunoda Susiripala 29c226771c Add AOT gzip content-encoding support for main build files. (#565)
* Add AOT gzip content-encoding support.
Currently we only do this for
main.js and commons.js only.

* Remove unwanted await.

* Use Promise.all to gzip assets in parallel.
2016-12-29 14:38:19 -08:00
Naoyuki Kanezawa ff117b7ed6 Webpack 2 (#449)
* upgrade webpack

* fix WatchRemoveEventPlugin for webpack2

* use webpack2 for building for files

* bump webpack

* bump webpack

* monkeypatch watchpack
2016-12-28 10:16:52 -08: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 815f17989b fix config path (#537) 2016-12-27 15:27:51 -08:00
Arunoda Susiripala ac2a71876d Add support for using .babelrc in the app root. (#493)
* Add support for using .babelrc in the app root.

* Update the README about the .babelrc usage.

* Fix a typo.

* Remove additional example usage.
2016-12-26 10:13:45 -08:00
Naoyuki Kanezawa ad0f0a4d79 watch-page-plugin: prevent null access (#523) 2016-12-26 10:13:28 -08:00
Naoyuki Kanezawa d1f8b1aef1 fix recovering runtime error (#515) 2016-12-25 12:03:07 -08:00
Arunoda Susiripala f7b9cb009f Add cacheDirectory support for babel-loader. (#487)
This will improve the initial babel compilation
specially for larger projects.
2016-12-23 09:49:29 +09:00
Arunoda Susiripala aa7fccbbc4 Fix incorrect babal alias for next/router. (#480) 2016-12-22 22:00:11 +09:00
Arunoda Susiripala 1719738ed1 Allow to customize our babel configuration (#466)
* Add a way to customize babel configurations.

* Add babel configuration docs to README.
2016-12-21 17:36:00 -08:00
Naoyuki Kanezawa fe962b12de make sure to flush styles and head (#459) 2016-12-21 07:57:25 -08:00
Naoyuki Kanezawa 4faa281f23 suppress logging on test (#455) 2016-12-21 06:39:08 -08:00
Arunoda Susiripala 2798df5745 Create a babel-preset for plugins and presets we use. (#445)
* Create a babel-preset for plugins and presets we use.
Anyone could get it via 'next/babel'

* Remove  'use strict' from the source.

* Add next/router to alias resolver in our babel preset.
2016-12-20 18:01:56 -08:00
Arunoda Susiripala 141c045c68 Make next/router a client only API. (#443)
* Prevent using 'next/router' APIs inside 'getInitialProps'

* Remove incorrect documentation.

* Make next/router a client only API.
2016-12-20 09:27:43 -08:00
Naoyuki Kanezawa a87ef1a7af Incorporate styled-jsx (#420)
* integrate styled-jsx

* define styles of pages with styled-jsx

* bump styled-jsx

* bump styled-jsx

* error-debug: fix style

* bump styled-jsx

* fix examples to use styled-jsx

* bump styled-jsx
2016-12-19 10:42:19 -08:00
Arunoda Susiripala 26c485a22f Add X-Powered-By header. (#416)
* Add X-Powered-By header.

* Add support to disable setting x-provided-by header

* Add some test cases.
2016-12-19 07:27:47 -08:00
Arunoda Susiripala 22776c2eee Implement the Singleton Router API (#429)
* Immplement the initial singleton Router.

* Use the new SingletonRouter for HMR error handling.

* Use SingletonRouter inside the Link.

* Create an example app using the Router.

* Make the url parameter optional in Router.push and Router.replace

* Add a section about next/router in the README.
2016-12-19 06:40:26 -08:00
Ives van Hoorne 5ab7463b93 Exploration of different config + expose webpack config (#222)
* Use next.config.js instead of package.json

* Remove irrelevant comment

* Integrate with custom webpack config

* Include hotReload option

* Remove async/await for getConfig

* Read package.json, show warning when webpack in config is defined

* Prepend warning message with WARNING

* Update log statements

* Documentation

* Restart server on change of config

* Fix process handling and cases where there is no config

* Also restart server when config file gets deleted

* Changed second parameter of webpack to config

* Support for returning Promise

* Update documentation, fix bug with webpack config

* Remove package.json, cdn and hotReload from config
2016-12-17 10:38:11 -08:00
Arunoda Susiripala b62a0e8f55 Bundle all the modules inside the app (#414)
* Remove the use of CDN and bundle everything inside the app.
We still pre-build the prefetcher because it needs
different webpack config which only targets browsers
supports Service Workers.

* Remove cdn config item.
We no longer using it.

* Stop adding script tags when staticMarkup=true

* Remove babel-plugin-transform-remove-strict-mode NPM module.
2016-12-17 17:49:10 +09: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
Arunoda Susiripala aa6870a4e6 Fix #204 (#401)
React addons require React in a special way.
That causes Webpack to push React into the app's bundle.
This fix adds new externals entries to prevent that.
2016-12-15 17:45:58 -08:00
Dmitry Poddubniy 45e36fdff7 fixed bug #362, also set chunks names (#363)
* fixed bug #362, also set chunks names

* set simple solution for minChunks

* revert in favor of #310
2016-12-16 03:59:59 +05:30
Arunoda Susiripala 36abdc77c5 Prefetch pages with Service Workers (#375)
* Register the service worker.

* Update prefetcher code to do prefetching.

* Implement the core prefetching API.
support "import <Link>, { prefetch } from 'next/prefetch'"

* Implement a better communication system with the service worker.

* Add a separate example for prefetching

* Fix some typos.

* Initiate service worker support even prefetching is not used.
This is pretty important since initiating will reset the cache.
If we don't do this, it's possible to have old cached resources
after the user decided to remove all of the prefetching logic.
In this case, even the page didn't prefetch it'll use the
previously cached pages. That because of there might be a already running
service worker.

* Use url module to get pathname.

* Move prefetcher code to the client from pages
Now we also do a webpack build for the prefetcher code.

* Add prefetching docs to the README.md

* Fix some typo.

* Register service worker only if asked to prefetch
We also clean the cache always, even we initialize
the service worker or not.
2016-12-15 11:13:40 -08:00
nkzawa b4ccb126d9 ignore .babelrc on babel-loader 2016-12-11 18:09:54 +09:00
Arunoda Susiripala 7086287eaf Set the default minChunks values to the length of pages. (#350)
Earlier it was for all length of entry points.
But we add two more entry points for errors.
Because of that, moving common modules to commons.js won't work.
2016-12-06 10:25:01 +01:00
Naoyuki Kanezawa edfdc482e3 fix to not call hot.accept on sub-components (#294) (#351) 2016-12-06 10:24:42 +01:00
Naoyuki Kanezawa 9990a5fc78 use react-hot-loader/webpack (#338) 2016-12-05 18:09:38 +01:00
nkzawa e1a231cd68 remove FriendlyErrorsWebpackPlugin option 2016-12-04 07:01:15 +09:00
Arunoda Susiripala 5c2e845ad7 Revert "Allow the pages directory to be in node_modules (#318)" (#324)
This reverts commit a13c6ccb11.
2016-12-02 16:58:08 +09:00
nkzawa e0fb04d685 clear console on each webpack build 2016-12-02 14:46:45 +09:00
Naoyuki Kanezawa 12f31b5bf3 Source map support (#279)
* generate source-maps on development

* remove unused dep
2016-12-02 10:43:38 +09:00
nkzawa 4a71fb6b3c Merge branch 'master' into pr/264 2016-12-02 10:21:21 +09:00
Naoyuki Kanezawa fc369fa240 webpack: emit json and apply json-loader after emitting files (#298) 2016-12-01 17:46:49 -05:00
nkzawa 214c885b90 remove unnecessary escape character for lint 2016-12-01 20:54:17 +09:00
Frederick Fogerty a13c6ccb11 Allow the pages directory to be in node_modules (#318) 2016-12-01 20:30:36 +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
Jonas Windey 10b815b9c9 Add react-require to avoid importing React (#295)
* Add react-require

* Add babel-plugin-react-require
2016-11-28 06:46:42 -05:00
Arunoda Susiripala fcd59adea1 Add support for webpack's CommonsChunkPlugin and remove next bundle (#301)
* Add example app which demonstrate the problem.

* Add the first working version.

* Fix lint issues.

* Add README.md

* Use /_next/main.js as the main file URI

* Add the support for loading the core next bundle.

* Optimize the output by removing Next modules from pages.

* Use the same package.json as master use.

* Change the example repo's README for simpler instructions.

* Change example projects package.json to support next build and start.

* Change main.js into commons.js.

* Add support for hot core reload and errors.

* Introduce require based on eval-script.

* Add error reporting support with hot reloading.

* Update README.md
2016-11-28 09:15:56 +09:00