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

65 commits

Author SHA1 Message Date
Tim Neutkens b0cdc1368e
Remove unused dependencies (#3962) 2018-03-07 09:31:24 +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
Tim Neutkens 29c4035eb5 Remove config from bin/next since it's unused (#3496)
* No need to get the config here

* Remove unused functions
2017-12-24 10:05:23 -08:00
Kenneth Auchenberg 20af8cdabe Add option to pass --inspect flag to enable server-side debugging (#3294)
* Add option to pass --inspect flag

* Re-add shebang's

* Tweak spacing

* Use global 'node' when spawning process
2017-11-20 15:51:46 +01:00
Tim Neutkens 152c2c2af3 Make sure NODE_ENV is production for react-dom to optimize 2017-10-29 00:19:59 +02:00
Tim Neutkens 1034b107c1 Make next-export executable 2017-10-19 22:18:26 +02:00
Brice BERNARD 5a305265d9 Fix description by renaming '.next' to 'out' (#2938) 2017-09-12 20:54:32 +02:00
Jimmy Moon 26c5d90b2f Separate next init (#531) (#2834) 2017-08-24 22:50:09 +02:00
Scott Raymond 2d510d640a Add hostname argument to next-dev (#2500) (#2506) 2017-07-08 22:14:58 +02:00
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
Tim Neutkens bf0d7f8b40 Better error message for missing peerDependencies (#2168)
* Add better error reporting (#2087)

* Apply message to all missing dependencies (#2105)

* Use template string instead of escapes
2017-06-07 14:43:49 +05:30
Arunoda Susiripala fd95a94aee Change the output dir to 'out'. 2017-05-15 09:13:08 +05:30
Arunoda Susiripala acea5aa5bf Change .out static dir to next-static-out 2017-05-15 08:57:36 +05:30
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 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 f602f6dc1e Copy all the static assests to .out 2017-05-07 15:47:40 -07:00
Kevin Donahue c9bfba6865 Only watch config file that exists on the level of source files (#1643) 2017-04-10 16:07:38 +02: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
Kevin Donahue f9aa7bdbc1 Fix typo in signal message on process close event (#1601) 2017-04-03 09:19:29 +05:30
Tim Neutkens c50c703d11 Update next init to reflect changes in 2.0 (#1543) 2017-03-28 21:20:18 +02:00
Tim Neutkens 63e3262f2f Add message for missing peerDependencies (#1187)
* Add message for missing peerDependencies

* Remove exit

* Use console.warn
2017-02-23 17:00:37 +01:00
Tim Neutkens f93bacfaba Use minimist string option for hostname (#1090)
* Use minimist string option

* Consistently use --hostname

* Code style

* Show hostname
2017-02-13 01:23:42 +09:00
Jesse Hattabaugh c4a22abb4c adding hostname argument to CLI (#1017)
* adding hostname argument to CLI

* using -H instead of -hn

* removing hostname default

* checking that hostname has a truthy value that's not a boolean

* making the log message match the hostname

* oops
2017-02-12 12:26:10 +01:00
Tim Neutkens ec83670cc7 Check if BUILD_ID is available before starting (#960)
* Check if BUILD_ID is available before starting

* Leave whitespace at end of file
2017-02-02 15:59:01 -08:00
Artem Samofalov 2f7d743050 add pretty message if port already in use(#927) (#932)
* add pretty message if port already use(#927)

* fix console async nature

* fix linter

* clean callbacks code

* Check package.json for the startup script

* fix path to package

* omit callback

* remove extra check, code execute in try block

* + reason for change start listen port of node http

* remove extra code for search package
2017-02-01 21:36:23 +01:00
Jarmo Isotalo 51cbebb240 Don't process.exit(null) when e.g build is SIGKILLed (#887) 2017-01-25 17:10:48 -08:00
Arunoda Susiripala 6f117ecf77 Set default NODE_ENV value. (#768) 2017-01-15 19:58:45 -08:00
Arunoda Susiripala fae2305f46 Add correct sync version of error handling with existSync. (#769)
* Add correct sync version of error handling with existSync.

* Update utils.js
2017-01-15 21:15:06 +09:00
davidrossjones 60918eeb36 Fix typo for --help messages in /bin (#770) 2017-01-14 17:31:09 -08:00
Marvin Mieth 23d5ea9164 Add warning when running start without build (#736)
* add warning when running start without build

* run build before start

* Revert "run build before start"

This reverts commit 171b54489df7b6c3ebd0d9d65578acf89d4daa12.

* exit code & dir

* dont update yarn.lock

* use existsSync

* Add some style changes.
2017-01-11 23:11:37 +09:00
Arana Jhonny e363e73715 Fix Improve "pages/ not found error" (#624)
* fix not found error

* add comment
2017-01-05 13:00:55 -08:00
Matthew Mueller de57e92109 standard format + remove unnecessary react dependency (#492) 2016-12-23 20:08:49 +09:00
Luke Edwards ff7e128c80 add cli version flags (#435)
* add version flags

* fix typo -.-
2016-12-19 12:14:23 -08:00
Stephen Sauceda 955f6817c4 Add cli usage information (#423)
* add cli usage: `next init`

* add cli usage: `next --help`

* add cli usage: `next build --help`

* add cli usage: `next dev --help`

* add cli usage: `next init --help`

* add cli usage: `next start --help`

* use set

* build, start and dev all accept a directory

* typo and conciseness
2016-12-18 12:28:34 -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
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
Stephen Sauceda 694c8c56c7 update default page generated by next init (#376)
* use next logo on 'init' start page

* use github cdn for logo
2016-12-11 12:01:39 -08:00
Leo Lamprecht 7bb903d563
Only show the URL locally, not on the Now platform
Now outputs a URL by itself
2016-12-06 21:39:26 +01:00
nkzawa 6ca52f3ee2 use template literals for console.log 2016-12-02 15:29:02 +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
Tim Oxley 77739f4d5e next init: Create supplied directory if it does not exist. (#136)
* next init: Create supplied directory if it does not exist.

* next init: use mkdirp to init into nested dirs.

Picked mkdirp-then out of many alternatives. Same author & similar
dependencies to mz.

Now next init a/b/c works.

Related https://github.com/zeit/next.js/pull/136#discussion_r85543040
2016-11-03 19:07:15 +09:00
Tim Oxley b86f6a2d42 Ensure bin files are linted. Fix lint issue in bin/next-init. (#158) 2016-10-31 11:39:55 -07:00
Tim Oxley 5595232f58 next init: Exit non-zero when refusing to run in 'pages' dir. (#156)
Should only exit `0` if the command was successful. The command refusing to execute should be considered a failure.

Also, this condition can be detected synchronously, no need to wait on the async existence check.
2016-10-30 15:03:05 +09:00
Tim Oxley da1cdcb843 next init: create package.json with empty description (#135) 2016-10-28 12:05:30 +01:00
Tim Oxley cab1f48d1e next init: Inherit project name from directory. (#134) 2016-10-28 12:05:11 +01:00
Dan Zajdband 38efb9f96e Using process.exit instead of exit 2016-10-25 16:03:24 +01:00
Dan Zajdband 0bae38ae16 It was process.exit 2016-10-25 16:01:36 +01:00
Dan Zajdband 14ef3fcfca Only console error 2016-10-25 15:27:21 +01:00
Dan Zajdband 37f76b16bc Error instead of warning on missing pages dir 2016-10-25 15:25:45 +01:00