Skip to content
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

fix(slow-start-up): refactors worker/modv lifecycle and module loading #618

Merged
merged 7 commits into from
Oct 23, 2021

Conversation

2xAA
Copy link
Member

@2xAA 2xAA commented Jul 2, 2021

The worker now reports to the renderer process when it's done loading. main.js is waiting for modV's ready promise to resolve before mounting the Vue application. modV also sends an event to the background process to show the main window and close the splash screen.

Speed gains can be measured on macOS (Intel). Windows seems about the same, but at least the UI isn't unresponsive while it's loading.

fixes #617

The worker now reports to the renderer process when it's done loading. main.js is waiting for modV's ready promise to resolve before mounting the Vue application. modV also sends an event to the background process to show the main window and close the splash screen.

fixes #617
@2xAA 2xAA requested a review from TimPietrusky July 2, 2021 17:11
@TimPietrusky
Copy link
Member

@2xAA this looks super cool, thank you very much!

I just have one error:

  1. Open modV
  2. Reload modV
  3. See the following error in a popup:
Uncaught Exception:
TypeError: Object has been destroyed
at IpcMainImpl.eval (webpack:///./src/background.js?:123:16)
at IpcMainImpl.emit (events.js:327:22)
at Object.<anonymous> (electron/js2c/browser_init.js:157:9051)
at Object.emit (events.js:315:20)

This happens every time modV is reloaded.

@2xAA
Copy link
Member Author

2xAA commented Aug 26, 2021

I actually want to hold off on this until #623 is merged as the queuing of messages improves start-up time drastically.
We can still merge this to have a nice splash-screen, once that error is fixed.

@TimPietrusky
Copy link
Member

@2xAA thanks for the fix. Now when I reload modV, the whole window is white (excluding the navigation) until everything is loaded. Maybe add a loading spinner to the main window background? So that it's indicating that the application is loading?

And also could you please resolve the conflicts? 🙏

src/subpages/splash-screen/main.js Outdated Show resolved Hide resolved
@TimPietrusky
Copy link
Member

@2xAA

  • Set background to default background color
  • Added loading spinner to improve the waiting experience

What do you think?

@2xAA
Copy link
Member Author

2xAA commented Sep 22, 2021

Screenshot 2021-09-22 at 10 58 02

@TimPietrusky looks good, though the splash screen now has a background and loading animation 😅

@TimPietrusky
Copy link
Member

@2xAA the issues have been addressed, please take another look!

@2xAA
Copy link
Member Author

2xAA commented Oct 23, 2021

@TimPietrusky Awesome, seems to work fine :)

@2xAA 2xAA merged commit ea8a15d into next Oct 23, 2021
@2xAA 2xAA deleted the fix/617/slowStartUp branch October 23, 2021 14:37
2xAA pushed a commit that referenced this pull request Nov 9, 2021
# [3.19.0](3.18.0...3.19.0) (2021-11-09)

### Bug Fixes

* **color-picker:** fixes colorPicker ([#631](#631)) ([293e223](293e223))
* **font-list:** updates dependancy ([#624](#624)) ([5aeecae](5aeecae))
* **gallery:** fixes gallery item preview ([#629](#629)) ([3272fbc](3272fbc)), closes [#597](#597) [#526](#526)
* **groups:** fixes default value for groups inheritFrom ([#628](#628)) ([d80f5ef](d80f5ef)), closes [#627](#627)
* **loop:** adds context to update method ([#641](#641)) ([1178273](1178273))
* **output-window:** Set proper encoding ([#634](#634)) ([41335b3](41335b3))
* **prop-default:** updates default prop check ([#646](#646)) ([0bc4e10](0bc4e10)), closes [#644](#644)
* **rangecontrol:** fixes an infinite update loop ([#643](#643)) ([334e024](334e024))
* **release:** use node 14 ([dd05d88](dd05d88))
* removes menuBar from appearing on output windows ([#632](#632)) ([5d6ef6a](5d6ef6a))
* slow post message ([#623](#623)) ([cab2b82](cab2b82))
* **slow-start-up:** refactors worker/modv lifecycle and module loading ([#618](#618)) ([ea8a15d](ea8a15d)), closes [#617](#617)
* **smoothing:** fixes inputLink smoothing ([#630](#630)) ([24864e2](24864e2))
* **splash-screen:** moves styles into main app.vue only ([#638](#638)) ([a90a09a](a90a09a))

### Features

* **isf:** remove unused error message & temp folder from media manager ([#636](#636)) ([4dfb299](4dfb299))
* **kick:** adds option for kick as inputlink and adds u_kick uniform for shaders ([#616](#616)) ([6aeac7f](6aeac7f))
* **offline-support:** Include raster.css + fonts ([#622](#622)) ([ef217bb](ef217bb)), closes [#621](#621)

### Performance Improvements

* **module-inspector:** changes v-for key from id to index ([#625](#625)) ([c79cb81](c79cb81))
@2xAA
Copy link
Member Author

2xAA commented Nov 9, 2021

🎉 This PR is included in version 3.19.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@2xAA 2xAA added the released label Nov 9, 2021
2xAA pushed a commit that referenced this pull request Jan 7, 2022
# [3.19.0](3.18.0...3.19.0) (2021-11-09)

### Bug Fixes

* **color-picker:** fixes colorPicker ([#631](#631)) ([293e223](293e223))
* **font-list:** updates dependancy ([#624](#624)) ([5aeecae](5aeecae))
* **gallery:** fixes gallery item preview ([#629](#629)) ([3272fbc](3272fbc)), closes [#597](#597) [#526](#526)
* **groups:** fixes default value for groups inheritFrom ([#628](#628)) ([d80f5ef](d80f5ef)), closes [#627](#627)
* **loop:** adds context to update method ([#641](#641)) ([1178273](1178273))
* **output-window:** Set proper encoding ([#634](#634)) ([41335b3](41335b3))
* **prop-default:** updates default prop check ([#646](#646)) ([0bc4e10](0bc4e10)), closes [#644](#644)
* **rangecontrol:** fixes an infinite update loop ([#643](#643)) ([334e024](334e024))
* **release:** use node 14 ([dd05d88](dd05d88))
* removes menuBar from appearing on output windows ([#632](#632)) ([5d6ef6a](5d6ef6a))
* slow post message ([#623](#623)) ([cab2b82](cab2b82))
* **slow-start-up:** refactors worker/modv lifecycle and module loading ([#618](#618)) ([ea8a15d](ea8a15d)), closes [#617](#617)
* **smoothing:** fixes inputLink smoothing ([#630](#630)) ([24864e2](24864e2))
* **splash-screen:** moves styles into main app.vue only ([#638](#638)) ([a90a09a](a90a09a))

### Features

* **isf:** remove unused error message & temp folder from media manager ([#636](#636)) ([4dfb299](4dfb299))
* **kick:** adds option for kick as inputlink and adds u_kick uniform for shaders ([#616](#616)) ([6aeac7f](6aeac7f))
* **offline-support:** Include raster.css + fonts ([#622](#622)) ([ef217bb](ef217bb)), closes [#621](#621)

### Performance Improvements

* **module-inspector:** changes v-for key from id to index ([#625](#625)) ([c79cb81](c79cb81))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

modV start-up is slow
2 participants