Commit Graph

42 Commits

Author SHA1 Message Date
pooya parsa dec8f99fc3
feat: support plug-and-play, typescript runtime and native modules (#8389)
Co-authored-by: Clark Du <clark.duxin@gmail.com>
2020-12-22 18:07:50 +01:00
pooya parsa fc51ca3330
fix: normalize routes and decode resolved query (#8430) 2020-12-06 18:32:39 +01:00
pooya parsa cc1f6d94b5
fix: handle route encoding (#8325)
Co-authored-by: farnabaz <farnabaz@users.noreply.github.com>
2020-11-30 23:10:02 +01:00
Sébastien Chopin e601f0a0d6
chore(server): redirect if `router.base` specified in development (#8313) 2020-11-09 18:17:32 +01:00
Sébastien Chopin 9b29124d31
feat(server): add unload method support for serverMiddleware (#7358)
* feat: add unload method support for serverMiddleware

* chore: update test

Co-authored-by: Pooya Parsa <pyapar@gmail.com>
2020-05-13 17:16:09 +02:00
Sébastien Chopin 917adc0618
feat: options.target and full-static export (#6159)
* feat: add options.target

* fix(lint): lint

* fix(test): update snapshots

* fix(builder): default value for target

* fix(test): fix test

* fix(test): test fixing

* fix: use this.options.target

* fix: final test

* Update packages/vue-renderer/src/renderer.js

Co-Authored-By: Alexander Lichter <manniL@gmx.net>

* feat: Add target option and update banner

* fix(lint): fix

* feat: Add warning when using serverMiddleware in static target

* chore(utils): add TARGETS and MODES as constants

* hotfix: lint

* chore(module): add filename as alias of fileName

* feat: introducing nuxt export and router/routes.json

* hotfix: Fix the linting lord

* chore(core): add comment for filename vs fileName

* fix: use targets constant

* chore: remove warning

* fix: unit testing

* wip: refactor and use TARGETS

* fix: lint

* feat: add target as alias for first arg value

* fix: generate only for SPA

* chore: explain to use nuxt static X

* fix: render SPA fallback on redirect for static target

* fix: lint issue

* fix: only target is useful for now

* wip

* wip: nuxt static export is looking good

* Update packages/generator/src/generator.js

Co-Authored-By: Devon Rueckner <indirectlylit@users.noreply.github.com>

* Update packages/cli/src/options/common.js

Co-Authored-By: Alexander Lichter <manniL@gmx.net>

* feat: add options.target

* fix(lint): lint

* fix(test): update snapshots

* fix(builder): default value for target

* fix(test): fix test

* fix(test): test fixing

* fix: use this.options.target

* fix: final test

* Update packages/vue-renderer/src/renderer.js

Co-Authored-By: Alexander Lichter <manniL@gmx.net>

* feat: Add target option and update banner

* fix(lint): fix

* feat: Add warning when using serverMiddleware in static target

* chore(utils): add TARGETS and MODES as constants

* hotfix: lint

* chore(module): add filename as alias of fileName

* feat: introducing nuxt export and router/routes.json

* hotfix: Fix the linting lord

* chore(core): add comment for filename vs fileName

* fix: use targets constant

* chore: remove warning

* fix: unit testing

* wip: refactor and use TARGETS

* fix: lint

* feat: add target as alias for first arg value

* chore: explain to use nuxt static X

* fix: render SPA fallback on redirect for static target

* fix: lint issue

* fix: only target is useful for now

* wip

* wip: nuxt static export is looking good

* Update packages/generator/src/generator.js

Co-Authored-By: Devon Rueckner <indirectlylit@users.noreply.github.com>

* Update packages/cli/src/options/common.js

Co-Authored-By: Alexander Lichter <manniL@gmx.net>

* fix: duplicate imports

* chore: don't server render if an error happens on static target

* test: update unit and add export

* lint: fix

* lint: fix

* fix: e2e test

* fix: fallback only for static target

* fix: dev test

* feat: add generate.crawler

* fix: full static is when generate.static is given

* chore: improvements

* fix: Add isFullStatic in nuxt/config.json

* feat: handle fetch for full static

* feat: router.prefetchPayloads for full static

* chore: use fetch in async-data example

* fix: add target only if given

* fix: use created to have access to props in fetchOnServer

* chore: add console.error in dev for easy debugging

* feat: payload smart pre-fetching

* fix: remove alias for target

* fix: increment payloadFetchIndex is static set to false

* chore: lint

* chore: add serve command

* chore: rename universal to server-side

* fix: handle payloadPath on SPA fallback

* fix: lint

* chore lint again

* feat: handle spa fallback

* feat: support string for exclude

* fix: fallback only if no extension or html

* chore: use JSON.stringify() for static target

* chore: lint again, dammit

* chore: fix tests and remove too early return

* fix: early return only for server target

* fix: update tests

* fix: unit tests

* chore: add ssr option

* chore: add logic for ssr option

* fix: #6682

* chore(dx): add next command to run

* fix: lint

* fix: tests

* chore: keep old behaviour for nuxt build in spa

* fix: test again, oh boy

* fix: alright this is good now

* chore: add comment for spa fallback

* chore: move routes.json to dot nuxt dir

* chore: simplify check for promise

* chore: unique lock id

* chore: refactor isFullStatic

* fix: dont set default in build context

* chore: add test for serve

* chore: update tests

* hotfix: lint tests

* chore(dx): improve message for bundling

* feat: js payload extraction with jsonp

* fix: keep serialized session script for legacy generate

* fix: call to setPagePayload from fetchPayload

* use devalue for payload chunks

* feat: add initial load state chunk

* feat: preload payload and state scripts

* fix(vue-app): don't re-render the app if trailing slash on SSG

* hotfix: remove console.log

* chore(dx): add deploy infos for nuxt export

Co-authored-by: Pooya Parsa <pyapar@gmail.com>

* chore: handle fetching payload.js for nuxt state

* chore(dx): error when using nuxt generate and static

* chore: remove static option for clarity

* chore: remove serverless target

* hotfix: lint

* hotfix: unit tests

* chore: update legacy js resource

* chore: remove query params from url in static target

* fix: use globalName and urlJoin

* chore: typo

* feat: previewMode 👀

* chore: rename to enablePreview

* fix: wait next tick to avoid error on spa

* chore: try 1 sec

* hotfix: test only for linux, wtf azure

* refactor: static assets

- generalize logic for modules need emit export static assets
- allow customization for version, dir and base
- serialization logic is only in ssr now

* feat: smart state chunk creates

* fix(client): ignore payload load error

* perf: avoide payload loading for spa initial

* perf: avoid loading failed chunks again

* chore(cli): add simple compression for nuxt serve

* test: update snapshots

* fix version snapshot

* fix(generator): set staticAssetsBase on context only for full static

* fix tests

* fix: honor shouldHashCspScriptSrc

* chore(dx): add log for client-side fallback creation

Co-authored-by: Xin Du (Clark) <clark.duxin@gmail.com>
Co-authored-by: Alexander Lichter <manniL@gmx.net>
Co-authored-by: Pooya Parsa <pooya@pi0.ir>
Co-authored-by: Devon Rueckner <indirectlylit@users.noreply.github.com>
Co-authored-by: Pooya Parsa <pyapar@gmail.com>
2020-05-07 21:08:01 +02:00
Nicolas PENNEC a2495a6873
chore: fix typos (#7219) 2020-04-14 11:26:40 +02:00
Pooya Parsa 318aad2aed
fix(server): HMR for sub-app serverMiddleware without path (#7146) 2020-03-27 22:30:43 +01:00
pooya parsa 5a6cde3ebc regression: read prefix from handle fn as well
fixes #7028
2020-03-12 18:33:22 +01:00
Pooya Parsa a84f31d2a9
chore: serverMiddleware HMR improvements (#6896)
* chore(server): fallback route for resolveMiddleware

* chore(server): support express HMR

[release]
2020-01-20 19:28:52 +01:00
Pooya Parsa 8907e1553f
feat: HMR support for serverMiddleware (#6881) 2020-01-19 09:34:35 +01:00
yutanoma a87f5dde6a feat(server): allow passing `loadingTimeout` and other arguments to `renderAndGetWindow()` (#6178) 2019-08-05 15:44:03 +04:30
pooya parsa e7cc2757c3 refactor: update eslint-config to 1.x
Co-authored-by: Alexander Lichter <manniL@gmx.net>
2019-07-10 15:15:49 +04:30
pooya parsa 668db6fbbb fix(server): return listener when calling listen() 2019-05-25 19:48:51 +04:30
Xin Du (Clark) 31a15559e5 refactor: move modern detection from server to utils (#5584) 2019-04-23 13:46:56 +04:30
Xin Du (Clark) 2f9aae3fbe refactor(server): exclude dist files request from browser detection (#5571) 2019-04-21 22:27:48 +04:30
Xin Du (Clark) f5bbc585ee
refactor(vue-renderer): split renderer into ssr, spa and modern (#5559) 2019-04-20 13:02:51 +01:00
Pooya Parsa a9d2deb16a
fix: improve `router.base` handling (#5470) 2019-04-05 18:45:58 +04:30
Sébastien Chopin ef41e205e6 feat: loading screen (#5251)
[release]
2019-03-20 12:47:53 +03:30
Pooya Parsa 13cb0f73d9 refactor: remove builder coupling from server (#5157) 2019-03-08 20:43:23 +00:00
Pooya Parsa d07aefa5db feat(vue-renderer): use async fs (#5186) 2019-03-08 12:20:03 +00:00
Xin Du (Clark) 05299d6738 refactor: improve modern middleware and spa modern rendering (#5037) 2019-03-03 11:22:59 +03:30
Alexander Lichter 69dfd848d7 refactor: some small stuff (#4979)
* refactor: flatten ifs

* refactor: unnecessary curly brackets

* refactor: unnecessary else

* refactor: promise.all instead of for-await

* refactor: apply changes suggested by @clarkdo

* chore: fix typo

* refactor: early return

* refactor: add removal TODOs

* refactor: more descriptive variable name

* refactor: prefer template string

* refactor: one-line

* refactor: early returns

* refactor: early return

* refactor: parallel promises

* refactor: early return and no else

* refactor: spread operator

* refactor: spread operator and early return

* fix: remove error and throw string instead

* fix: always return true

* refactor: clear multiline ternary

* refactor: err stack assignment

* refactor: early return and async/await

* refactor: one line

* refactor: early return

* refactor: early return

* refactor: promise.all

* refactor: args spread
2019-02-08 17:25:11 +01:00
Xin Du (Clark) b23f5c9b4b feat(server): timing option for `Server-Timing` header (#4800) 2019-01-19 21:44:54 +03:30
Amos Wong 602cf12216 fix(server): allow listening on number 0 port (#4781) 2019-01-19 15:53:18 +03:30
Alexander Lichter 40fbe5ba47 refactor: cleanups and code style improvements (#4788) 2019-01-18 00:48:29 +03:30
Pooya Parsa ee0096bf59
feat: nuxt-ts (#4658)
[release]
2019-01-04 23:00:28 +03:30
Alexander Lichter 8786ff7317 fix: require serverMiddleware object with path and handler (#4656) 2018-12-30 01:04:47 +03:30
Xin Du (Clark) df9b32a1c4 fix: hmr in modern mode (#4623) 2018-12-24 19:56:39 +03:30
Xin Du (Clark) 324135df51 refactor: @nuxt/utils (#4609) 2018-12-23 00:35:13 +03:30
Sébastien Chopin 8a200f7e91 fix(server): Cannot read property client of null when webpackHMR & restarting Nuxt 2018-12-11 16:20:59 +01:00
Jonas Galvez 655f11cefd chore: update code to meet new curly-all rule (#4505)
[skip ci]
2018-12-10 01:30:48 +03:30
Pooya Parsa fe0516978a
fix: improvements for build and dev stability (#4470) 2018-12-09 14:12:22 +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
Clark Du fe492d8363
feat(modern): auto detect modern mode (#4422) 2018-11-26 22:49:47 +00:00
Alexander Lichter e4140cee04 feat: disable compressor if set to false/undefined (#4381) 2018-11-21 18:03:03 +03:30
Pooya Parsa 68523b95bc
feat(server): fallback option (#4323) 2018-11-14 23:02:07 +03:30
Pooya Parsa 7c4e77ffb9
feat: dx improvements (#4259) 2018-11-08 12:45:56 +03:30
Clark Du 64839313a9 refactor: use modernMode instead of isModernBrowser for more semantic 2018-11-07 23:50:33 +00:00
Clark Du 2a36dbad22
feat: client mode modern and support dev/generate (#4264) 2018-11-07 23:37:06 +00: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
Pooya Parsa 39b558f59c
refactor core into sub-packages (#4202) 2018-10-31 00:12:53 +03:30