Skip to content

Quasar cleaning store's state after boot scripts execution finishes #5393

@jigarzon

Description

@jigarzon

Describe the bug
After executing all boot files, Quasar (specifically client-entry.js ), replaces the store's state with window.__INITIAL_STATE__.

Of course this is because of SSR and preFetch.

But this turns the store param on every boot script useless, as any information that is put on the state will be removed after the boot finishes.

To Reproduce
Steps to reproduce the behavior:

  1. Create a Boot file that writes something on the store (in SSR mode with preFetch)
  2. When rendering the page, the value will be wiped out

Expected behavior
The values written during the boot scripts should be preserved.

Platform (please complete the following information):

Operating System - Linux(4.19.79-1-MANJARO) - linux/x64
NodeJs - 12.11.1

Global packages
NPM - 6.12.0
yarn - 1.19.1
@quasar/cli - 1.0.0
cordova - Not installed

Important local packages
quasar - 1.2.4 -- Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time
@quasar/app - 1.2.2 -- Quasar Framework local CLI
@quasar/extras - 1.3.2 -- Quasar Framework fonts, icons and animations
vue - 2.6.10 -- Reactive, component-oriented view layer for modern web interfaces.
vue-router - 3.1.3 -- Official router for Vue.js 2
vuex - 3.1.1 -- state management for Vue.js
electron - Not installed
electron-packager - Not installed
electron-builder - Not installed
@capacitor/core - Not installed
@capacitor/cli - Not installed
@capacitor/android - Not installed
@capacitor/ios - Not installed
@babel/core - 7.6.4 -- Babel compiler core.
webpack - 4.41.0 -- Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.
webpack-dev-server - 3.8.2 -- Serves a webpack app. Updates the browser on changes.
workbox-webpack-plugin - 4.3.1 -- A plugin for your Webpack build process, helping you generate a manifest of local files that workbox-sw should precache.
register-service-worker - 1.6.2 -- Script for registering service worker, with hooks

Quasar App Extensions
None installed

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions