Commit Graph

56 Commits

Author SHA1 Message Date
pooya parsa c15fc421ab
refactor: use nuxt everywhere (#8210) 2020-11-30 23:44:04 +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
Timothy R. Chavez 2dc11a71dc
fix(vue-renderer): read `target` from class instead of `serverContext` (#7752) 2020-07-22 14:51:31 +02:00
Xin Du (Clark) 8fb196c5d5
fix(modern): modern is wrongly enalbed in full static (#7509)
[release]
2020-06-12 21:36:08 +02:00
Xin Du (Clark) 245d32d0dc
fix(modern): modulepreload not work in generate (#7498) 2020-06-12 10:18:16 +01:00
Pooya Parsa 0337932115
feat: runtime config and built-in dotenv support (#7312)
Co-authored-by: Sébastien Chopin <seb@nuxtjs.com>
Co-authored-by: Alexander Lichter <manniL@gmx.net>
2020-05-18 10:21:15 +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
Pooya Parsa f20d932c4d
feat: allow disabling loading-screen (#6272) 2020-03-13 21:23:33 +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
Ahad Birang bb9427ee74 feat(vue-renderer): support evaluation in templates (#6505) 2019-11-24 13:31:21 +01:00
Xin Du (Clark) 35ba65562f fix(vue-renderer): call `render:resourcesLoaded` hook before `createRenderer` (#6223)
fixes #5960
2019-08-13 01:25:21 +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
Josh Deltener 1d4421ef1d chore: inverse wording of error message (#5990) 2019-06-26 16:20:43 +01:00
Xin Du (Clark) b7284e1b4a refactor(vue-renderer): remove chalk in renderer (#5609) 2019-04-26 16:24:37 +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) f5bbc585ee
refactor(vue-renderer): split renderer into ssr, spa and modern (#5559) 2019-04-20 13:02:51 +01:00
James George b978a3761d feat(vue-renderer): add csp meta tags (#5354) 2019-04-02 00:29:58 +04:30
Pooya Parsa 8b9969599d
fix(renderer): retry render if renderer is in loading or created state (#5417) 2019-03-30 23:35:15 +04:30
Sam Bowler 97db6a4b41 fix(vue-renderer): add the csp hash if `unsafe-inline` hasn't been specified (#5387) 2019-03-29 20:39:53 +04:30
Pooya Parsa 535327c4f1
refactor(vue-renderer): improve ready status error (#5339) 2019-03-23 11:33:08 +04:30
Pooya Parsa caf5198430
fix(builder): await for renderer to load resources (#5341) 2019-03-23 11:32:55 +04:30
Sébastien Chopin ef41e205e6 feat: loading screen (#5251)
[release]
2019-03-20 12:47:53 +03:30
Xin Du (Clark) 648062c308
fix: correct public path in generation and start (#5202) 2019-03-12 15:52:15 +00:00
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
Clark Du a188f07f19 chore: remove unnecessary checks 2019-03-05 17:07:05 +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
Pooya Parsa 29297160a1
feat(vue-renderer): improvements (#4722) 2019-02-08 13:35:01 +03:30
Alexander Lichter 40fbe5ba47 refactor: cleanups and code style improvements (#4788) 2019-01-18 00:48:29 +03:30
Clark Du 0a21d4b34c fix: undefined script in modern mode 2019-01-10 11:17:28 +00:00
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
Pooya Parsa 8b366fd216
chore: use @nuxt for all core dependencies (#4596)
[skip release]
2018-12-20 14:45:12 +03:30
Ricardo Gobbo de Souza 99614535b5 feat(vue-app, vue-renderer): support meta `headAttrs` (#4536) 2018-12-14 17:36:26 +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
Pooya Parsa f0cb654a5d fix(vue-renderer): improve ready handling (#4511) 2018-12-10 12:16:05 +00: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 1162f2ddc1 feat: use runInNewContext: true for nuxt dev (#4508) 2018-12-09 21:37:36 +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 14fe6792ae feat: check modern build file in modern mode (#4467)
[skip release]
2018-12-04 15:41:18 +03:30
Pooya Parsa 4b643b9528 fix(renderer): ignore invalid sourcemaps 2018-12-01 14:21:10 +03:30
Pooya Parsa c0721c0174 fix(vue-renderer): parse JSON values before passing to bundle-renderer
prevent error that occuers in rare cases: TypeError: Cannot read property 'sections' of undefined

Related to #4439
2018-12-01 14:11:10 +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
Clark Du fe492d8363
feat(modern): auto detect modern mode (#4422) 2018-11-26 22:49:47 +00:00
Clark Du 6990efc1bc fix: correct renderer.noSSR name 2018-11-26 13:01:00 +00:00
Clark Du 701190d796
feat: preload and push modern resources in modern mode (#4362) 2018-11-26 12:09:30 +00:00
Clark Du 52a92fbc48 refactor: use PascalCase for components names (#4396) 2018-11-24 22:19:19 +03:30
Pooya Parsa 68523b95bc
feat(server): fallback option (#4323) 2018-11-14 23:02:07 +03:30