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

227 commits

Author SHA1 Message Date
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 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 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
C. T. Lin 8e6615dcf9 upgrade react to v15.5 and use prop-types instead of React.PropTypes (#1684)
* upgrade react to v15.5 and use prop-types instead of React.PropTypes

* Update package.json
2017-04-11 00:05:26 +05:30
Arunoda Susiripala 060cac3e3f Move all the modules used in 1/2 of all pages into the common chunks. (#1659) 2017-04-07 11:39:00 -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
alex newman 8d2bbf940d Refactor the build server to remove tie to fs (#1656) 2017-04-07 09:52:12 -07:00
alex newman 9347c8bdd0 Specify a different build directory for #1513 (#1599)
* Update references to `.next`

* Remove console logs and extraneous semi colons

* Remove lint errors

* Update references to .next and update docs

* Update options from nested to flat with `distDir`

* Add integration tests, and update `.gitignore`

* Rename integration folder to dist-dir to match standards
2017-04-06 15:39:26 +05:30
Arunoda Susiripala 5fcb49632e Introduce better debug error handling (#1592)
* Introduce better debug error handling
With this we are rendering runtime and debug errors inside
a it's own error root.
That gives us better error handling and control.
Also, now we are patching React core to capture runtime errors.

* Render the initial error on the server.
2017-04-01 14:03:40 -07:00
Arunoda Susiripala 87ff667e6e Revert "Introduce better debug error handling (#1590)" (#1591)
This reverts commit 0bdd321654.
2017-04-01 13:23:09 -07:00
Arunoda Susiripala 0bdd321654 Introduce better debug error handling (#1590)
With this we are rendering runtime and debug errors inside
a it's own error root.
That gives us better error handling and control.
Also, now we are patching React core to capture runtime errors.
2017-04-01 13:09:16 -07:00
Arunoda Susiripala bd80b78f5d Handle undefined assets when combining. (#1569)
It's possible for common.js to be empty in certain cases.
So, we need to handle it.
2017-03-30 16:35:53 +02:00
Arunoda Susiripala bb72e19190 Move all NPM modules into a single chunk in dev mode. (#1512)
This will isolate all the NPM modules into a single chunk.
That chunk won't touch by webpack unless, there's a new NPM module.
That gives us much better re-build performance.
2017-03-26 13:48:59 -07:00
Guillermo Rauch 50274959cb Revert "Move all NPM modules into a single chunk in dev mode. (#1505)"
This reverts commit a879f47f9a.
2017-03-26 11:24:58 -07:00
Arunoda Susiripala a879f47f9a Move all NPM modules into a single chunk in dev mode. (#1505)
This will isolate all the NPM modules into a single chunk.
That chunk won't touch by webpack unless, there's a new NPM module.
That gives us much better re-build performance.
2017-03-25 10:26:08 -07:00
Arunoda Susiripala 32af8294a7 Load the main JS bundle in production with async (#1485)
* Use a webpack plugin to combine assets.

* Add comments and make this releseable.

* Fix some typos.

* Fix some typos.
2017-03-24 13:21:34 +05:30
Arunoda Susiripala bc2d5f3bdb Show errored file always in the error overlay. (#1470)
This was not happening when there's module not found errors.
Now we try to do this for all the errors if possible.
2017-03-23 04:43:23 +05:30
Arunoda Susiripala b2fabf0fe0 Load script with the defer attribute (#1437)
Load script with the defer attribute
2017-03-19 18:46:50 +05:30
Arunoda Susiripala ffade8d5ac Fix client error modal not showing in dev (HMR) (#1448)
* Fix HMR not working issue.
Our hot-reload code on the server has custom webpack error dectection logic.
Is supports only multi-modules entries.
So, we need to all entries as multi-module entries
even if there's just a single entry.

* Add a test case for showing errors over HMR.
2017-03-18 16:01:55 -07:00
Arunoda Susiripala 6979e35947 Add content based HASH to main.js and common.js (#1336)
* Use file hashes instead of BUILD_ID.
Now JSON pages also not prefixed with a hash and
doesn't support immutable caching.
Instead it supports Etag bases caching.

* Remove appUpdated Router Events hook.
Becuase now we don't need it because there's no buildId validation.

* Remove buildId generation.

* Turn off hash checks in the dev mode.

* Update tests.

* Revert "Remove buildId generation."

This reverts commit fdd36a5a0a307becdbd1d85ae3881b3a15b03d26.

* Bring back the buildId validation.

* Handle buildId validation only in production.

* Add BUILD_ID to path again.

* Remove duplicate immutable header.

* Fix tests.
2017-03-07 10:43:56 -08:00
Arunoda Susiripala ef2bbfee5a Add default entries to main.js (#1343)
So, we don't need to add them to individual pages.
This also fix the issue where, error pages doesn't ping the server.
2017-03-04 17:29:35 -08:00
Tim Neutkens 2a1f8ad387 Fix linting errors in standard 9.0 (#1333)
* Fix linting errors in standard 9.0

* Update lockfile
2017-03-02 16:17:41 -08:00
Arana Jhonny bc47aac8f4 Fixed some problems with standard (#1331) 2017-03-02 22:46:16 +01:00
Tim Neutkens 40738c6e44 Throw Error when url.parse without true is parsed (#1282)
* Throw Error when url.parse without true is parsed

This is a bit more descriptive when this mistake is made by the user.

* Parse when needed

* Parse querystring if it is not provided
2017-03-01 15:30:07 -08:00