Commit Graph

71 Commits

Author SHA1 Message Date
Daniel Roe 119091c8d1
refactor(utils, vue-app): use `ufo` to parse queries and join urls (#8765) 2021-02-09 17:01:37 +01:00
Daniel Roe c8a4b91ad4
fix: ignore trailing slash in static payloads manifest (#8794) 2021-02-09 16:58:49 +01:00
Rafał Chłodnicki d343d85985
fix(utils): `serializeFunction` fails with certain functions (#8780) 2021-02-08 00:08:13 +01:00
Pooya Parsa c15078fa64 _fix(cjs): always use native require for jest environemnt
[release]
2021-01-04 13:58:05 +01:00
Xin Du (Clark) 6b4d451b66
fix(dev): resolve module required by create-require in jiti (#8556)
* fix(dev): resolve module required by create-require in jiti

* fix test

* add useJITI to create require

* refactor default options.createRequire
2020-12-29 13:15:12 +01:00
Pooya Parsa 57c6f23a52 _fix: use pwd as last option for resolveModule
[release]
2020-12-23 00:36:15 +01:00
Pooya Parsa d4461a56e4 refactor: consistent behavior for resolveModule
- always prefer explicit paths config
- avoid implicitly depending on pwd
2020-12-23 00:29:50 +01:00
Pooya Parsa 49ceba698c chore: fix issues with pnp [release] 2020-12-22 21:05:25 +01:00
Pooya Parsa 7529d65d75 chore: migrate from @nuxt/ufo to ufo 2020-12-22 18:20:41 +01:00
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 b06df71753
fix: `trailingSlash` and child routes not working (#8423) 2020-12-17 14:34:53 +01:00
Daniel Roe fb191d2fbd
fix(vue-app, vue-renderer, utils): respect `trailingSlash` setting for payloads (#8489)
* fix(utils): don't inject a trailing slash on catchall routes (e.g. `/*/`)

closes #8488

* fix(vue-app, vue-renderer): respect `trailingSlash` setting for payloads

* refactor: use new ufo `parsePath` utility

Co-authored-by: pooya parsa <pyapar@gmail.com>
2020-12-17 12:51:14 +01:00
pooya parsa 966796fbdf
fix: fix issues with route normalization (#8462)
Co-authored-by: Clark Du <clark.duxin@gmail.com>
2020-12-10 00:19:31 +01:00
pooya parsa fc51ca3330
fix: normalize routes and decode resolved query (#8430) 2020-12-06 18:32:39 +01:00
pooya parsa 49c293b25f
fix: only encode non dynamic path params (#8421) 2020-12-01 16:01:25 +01:00
Ahad Birang 7cac3c7fc9
fix(vue-router): force chidren to be required if default child is present (#8394) 2020-11-30 23:08:33 +01:00
renovate[bot] e934da3c36
chore(deps): update devdependency @nuxtjs/eslint-config to v5 (#8345)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Clark Du <clark.duxin@gmail.com>
2020-11-14 17:10:53 +00:00
pooya parsa 7961e539da
fix(utils): support chaining functions with promise (#8038) 2020-09-09 11:22:43 +02:00
Ahad Birang 9f05febe08
fix(cjs): fix HMR issue with mongoose (#7938) 2020-08-26 11:38:29 +02:00
netkin-paris 7cecbccabd
fix(module): protect `clearRequireCache` against infinite recursion (#7966) 2020-08-26 11:36:39 +02:00
Ahad Birang 2eb42876a2
fix(utils): remove optional params in routes ending with `index` (#7845) 2020-08-04 15:03:00 +02:00
Ahad Birang ec534d05b9
fix(router): optional dynamic routing in children routes (#7843) 2020-08-04 11:49:12 +02:00
Ahad Birang 6af76334c5
fix(utils): include routes with children for generation (#7761) 2020-07-26 17:47:56 +02:00
Alexander Lichter c5465e65c8
fix(router): show default child if trailingSlash is false (#6594) 2020-07-09 15:08:12 +02:00
pooya parsa 1edac29eba
fix(webpack): use compact name for concatenated modules (#7639)
[release]
2020-06-30 19:47:42 +02:00
Michał Kędrzyński 4a0cf8f404
fix(utils): flat routes if child routes have absolute paths (#7604) 2020-06-25 14:42:16 +02:00
Dmitry Molotkov d89812f241
fix(webpack): chunk name normalization for catch-all pages and windows (#7603) 2020-06-24 22:46:16 +02:00
pooya parsa 1e4ce5055e
refactor: ad-hoc modules (#7452) 2020-06-03 21:34:10 +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 903c3de5b6
feat: expose webpack config (#7029) 2020-03-02 19:15:00 +01:00
Xin Du (Clark) 13cc924f02 refactor: use scope variable memo for modern utils (#6954) 2020-02-09 11:44:54 +00:00
Xin Du (Clark) 6ae7718a42
fix(utils): eliminate side effect from modern utils (#6953)
[release]
2020-02-09 12:17:39 +01:00
Pooya Parsa 304fb488dc fix(utils): early return if id is external 2020-01-21 14:05:48 +01:00
Pooya Parsa d8b84fe263 fix(utils): handled undefined cjs entries
[release]
2020-01-21 13:51:58 +01:00
Pooya Parsa 8907e1553f
feat: HMR support for serverMiddleware (#6881) 2020-01-19 09:34:35 +01:00
crutch12 b2a35d21d7 fix(utils): add catch statement to non function block in `serializeFunction` (#6776) (#6777) 2019-12-16 22:20:28 +01:00
Cain Hall ae769ce763 fix(utils): flatRoutes regex for nested routes with trailing slash enabled (#6791) 2019-12-16 21:19:40 +01:00
Xin Du (Clark) e8aca9eb11 chore: update @nuxtjs/eslint-config to v2 and fix lint errors (#6732) 2019-11-26 23:42:39 +01:00
Yuki Terashima 2d27a4d2dc fix(utils): error when `router.trailingSlash` is `false` (#6515) 2019-10-08 10:48:52 +02:00
Pim 49136bcd1b fix(core): clear resolver cache for project files dev mode (#6490) 2019-10-01 13:04:24 +02:00
Alexander Lichter c202893b9e fix(webpack): correct sass options for `sass-loader@8` (#6460) 2019-09-26 14:10:54 +02:00
Pim 0daaf87c83 feat(utils): export sort routes (#6277) 2019-09-01 18:24:21 +02:00
Alexander Lichter 7c90310166 feat(builder, router): enforce uniform trailing slash handling (#6331) 2019-09-01 16:37:25 +02:00
Kevin Marrec 81b5ce22ce feat: externalize typescript support (#5858) 2019-07-24 11:56:44 +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
Xin Du (Clark) a1124d2fff
fix(renderer): correctly load nomodule scripts in safari 10 (#6033) 2019-07-06 16:22:50 +01:00
Kevin Marrec 262ea5c31a refactor: prepare for external typescript support (#5854) 2019-06-05 00:18:01 +04:30
Aaron Ransley d86e510563 fix(utils): handle `serializeFunction` edge case (#5754) 2019-05-19 23:20:52 +04:30
Sébastien Chopin 03eb049677
fix(builder): watch store dir and `serverMiddleware` paths (#5681)
* fix(builder): Watch store dir to restart Nuxt app when options.store=false

* hotfix: Linting issues

* hotfix: Use path.resolve instead of path.join

* test: Update test for watcher

* hotfix: revert to path.join and fix tests

* hotfix: Fix coverage for hard to test condition

* hotfix: Fix test for Windows

* Update builder.js

* fix lint error

* fix: Cache serverMiddlewarePaths
2019-05-10 15:03:07 +02:00