Commit Graph

629 Commits

Author SHA1 Message Date
Ricardo Gobbo de Souza
99614535b5 feat(vue-app, vue-renderer): support meta headAttrs (#4536) 2018-12-14 17:36:26 +03:30
Hartmut
da0a3794ef fix(vue-app): add type definition for ComponentOptions.middleware (#4531) 2018-12-14 06:01:25 +03:30
Xin Du (Clark)
d0c8fcbaa5 fix: duplicate style in extractCSS (#4546)
[skip ci]
2018-12-13 22:07:47 +03:30
Alexander Lichter
c60b1945e8 chore: cleanup (#4529) 2018-12-12 10:01:49 +03:30
William Chong
683dbba4f7 fix: csp SHA hashes accumulate when using custom script-src rules (#4519)
[skip ci]
2018-12-12 09:59:28 +03:30
Alexander Lichter
8e0b5081f2 fix: allow pcss ending for webpack loader (#4530)
[skip ci]
2018-12-12 09:52:43 +03:30
Dmitry Molotkov
33edef2d40 fix(webpack): allow changing devtool with extend (#4515) 2018-12-11 01:04:41 +03:30
Dmitry Molotkov
c3128eaced fix(server): allow rendering urls with unicode characters (#4512) 2018-12-10 16:48:23 +00:00
Pooya Parsa
fe0516978a
fix: improvements for build and dev stability (#4470) 2018-12-09 14:12:22 +03:30
Clark Du
e6808c57ef fest: add build.corssorgin (#4472) 2018-12-05 19:51:58 +03:30
Clark Du
5a8e6e4bdf fix: merge route.meta into options.meta (#4479)
[skip release]
2018-12-04 15:49:05 +03:30
Clark Du
14fe6792ae feat: check modern build file in modern mode (#4467)
[skip release]
2018-12-04 15:41:18 +03:30
Pooya Parsa
0f104aa588
feat: improve SSR bundle (#4439)
- Better insights and inspection for server bundle
- Remove all vue related dependencies from vue-renderer package as much as possible to reduce install size of nuxt-start
- Support for single file distributions (serverless)
- Remove server-bundle.json and use the standard .js files for dist/server
- Mitigate CALL_AND_RETRY_LAST Allocation failed errors. Most of the cases happen on JSON.parse() the part when loading bundle. (#4225, #3465, #1728, #1601, #1481)
- Reduce server dist size by removing escape characters caused by JSON serialize
- Faster dev reloads and production start by removing extra JSON.serialize/JSON.parse time
- Less memory usage
- General performance improvements and refactors
2018-12-01 13:43:28 +03:30
Pooya Parsa
06ddfbb77b fix(webpack): deepClone before calling extendConfig (#4464) 2018-11-30 20:22:53 +00:00
Dmitry Molotkov
a6fed0acbd fix(vue-app): allow passing custom props to error function (#4462)
Resolves #4460.
2018-11-30 22:45:29 +03:30
Ricardo Gobbo de Souza
1d78027e2b fix: offer a new port and listen if already used, use consola on server error (#4428)
* Use consola on server error

* fix style

* ignore coverage

* use `consola.error(e)`

* formatting server error

* fix style

* offer a new port and listen

* fix style

* simplify return

* Revert "fix style"

This reverts commit 770347adb9.

* Revert "simplify return"

This reverts commit 26f2588b2f.

* simplified tests

* remove dependency `get-port`

* using port `0` to assign a random free port

* update `this.port` value with `address.port`

* For production, use `consola.fatal`

* pass options.dev from server to listener constructor

* add dev on constructor

* improve serverErrorHandler and close

* Update listener.js

* improve serverErrorHandler

* improve the way to handle listen errors

* fix missed line

* fully close old server before listening on a random port

* update listen.test
2018-11-30 16:32:15 +01:00
Alexander Lichter
71136fc9b6 feat: allow lang="postcss" in Vue SFCs (#4417)
* fix: allow postcss lang as tag

* refactor: own postcss rule
2018-11-30 16:23:44 +01:00
Clark Du
fe492d8363
feat(modern): auto detect modern mode (#4422) 2018-11-26 22:49:47 +00:00
Clark Du
701190d796
feat: preload and push modern resources in modern mode (#4362) 2018-11-26 12:09:30 +00:00
Dmitry Molotkov
949785f58e fix(server, vue-app): allow unicode page names (#4402) 2018-11-25 18:22:37 +03:30
Clark Du
52a92fbc48 refactor: use PascalCase for components names (#4396) 2018-11-24 22:19:19 +03:30
Clark Du
70f0dc3825 refactor: spa renderer (#4316) 2018-11-21 16:38:03 +03:30
Alexander Lichter
e0537d54be fix: fall back to default value when publicPath is falsy (#4365)
* test: let tests fail

* fix: add falsy default fallback

* fix(publicPath): force adding trailing slash

* fix: also change _publicPath
2018-11-20 18:12:05 +01:00
Pooya Parsa
27e79be285 fix(builder): add lodash inside templates (#4368) 2018-11-20 09:21:17 +00:00
Clark Du
0db1f26e64
fix(test): wrong route in error-handler-object test (#4363) 2018-11-19 16:06:48 +00:00
Kevin Marrec
d5716eb3db feat(ts): provide type definitions (#4164) 2018-11-17 14:22:21 +03:30
Pooya Parsa
c9459e7aa9
fix(distributions): add bin to all distributions (#4336) 2018-11-16 00:18:30 +03:30
Amos Wong
ae8dc96669 feat: Process transpile path (#4335) 2018-11-15 15:50:55 +00:00
Clark Du
660ab37bff fix(tests): make assets in test consistent with build 2018-11-14 23:05:00 +03:30
Pooya Parsa
68523b95bc
feat(server): fallback option (#4323) 2018-11-14 23:02:07 +03:30
Dmitry Molotkov
9fbd581557 fix: handle errors that are not error instances (#4321) 2018-11-14 22:47:44 +03:30
Pim
846455e2f7 fix(core): stable route sorting (#4331) 2018-11-14 16:50:06 +00:00
Clark Du
853ca4e7d4
refactor: styleLoader and postcss (#4318) 2018-11-12 21:18:50 +00:00
Alexander Lichter
d280bd8d5b chore(config): warn on unknown mode (#4303) 2018-11-11 14:51:53 +03:30
Alexander Lichter
692493f5aa chore: warn when styleResources is used without the community module (#4302)
[skip ci]
2018-11-10 03:29:40 +03:30
Clark Du
2c4bd57101
refactor: perf loader (#4299) 2018-11-08 22:26:52 +00:00
Clark Du
31ef70e560 fix: auto transform and warning for @nuxtjs/babel-preset-app (#4297) 2018-11-09 00:17:53 +03:30
Alexander Lichter
cf1aa1abc8 test: improve tests (#4237) 2018-11-08 13:11:24 +03:30
Pooya Parsa
7c4e77ffb9
feat: dx improvements (#4259) 2018-11-08 12:45:56 +03:30
Clark Du
2a36dbad22
feat: client mode modern and support dev/generate (#4264) 2018-11-07 23:37:06 +00:00
Alexander Lichter
ead994bbb5 test: add a size limit test (#4272)
[skip ci]
2018-11-08 02:04:14 +03:30
Alexander Lichter
b3eb4278a5 fix: serialize config head fn shorthand correctly (#4283)
[skip ci]
2018-11-08 02:03:09 +03:30
Clark Du
17e0890c90 fix(cli): remove duplicate error message in start and build (#4258) 2018-11-02 17:24:58 +03:30
Pim
90325c35ae feat(cli): use cjs dist stub in package (#4243)
* feat: use cjs dist stub for cli package

* fix: spawn nuxtBin directly

* keep node -r esm for optimal windows compatibility
2018-11-01 05:00:28 +01:00
Pooya Parsa
1dd32d0d21 feat: update to consola 2 (#4247)
* add ~> addReporter

* remove badge

* withScope ~> withTag

* update to consola 2

* update build tests
2018-11-01 04:50:07 +01:00
Clark Du
bed0714fad
feat: modern build (#4231)
* feat: modern build

* refactor: use single module import for lodash

* refactor: add credit comment for modern plugin

* feat: ssr modern build

* fix: not null check for request

* fix: not null check for request.headers

* feat: add modern argument on build command

* refactor: simpilfy filenames for modern

* refactor: use packages/webpack src instead of dist in test

* test: add feature test for modern build
2018-10-31 15:52:35 +00:00
Pooya Parsa
08d298d35c test: update test/unit/nuxt 2018-10-31 12:51:44 +03:30
Pooya Parsa
39b558f59c
refactor core into sub-packages (#4202) 2018-10-31 00:12:53 +03:30
Pim
72961acabd feat: nuxt-loading enhancenments (#3891) 2018-10-29 19:18:40 +03:30
Paul Gascou-Vaillancourt
208eba3867 fix(app): Throw error only if value is undefined (#4206) 2018-10-27 20:11:42 +03:30
Clark Du
79eb9c8010
Set up CI with Azure Pipelines (#4190) 2018-10-25 12:33:07 +01:00
Pooya Parsa
46103e72ea
chore: packaging and development improvements (#4193) 2018-10-25 14:52:31 +03:30
Dmitry Molotkov
a3ba6e96ca fix: check styleResources for existence (#4155) 2018-10-25 14:25:05 +03:30
Clark Du
9df5f49e07 feat: split builder into more refined modules (#4171)
New packages:
- `@nuxt/webpack`
- `@nuxt/generator`
2018-10-24 20:25:18 +03:30
Jonas Galvez
da7c01f0d4 chore: fix lint error (#4186) 2018-10-24 17:30:49 +03:30
Jonas Galvez
5ec5cda1f8 chore: test utils cleanup (#4180) 2018-10-24 17:23:34 +03:30
Pim
96bdcaba01 fix(app): lint all templates (#4175) 2018-10-24 17:16:06 +03:30
Clark Du
811234ea02 ci: revert travis windows changes 2018-10-23 10:55:08 +01:00
Pooya Parsa
60dbc6ddc5
fix(builder): use require.resolve to get the path of babel-loader (#4150) 2018-10-23 01:18:06 +03:30
Clark Du
818c66f567
ci: use travis instead of appveyor (#4168)
<!--- Provide a general summary of your changes in the title above -->

## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Bug fix (a non-breaking change which fixes an issue)
- [ ] New feature (a non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)


## Description
<!--- Describe your changes in detail -->
<!--- Why is this change required? What problem does it solve? -->
<!--- If it resolves an open issue, please link to the issue here. For example "Resolves: #1337" -->


## Checklist:
<!--- Put an `x` in all the boxes that apply. -->
<!--- If your change requires a documentation PR, please link it appropriately -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly. (PR: #)
- [ ] I have added tests to cover my changes (if not applicable, please state why)
- [ ] All new and existing tests are passing.
2018-10-22 14:02:17 +01:00
Alexander Lichter
f27939d4a7 feat(cli): support async nuxt.config.js (#4021) 2018-10-18 19:27:35 +03:30
Pooya Parsa
9c1e0d1743 feat: migrate nuxt into monorepo (#4051)
Co-authored-by: Clark Du <clark.duxin@gmail.com>
Co-authored-by: Pooya Parsa <pooya@pi0.ir>
2018-10-18 00:58:25 +03:30
Alexander Lichter
411e89e52c test(custom-dirs): fix custom-asset dir test (#4136) 2018-10-17 01:25:56 +03:30
Alexander Lichter
ae2d31ed19 fix(layouts): resolving with nested custom dir (#4135) 2018-10-17 01:25:28 +03:30
Clark Du
521c3778bd
fix: style module with extractCSS not work well (#4093)
* fix: style module with extractCSS not work well

* test: improve extract css test

* fix: exract css name
2018-10-11 22:53:02 +01:00
Clark Du
61407fec1d refactor: config Postcss preset and plugins together (#3927) 2018-10-09 15:56:11 +03:30
Jonas Galvez
a3dd7dad6b feat: configurable global name (#4012)
Co-authored-by: JuliaNeumann <jn.julianeumann@gmail.com>
2018-10-09 15:38:33 +03:30
Felipe Lübe de Bragança
232bc0196f feat: missing pages directory warning (#4054)
## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Bug fix (a non-breaking change which fixes an issue)
- [x] New feature (a non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)


## Description
Resolves #3920 by adding a warning during the build process and a small disclaimer into the default page component.


## Checklist:
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly. (PR: #)
- [x] I have added tests to cover my changes (if not applicable, please state why)
- [x] All new and existing tests are passing.
2018-10-05 13:37:55 +01:00
renovate[bot]
bc9071663f fix(deps): update all non-major dependencies (#3991)
* fix(deps): update all non-major dependencies

* Update package.json

* fix(deps): lock file update

* fix test due to changed css attribute order
2018-09-30 18:11:52 +02:00
Clark Du
0393bf781c feat: use understandable file names for analyze mode (#4014)
* feat: use understandable file names for analyze mode

* test: asset name for analyze mode

* refactor: add warning message for analyze mode

* refactor: move analyze warning to builder

* test: analyze warning message
2018-09-30 18:11:20 +02:00
renovate[bot]
163cfab240 chore(deps): update all non-major dependencies (#3986) 2018-09-27 11:05:12 +03:30
Dmitry Molotkov
df148a896e fix: properly serialize undefined in vuex store (#3913)
* allow to serialize undefined variable in vuex store

* test properly

* fix test

* lock
2018-09-25 10:51:07 +02:00
Dmitry Molotkov
9c3702c819 fix: use options.server values port, host, socket (#3942)
* user options.server values port, host, socket

* fix: Remove default value
2018-09-23 10:49:51 +01:00
Pooya Parsa
6f5137cd30
chore: upgrade dependencies (babel 7.1) (#3926) 2018-09-21 00:27:37 +04:30
Clark Du
1c34651baa fix: css-loader 1.0 removed alias (#3741)
BREAKING CHANGE
2018-09-19 13:16:21 +04:30
Tatsuyuki Ishi
d1f6f0dc09 loading: add throttle option to skip progress for fast loads (#3886)
* loading: add throttle option to skip progress for fast loads

* Disable some tests relying on internals
2018-09-18 18:16:27 +02:00
Dmitry Molotkov
5af65527b0 allow plugin in directory with index.js file (#3908)
* allow plugin in directory with index.js file

* add test for plugin in dir

* fix: refacto plugins key
2018-09-18 18:06:55 +02:00
Sébastien Chopin
6975655d78
feat: Overwrite store.registerModule (#3909)
* feat: Overwrite store.registerModule

Make `store.registerModule` works seamlessly with server-side rendering.

* fix: test failure
2018-09-18 17:21:25 +02:00
Pim
88c9bae57b feat: add tests to check for changed files (#3893)
* feat: add tests to check for changed files

Make sure that if we are building or generating only files in buildDir and generate.dir are changed. If files in another location would also be changed due to a new config option, those locations should be guarded in lib/common/options so you cant set them lower then rootDir or srcDir.

* fix running tests inBand

use simpler path comparisons

* add debug logs for ci

use process.hrtime for waitFor test

* add debug logs for ci

use process.hrtime for waitFor test

* use writeFileSync should probably help

* use forEach instead of map when not returning a value

update waitFor test to compare values with jest

* fix appeveyor

* use lower limit than delay in waitFor test

revert isAppveyor export
2018-09-18 16:26:41 +02:00
Pim
226b90d4ae fix: prevent removing project by mistake due to build or generate paths (#3869) 2018-09-14 11:36:44 +04:30
Clark Du
0318a82177 fix: no-ssr 1.0 supports placeholder tag 2018-09-13 10:11:29 +01:00
Clark Du
281e2dc600 test: skip sockets test in windows platform 2018-09-13 10:07:34 +01:00
Clark Du
85c9c00b73 fix: no-ssr test error 2018-09-13 10:02:49 +01:00
Clark Du
c77fa479f6 feat(webpack, builder): allow extending loader options (#3799) 2018-09-10 12:57:01 +04:30
Alexander Lichter
1e0219543a feat: automatically include env variables starting with NUXT_ENV_ (#3862) 2018-09-09 01:38:25 +04:30
Alexander Lichter
f87992530e feat(webpack/client): minify extracted css assets (#3857) 2018-09-09 01:18:46 +04:30
Alexander Lichter
b74d537cba feat(renderer): make compression middleware customizable (#3863) 2018-09-09 00:48:14 +04:30
Alexander Lichter
6e8a51509c feat(builder, module): allow error layouts to be added through addLayout. closes #3194. (#3834) 2018-09-02 13:52:10 +04:30
Jonas Galvez
72479687d9 feat(core, cli): builtin support of https and unix sockets (#3831)
Co-authored-by: Aurélien Chrétien <aurelien@manager.one>
Co-authored-by: Rémy Sanchez <remy.sanchez@hyperthese.net>
2018-09-02 13:50:25 +04:30
Clark Du
b11e9c0e51
feat: upgrade eslint to 5.x (#3494)
- [ ] babel-eslint https://github.com/babel/babel-eslint/issues/664
- [x] eslint-config-standard-jsx https://github.com/standard/eslint-config-standard-jsx/issues/32
- [x] eslint-config-standard to be stable release https://github.com/standard/eslint-config-standard/issues/123
- [x] eslint-plugin-html
- [x] eslint-plugin-import
- [x] eslint-plugin-jest
- [x] eslint-plugin-node
- [x] eslint-plugin-promise
- [x] eslint-plugin-standard https://github.com/standard/eslint-plugin-standard/issues/29
- [x] eslint-plugin-vue https://github.com/vuejs/eslint-plugin-vue/pull/504
- [x] eslint-plugin-react https://github.com/yannickcr/eslint-plugin-react/releases/tag/v7.10.0
2018-08-31 21:34:12 +01:00
Pooya Parsa
f85465386c
feat: move nuxt-legacy and nuxt-start into packages (#3824) 2018-08-31 22:51:41 +04:30
Pooya Parsa
83d9dc4105 test: add tests for validate with error 2018-08-25 22:24:16 +04:30
Jonas Galvez
608b913b8a feat: async validate() (#3797) 2018-08-25 14:12:00 +04:30
Pim
43f639b88e fix: fallback should always be a string (#3792)
The SPA fallback option should always be a string, if the user configuration was specifed as boolean true it should have been replaced by the default string value (currently 404.html) in lib/common/options.js

Added test on empty string

Added missing test for spa-fallback.html
2018-08-23 19:33:02 +02:00
Clark Du
567dc860c1 feat: new filenames structure (#3789)
* feat: new filenames structure

* refactor: codes format

* refactor: remove [path] in output filename

* refactor: use chunkhash for js files

* refactor: remove normalizeFileName
2018-08-22 23:54:08 +02:00
Clark Du
e8414291b4
refactor: functional filename should be called from webpack (#3788)
@Atinux Improvement for #3787
2018-08-22 16:47:52 +01:00
Alexander Lichter
3e027269c0 feat: merge renderAndGetWindow options (#3761)
* feat: merge renderAndGetWindow options

* fix: typoe

* refactor: remove explicit comparison for truthy value

* fix: setup defaults correctly

* test: add custom params test
2018-08-22 17:14:15 +02:00
Clark Du
3612ecd435 feat: support functional filenames (#3787) 2018-08-22 17:08:51 +02:00
Clark Du
3f7c5f64ed
fix: async fetch and asyncData not trigger ErrorHandler (#3781) 2018-08-22 14:10:43 +01:00
Sébastien Chopin
820f0fae1a
[WIP] Hooks: render:routeContext and render:routeDone (#3773)
* hooks: Add render:routeDone hook

* hooks: Deprecate render:context and add render:routeContext

* refactor: delegate context to routeContext

* test: Add test for render:routeDone hook

* lint: Fix lint issue
2018-08-21 18:35:46 +02:00