Skip to content

keep app state at hmr reload #19233

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 of 15 tasks
fab313 opened this issue Oct 27, 2020 · 2 comments
Closed
1 of 15 tasks

keep app state at hmr reload #19233

fab313 opened this issue Oct 27, 2020 · 2 comments

Comments

@fab313
Copy link

fab313 commented Oct 27, 2020

🚀 Feature request

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Description

I am using HMR with the latest rc of the cli.
Refresh and refill of forms works great, however the app state (saved as variables in services) is lost with each refresh.
It seems that all services are newly created with each reload.

Describe the solution you'd like

The app doesn't loose the current state of the app at an HMR update

@alan-agius4
Copy link
Collaborator

Hi,

Thanks for trying our new feature 😄.

This issue is pretty similar and has the same root causes and resolutions of angular/angular#39367

Currently for every change the application needs to be destroyed and re-bootstrapped and therefore any data which is stored in a service and not persisted in a browser storage (global object, localStorage, etc...) will be lost.

Ideally there would be a component/service unload/load mechanism, which HMR can leveraged in this case.

Since both this and the previous mentioned requests are rather similar and likely need the same implementation and API changes. I suggest we continue tracking this in angular/angular#39367. Feel free to chime in over there and give your input.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants