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

181 commits

Author SHA1 Message Date
Tim Neutkens 802e879d33
Implement new next/config keys (#3909) 2018-02-27 17:50:14 +01:00
Bryan Smith ba226c2d26 Fix typo in documentation. (#3907) 2018-02-27 09:36:49 +01:00
Tim Neutkens 1aade36f13
Exposing configuration to the server / client side (minor) (#3882)
* Add next/config

* Set config on server start / client render

* Add documentation for next/config

* Add next/config support for next export

* Fix test

* Use the correct name

* Set default to empty object on the client side

* Add config tests

* Rename config to runtimeConfig
2018-02-26 12:03:27 +01:00
Tim Neutkens 5017f91d23 Allow next.config.js to export a function (#3867)
* Allow next.config.js to export a function

* Expose phases to the configuration function

* Use same value as variable name

* Add next/constants

* Add documentation for config function / phases

* Add constants.js to npm bundle
2018-02-23 19:12:06 +05:30
Arunoda Susiripala a32b22bb2d
Remove special error script handling (#3849)
* Remove special error script handling.
As a result of that, we can't detect 500 errors and buildIdMismatch via client side.

* Fix failing test cases.

* Refactor the code base.

* Remove Router.onAppUpdated
2018-02-21 23:11:25 +05:30
Olivier Tassinari 27f70839eb ⚠️ prefetch is a production only feature ⚠️ (#3851)
I was wondering why I couldn't see the prefetch network request.
Turns out I wasn't forwarding the property to the next router nor I was running the application in production.
2018-02-20 14:24:51 +01:00
djskinner 0e044828ea Add example of next-plugin composition (#3800)
* Add example of next-plugin composition

* Add require statements to the example
2018-02-16 10:59:55 +01:00
Juan Caicedo a7741341cb Fix links for next css (#3820) 2018-02-16 08:41:40 +01:00
Tim Neutkens 340b49c571 Document pageExtensions 2018-02-14 17:52:11 +01:00
Kelly Burke 68f7e20477 Add example to #recipes (#3789) 2018-02-13 15:20:54 +01:00
Ángel M 2ba6a9aff7 Fix svg-components example and improve babel example file (#3746) 2018-02-09 15:41:09 +01:00
Tim Neutkens f9b52cfcb6 Include next/dist/pages instead of exclude (patch) (#3704)
* Move security related test cases into a its own file.

* Removes the unused renderScript function

* Add a nerv example. (#3573)

* Add a nerv example.

* Fix for indentation/style

* Fix for name

* Release 5.0.0

* Add multi-zones docs. (#3688)

* Include next/dist/pages

* Fix linting
2018-02-06 17:39:41 +05:30
Tim Neutkens 70295f2e87 Make links text 2018-02-05 15:09:45 +01:00
Shogun Sea 54ae432369 [DOC] typo in readme: double negation is probably unintended (#3658) 2018-02-02 20:12:37 +01:00
Arunoda Susiripala 4c7f6cc76a Set assetPrefix dynamically (#3661)
* Introduce the setAssetPrefix API for dynamic assetPrefix.

* Remove unwanted node_modules dir in a test dir.

* Change test main description.
2018-02-02 15:43:36 +01:00
Tim Neutkens e093441bad Universal Webpack (#3578)
* Speed up next build

* Document webpack config

* Speed up next build

* Remove comment

* Add comment

* Clean up rules

* Add comments

* Run in parallel

* Push plugins seperately

* Create a new chunk for react

* Don’t uglify react since it’s already uglified. Move react to commons in development

* Use the minified version directly

* Re-add globpattern

* Move loaders into a separate variable

* Add comment linking to Dan’s explanation

* Remove dot

* Add universal webpack

* Initial dev support

* Fix linting

* Add changes from Arunoda's work

* Made next dev works.
But super slow and no HMR support.

* Fix client side hot reload

* Server side hmr

* Only in dev

* Add on-demand-entries client + hot-middleware

* Add .babelrc support

* Speed up on demand entries by running in parallel

* Serve static generated files

* Add missing config in dev

* Add sass support

* Add support for .map

* Add cssloader config and fix .jsx support

* Rename

* use same defaults as css-loader. Fix linting

* Add NoEmitErrorsPlugin

* Add clientBootstrap

* Use webpackhotmiddleware on the multi compiler

* alpha.3

* Use babel 16.2.x

* Fix reloading after error

* Remove comment

* Release 5.0.0-univeral-alpha.1

* Remove check for React 16

* Release 5.0.0-universal-alpha.2

* React hot loader v4

* Use our static file rendering machanism to serve pages.
This should work well since the file path for a page is predictable.

* Release 5.0.0-universal-alpha.3

* Remove optional loaders

* Release 5.0.0-universal-alpha.4

* Remove clientBootstrap

* Remove renderScript

* Make sure pages bundles are served correctly

* Remove unused import

* Revert to using the same code as canary

* Fix hot loader

* Release 5.0.0-universal-alpha.5

* Check if externals dir exist before applying config

* Add typescript support

* Add support for transpiling certain packages in node_modules

Thanks to @giuseppeg’s work in https://github.com/zeit/next.js/pull/3319

* Add BABEL_DISABLE_CACHE support

* Make sourcemaps in production opt-in

* Revert "Add support for transpiling certain packages in node_modules"

This reverts commit d4b1d9babfb4b9ed4f4b12d56d52dee233e862da.

In favor of a better api around this.

* Support typescript through next.config.js

* Remove comments

* Bring back commons.js calculation

* Remove unused dependencies

* Move base.config.js to webpack.js

* Make sure to only invalidate webpackDevMiddleware one after other.

* Allow babel-loder caching by default.

* Add comment about preact support

* Bring back buildir replace

* Remove obsolete plugin

* Remove build replace, speed up build

* Resolve page entries like pages/day/index.js to pages/day.js

* Add componentDidCatch back

* Compile to bundles

* Use config.distDir everywhere

* Make sure the file is an array

* Remove console.log

* Apply optimization to uglifyjs

* Add comment pointing to source

* Create entries the same way in dev and production

* Remove unused and broken pagesGlobPattern

* day/index.js is automatically turned into day.js at build time

* Remove poweredByHeader option

* Load pages with the correct path.

* Release 5.0.0-universal-alpha.6

* Make sure react-dom/server can be overwritten by module-alias

* Only add react-hot-loader babel plugin in dev

* Release 5.0.0-universal-alpha.7

* Revert tests

* Release 5.0.0-universal-alpha.10

* Make sure next/head is working properly.

* Add wepack alias for 'next' back.

* Make sure overriding className in next/head works

* Alias react too

* Add missing r

* Fragment fallback has to wrap the children

* Use min.js

* Remove css.js

* Remove wallaby.js

* Release 5.0.0-universal-alpha.11

* Resolve relative to workdir instead of next

* Make sure we touch the right file

* Resolve next modules

* Remove dotjsx removal plugins since we use webpack on the server

* Revert "Resolve relative to workdir instead of next"

This reverts commit a13f3e4ab565df9e2c9a3dfc8eb4009c0c2e02ed.

* Externalize any locally loaded module lives outside of app dir.

* Remove server aliases

* Check node_modules reliably

* Add symlink to next for tests

* Make sure dynamic imports work locally.
This is why we need it: b545b519b2/lib/MainTemplate.js (L68)
We need to have the finally clause in the above in __webpack_require__.
webpack output option strictModuleExceptionHandling does that.

* dynmaic -> dynamic

* Remove webpack-node-externals

* Make sure dynamic imports support SSR.

* Remove css support in favor of next-css

* Make sure we load path from `/` since it’s included in the path matching

* Catch when ensurepage couldn’t be fulfilled for `.js.map`

* Register require cache flusher for both client and server

* Add comment explaining this is to facilitate hot reloading

* Only load module when needed

* Remove unused modules

* Release 5.0.0-universal-alpha.12

* Only log the `found babel` message once

* Make sure ondemand entries working correctly.
Now we are just using a single instance of OnDemandEntryHandler.

* Better sourcemaps

* Release 5.0.0-universal-alpha.13

* Lock uglify version to 1.1.6

* Release 5.0.0-universal-alpha.14

* Fix a typo.

* Introduce multi-zones support for mircofrontends

* Add section on css
2018-01-30 16:44:44 +01:00
Leo Lamprecht 96f6de2cd5
Removed triangles and linked company name 2018-01-12 10:30:48 +01:00
Tim Neutkens a34f034021
Document serialization of data (#3516)
* Document serialization of data

* Add date
2017-12-29 21:33:49 +01:00
zollero e4acd7db59 Add the closed parenthesis. (#3506) 2017-12-27 10:40:41 +01:00
Nishant 9c88ea8c58 fix grammatical error in readme file (#3443) 2017-12-13 01:49:44 -08:00
Matt Greer e0980f7a45 readme: fix next() api documentation (#3435) 2017-12-11 13:37:36 -08:00
Adam Stankiewicz 6f55d3a5ad Mention on demand entries are development-only (#3433)
Fixes #3430
2017-12-10 12:18:17 -08:00
Cory Simmons 5ce05c2d22 Update readme.md (#3417)
Migrating this to env since that's what's built into next already (and the recommendation of Babel team).
2017-12-07 15:42:17 -08:00
Kanjie Lu cab6341545 fix typo in readme.md (#3385) 2017-12-04 08:14:19 -08:00
brandon 64c69866fe doc'd fs-routing option & added note on passHref (#3384)
2 changes:

`passHref` - just added a cautionary note on the importance of `passHref`. We had a few days of no-href links on our site b/c we used a custom component instead of a raw `<a>` tag,  and Google bot wasn't crawling our links (confirmed in Google cache). Hurt our SEO a bit, so I thought it was worth noting.


`useFileSystemPublicRoutes` - this is mentioned in https://github.com/zeit/next.js/pull/914 , but it doesn't appear any doc was actually added. We use `next-routes`, and we were serving all the files in `/pages/` in addition to their route patterns (ie duplicate content), which can be a pain w/ SEO and duplicate content.
2017-12-03 15:01:48 -08:00
Tim Neutkens 8cd6bd3fc3
Add check for writeable directory (#3370)
* Add check for writeable directory

Followup of https://github.com/zeit/now-cli/issues/175

* Add link to docs
2017-12-02 18:13:39 +01:00
Anders D. Johnson 7c9d350091 docs(readme): add missing period (#3295) 2017-11-16 10:05:42 +05:30
Tim Neutkens ccaf640b47
Document router events the way they are used (#3268) 2017-11-11 20:54:50 +01:00
Tim Neutkens 18f8ab392a Merge branch 'master' into canary
# Conflicts:
#	examples/with-apollo/lib/initApollo.js
#	examples/with-apollo/package.json
#	examples/with-react-with-styles/package.json
#	examples/with-static-export/package.json
#	package.json
2017-11-05 11:01:59 +01:00
Leonardo Quixada b41d177609 Dropped isomorphic-fetch in examples in favor of isomorphic-unfetch. (#3230) 2017-11-04 15:05:16 +01:00
Li Weinan 190853b4ff Support de-deduping head tags by setting key (#3170)
* Support de-deduping head tags by setting key

* move dedupe logic to `unique` function

* fix head tag deduping logic

* remove console.log

* use `toContain` assertions

* update de-duping head tags section in README
2017-10-31 22:52:51 +01:00
Thongchai Kitiyanantawong ba740460c8 Add more example links for CSS preprocessor solution (#3213)
* Add more example link for CSS preprocessor solution

* Change deprecated link
2017-10-31 08:58:50 +01:00
Tim Neutkens 0bdcb8ddc2 Add note about NODE_ENV being set automatically 2017-10-29 00:58:18 +02:00
Remy Sharp 8578038daa Change _error.js example to use err prop (#3197)
The `jsonPageRes` isn't always there, whereas `err` is, and when used,
provides a consistent statusCode in the client when compared to the
server.
2017-10-29 00:58:17 +02:00
m-allanson b937ed3644 Remove extra word (#3193) 2017-10-29 00:58:17 +02:00
Tim Neutkens 72827d25cb Add note about NODE_ENV being set automatically 2017-10-29 00:39:45 +02:00
Remy Sharp 98b48fb3ec Change _error.js example to use err prop (#3197)
The `jsonPageRes` isn't always there, whereas `err` is, and when used,
provides a consistent statusCode in the client when compared to the
server.
2017-10-28 09:23:15 +02:00
m-allanson 814b1821e6 Remove extra word (#3193) 2017-10-27 13:19:30 +02:00
Hans Trautlein 4d2ea0ce80 "download" to "downloads" when subject is singular (#3140) 2017-10-21 16:59:16 +02:00
yashha f5aac04b79 Proposal: Add shields io npm version badge (#3099) 2017-10-15 17:20:34 +02:00
Sitian Liu 11fe73e9ba make clear that server.js doesn't go through Webpack or Babel (#3090) 2017-10-14 19:08:30 +02:00
Matheus Fernandes 6fa0e0dd02 Make the readme.md look a little bit nicer (#3063) 2017-10-09 16:43:36 -07:00
Arunoda Susiripala 8ab50ecb57 Update README for Next 4. 2017-10-10 00:29:40 +05:30
Jesse Ditson a79357f2a4 Allow use of filenames in exportPathMap (#2973)
* allow use of filenames in exportPathMap

* add link test and handling for file paths when flattening links for export

* add note about exporting file paths to readme.md
2017-10-05 20:33:10 +02:00
AugustinLF 285b27b399 Add doc to onDemandEntries configuration (#3030) 2017-10-05 08:28:15 +02:00
Tim Neutkens 418cc210fa Add beta installation instruction 2017-09-27 23:15:46 +02:00
Marc MacLeod ddd30787ef expose buildId to custom webpack configs (#3001)
* expose buildId to custom webpack configs

* update readme to include buildId in option object
2017-09-27 08:03:29 +02:00
Brikou CARRE c0d031d90e Fix coding style of snippets (#2806) 2017-09-08 23:22:59 +02:00
Arunoda Susiripala 56662b4d84 Add/with router (#2870)
* Add withRoute HOC

Rebased (squashed)
- removed routerToProps
- updated hoist-non-react-statics
- improved propTypes

* Expose the whole Router instead of the route.

* Make the example simple.

* Update examples and the readme.

* Add a test case.
2017-08-30 19:37:12 +05:30
Leon Daniel Thorne d2276179be Describe solution to centralized routing (#2844)
* Add section for Centralized Routing

* Update title of section

* Update formatting

* Remove solution from README and link to it from FAQ
2017-08-28 12:21:08 +05:30
Tim Neutkens 62b246d902 Document SCSS/Less (#2742)
* Document SCSS/Less

* Add missing word

* Add docs for examples dir

* Add extra example

* uppercase J
2017-08-09 21:44:37 +02:00
Arunoda Susiripala a99a167067 Remove beta information from the README. 2017-08-09 12:32:49 +05:30
Arunoda Susiripala e2fb50c301 Merge master with v3-beta. 2017-07-28 18:56:38 +05:30
Laurie Voss 23444fc74e Minor grammatical fix: "resembling of" -> "similar to" (#2669) 2017-07-28 10:40:17 +05:30
Tom Coleman 051ee314e9 Also update Router.push example with object URL (#2639)
Following on from f8950e9b4c
2017-07-25 06:53:21 +05:30
Arunoda Susiripala f8950e9b4c Fix README issue related to object-urls. 2017-07-24 20:26:22 +05:30
cyrilf 34830a05c9 Add a missing slash (#2634)
Improving `next.js`, one slash at a time
2017-07-24 20:05:47 +05:30
Ben Murden 6781a75d8b Hyperlink spelling (#2616) 2017-07-21 13:19:22 +02:00
Ben Murden d727a6f082 Fix grammar in Router section. (#2555) 2017-07-14 07:38:06 +02:00
Jure Triglav c9b4add394 Fix spelling of built-in (#2546) 2017-07-13 08:04:36 +02:00
Victor Borges 6e7ac5f0ef fix: Forces Link to expose the href to the child using passHref property. (#2503)
* Forces Link to exposes the href to the child using passHref property.

* tests for passHref prop of the Link

* passHref property Link documentation
2017-07-09 10:39:02 +05:30
Paul O’Shannessy a3495b364d Fix JSX in readme (#2512)
An unclosed tag was resulting in some broken syntax highlighting.
2017-07-09 10:24:47 +05:30
Tim Neutkens dc607e452b Add docs for next/error (#2513) 2017-07-09 10:24:27 +05:30
Sergio Xalambrí 2b9944bf52 Add with-static-export example (#2234) 2017-07-01 21:44:58 +02:00
Arunoda Susiripala 071f526b1c Update readme.md with some links and latest info. 2017-07-01 16:34:52 +05:30
Fabio Espinosa 1b5e724d31 Update readme.md (#2412)
The _error.js works only if it is in the /pages folder
2017-06-30 11:19:16 +05:30
Arunoda Susiripala 03cad7cba5 Fix some errors in README. 2017-06-29 22:27:17 +05:30
Arunoda Susiripala 5a650d74df Add a note about importing server only modules. 2017-06-29 22:21:23 +05:30
Arunoda Susiripala 655018c0e7 Merge master into v3-beta 2017-06-29 00:51:05 +05:30
Tim Neutkens 12e8b1265d Document usage of <Link> without <a> (#2369) 2017-06-27 10:32:30 +05:30
Colder Xihk 3a9c419160 fix typo in dynamic import with multiple modules (#2344) 2017-06-22 19:11:54 +02:00
Leo Lamprecht e3f0fdb9db Invalidated cache for slack badge
The other one is broken since it's been cached wrong by GitHub some time ago
2017-06-21 08:54:04 +02:00
Arunoda Susiripala 9df59c1176 Dynamic component support with multiple modules (#2235)
* Layout ground works for next/async

* Implement the Dynamic Bundle feature.

* Add some test cases.

* Update README.

* Implement props aware dynamic bundle API.

* Update tests and README.

* Add a test case for React Context support.
2017-06-16 18:49:34 +05:30
Matt Phillips 40290f85c3 Fix readme conflict (#2148) 2017-06-03 09:03:56 +02:00
Arunoda Susiripala e1a9febe28 Get latest master into v3 (#2139)
* Merge branch 'master' into v3-beta

* Add send back to v3-beta.
2017-06-02 10:35:04 +05:30
Guillermo Rauch f4345e79c2 Merge branch 'v3-beta' of github.com:zeit/next.js into v3-beta 2017-06-01 18:31:14 -07:00
Guillermo Rauch 850a931e88 Merge branch 'master' into v3-beta 2017-06-01 18:30:57 -07:00
Bill Hefty af7993683b Add link to example for webpack-bundle-analyzer (#1130) (#2104) 2017-06-01 14:51:54 +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
Dmitry Rybin e6f3651763 Fix broken link at readme (#2103)
Fixed broken readme link and make it short by removing unnecessary invitation.
2017-05-31 12:44:34 +05:30
Benjamin Hoffman e1d5c3df55 Updates link in Production deployment of readme (#2113)
I think I found a typo.  Hope this fix matches the author's intended meaning.
2017-05-30 20:50:20 +02:00
Giuseppe 98fb1a0df1 Point to styled-jsx npm package's readme (#2085)
As we add new features and update README.md in zeit/styled-jsx people ask questions, typically why doesn't x works.
Master shouldn't be the source of truth, better link to the npm package's landing page.
2017-05-27 19:46:58 +02:00
Ben James 0fdd379eee Add reference to wiki for deploying to GitHub (#2035) 2017-05-21 18:44:43 +02:00
Jorge Antunes 58f3403587 fix small typo (#2030)
Not much to say on this one, I tend to fix typos everywhere I see them...
2017-05-20 22:38:53 +02:00
Arunoda Susiripala ccea1b748c Point appveyor branch to v3-beta 2017-05-16 12:07:39 -07:00
Arunoda Susiripala dfd5ccfbd6 Merge branch 'master' into v3-beta 2017-05-16 12:06:12 -07:00
Arunoda Susiripala bcb979fdf2 Add some Appveyor customizations (#1985)
* Allow to test on Node.js v4

* Add appveyor.yml file

* Update appveyor badge to master branch.
2017-05-17 00:34:14 +05:30
Marcin Lasak 5f9e9828de Change dynamic imports to dynamic import (#1980)
Fix problem with anchor by changing link and changing text to section title.
2017-05-16 19:59:52 +05:30
Arunoda Susiripala cb90d05544 Update docs for next version 3 beta 2017-05-16 07:08:37 -07:00
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 aa353f8d32 Add docs. 2017-05-15 09:12:27 +05:30
Tim Neutkens b8f336c747 Add custom webpack dev middleware config (#1931) 2017-05-13 16:44:21 -07:00
Tim Neutkens 3b91355c9e Improve styled-jsx section of readme (#1932)
* Document style global jsx

* Add notice that styled-jsx docs contain more examples
2017-05-10 10:25:56 +02:00
Arunoda Susiripala 564ae2b982 Remove the getting started section.
Just add the https://learnnextjs.com link at the top of the page.
2017-05-09 16:34:43 -07:00
Ray Gesualdo 17ce04014f added recipes section to readme (#1928) 2017-05-09 11:22:14 -07:00
Matija Marohnić 6ca1feaf98 Add link to the Glamorous example (#1887) 2017-05-06 11:31:42 -07:00
Tim de Koning 9fb7987c69 #1874 - A warning when using _document.js (#1884) 2017-05-04 16:44:28 -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
Arunoda Susiripala 312cf2356c Add docs. 2017-04-27 08:56:53 -07:00