-
Notifications
You must be signed in to change notification settings - Fork 234
Quasar upgrade #1823
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
base: develop
Are you sure you want to change the base?
Quasar upgrade #1823
Conversation
I think you deleted some files that shouldn't have been deleted in 06adc95, like the babel and jest config files. Also, you should probably update babel because you're using a version from roughly 6 years ago. |
This was intentional as we no longer need Jest or Babel. It now uses Vite and so we're using Rollup, and for tests we're able to switch to Vitest or just use
If anything I just need to remove the dependency for it now. I'll do this as part of a review round. |
Oh ok. Nevermind then |
Is the clearing of the configurations supposed to be sort of like a redtag? To force the unit tests to fail until those dependency changes are addressed? Like you said, the dependencies are still in
|
"@babel/core": "^7.4.0", | |
"@babel/preset-typescript": "^7.14.5", |
Lines 91 to 92 in 04a868a
"babel-core": "^7.0.0-beta.3", | |
"babel-jest": "^27.0.2", |
Lines 100 to 102 in 04a868a
"eslint-plugin-jest": "^28.8.3", | |
"identity-obj-proxy": "^3.0.0", | |
"jest": "^29.7.0", |
Line 116 in 04a868a
"vue-jest": "^3.0.0", |
And the test:unit:ci
script still runs jest --ci
:
Line 22 in 04a868a
"test:unit:ci": "jest --ci", |
Which given that is called in the github workflow:
r2modmanPlus/.github/workflows/test.yml
Lines 37 to 39 in 04a868a
run: > | |
node test/folder-structure-testing/populator.mjs && | |
yarn run test:unit:ci |
This results in the two starting unit tests failing, while the latter two build tests succeed.
Along the same vein, would the unit tests like the ones in https://github.com/ebkr/r2modmanPlus/tree/develop/test/jest/__tests__
need to be migrated to vitest?
Honestly no, it's just that I'd like this reviewed before I make any further changes. Tests aren't essential to the Quasar upgrade changes and can be done separately. They're left-over for now because I haven't gotten to the test changes yet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- A collection of artisanal comments with varying importance
- I omitted nitpicks like missing semicolons and stuff like that, and ignored pretty much all CSS changes
- There were some TODO comments and console loggings that seemed they were intended to be cleaned up before a PR
- My main interest at this point is:
- Getting the project to run locally
- Will TSMM work? Do you have a plan for
- After the changes there seems to be a lot of warnings/errors on my IDE (Cursor) that bury the actual problems and weaken the type safety. Ideally those would be resolved one way or another and sooner rather than later
@@ -192,6 +176,28 @@ export const TsModsModule = { | |||
}, | |||
updateDeprecated(state, allMods: ThunderstoreMod[]) { | |||
state.deprecated = Deprecations.getDeprecatedPackageMap(allMods); | |||
}, | |||
prewarmCacheMod(state: State, mods: ThunderstoreMod[]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made an earlier comment about this method "no longer" being about prewarming the cache, but I confused it with the old prewarmCache
below. Still, this is more about updating the cache so another name might be better?
@@ -192,6 +176,28 @@ export const TsModsModule = { | |||
}, | |||
updateDeprecated(state, allMods: ThunderstoreMod[]) { | |||
state.deprecated = Deprecations.getDeprecatedPackageMap(allMods); | |||
}, | |||
prewarmCacheMod(state: State, mods: ThunderstoreMod[]) { | |||
const localState = new Map<string, CachedMod>(state.cache.entries()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering if changing from mutating the cache Map to duplicating it might lead to performance issues on large profiles or race conditions if the commit is called in rapid succession 🤷🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change was to mitigate a performance issue because it directly affects the cachedMod
getter - Whenever the cache updates, the getter does a refresh too.
It's a valid concern about race conditions. I think we have the following options:
- Wrap in a lock
- IMO less ideal, but makes it easy to manage
- Diff the cache and only re-set the changes - I'm unsure if calling
.set
re-triggers an update if the value is the same. - Keep the behaviour the same as before (always just call
.set
) - Something else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well to think of it, the mutation is synchronous and the environment is single-threaded by nature, and only other place that changes state.cache
is clearModCache
mutation, so maybe we're safe in race condition regard?
I don't know enough TS or JS to really make many meaningful comments here but just a minor BTW: In my local fork (of course not including this PR) I updated typescript to the latest 4.9.x and everything worked fine; in case doing so here might make any refactorings easier. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Generally speaking it seems there's still some places were code is wrapped in new promises explicitly, and where then-chains are used when not necessary, It's probably apparent from earlier comments but I'm not personally a fan of that approach. Not a blocker for this PR but we should probably at least have a discussion about the subject on how the matter should be handled in code and code reviews going forward.
- When manually testing the dev build, page transitions feel a bit sluggish compared to pre-upgrade version. Like they take some 100-200ms longer. I might be hallucinating it. Or it could be vite doing some stuff JIT. Or the changes to the router? Have you noticed this?
src/r2mm/launching/instructions/instructions/loader/CustomInstructions.ts
Show resolved
Hide resolved
No you're absolutely correct. I spent a while playing around with it and it appears to be a VueX issue which is what prompted me to bring up the discussion internally. To recap: MobX has a greater overhead in terms of developer implementation time however the time to update is double that of globally exported reactives, but still more than acceptable at 10ms. |
a6a2cd3
to
0e36b51
Compare
So... I took a stab at removing all those promises within promises within promises and here's what I came up with. For this patch, there could of course be errors (I'd be surprised if there aren't really) but I tried to launch, create a new profile, download some mods and export the profile as a file and seemingly, all that worked. At the very least, it might give you a base to get rid of all those extra |
Instead of doing a patch, do the following:
That way:
|
5eee176
to
56a8e0b
Compare
- Refactored stub providers from Jest to Vitest
- DownloadModule.ts duplicate action - Splash.vue formatting - Profiles.vue unused imports
777cfe4
to
dad6801
Compare
Upgrades to the latest version of Quasar, which gives us the following benefits:
There are an insane number of files changed. This PR is best reviewed on a per-commit basis, with comments addressing the relevant files on the main PR rather than individual commits, as there may be changes later that have already been reflected.
A large number of these files won't actually need much reviewing as they are things such as moved files (EG: Every game image has been moved), or imports being changed to use our new IPC based calls.