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

Dependency update (FVTT types v9, etc) #392

Merged
merged 9 commits into from
Jun 17, 2022
Merged

Conversation

rsek
Copy link
Collaborator

@rsek rsek commented Jun 16, 2022

  • after upgrading the FVTT types to v9, building with any of the quill-based components causes tsc to segfault
  • commenting them out prevents the segfault, though it throws some errors due to the changes in the v9 API. this PR resolves those type discrepancies, but i haven't figured out how to fix quill yet
  • i've been doing various dependency updates to see if any of those resolve the problems with quill... but i have yet to test this by attempting to build with quill-based components again, because...
  • webpack produces an error that i assume is unrelated to quill. however, the sheet appears fully functional (haven't done in-depth testing)? not sure what that's about.

Screen Shot 2022-06-16 at 3 23 45 AM

most promising line of inquiry ive turned up is this: chimurai/http-proxy-middleware#171

Screen Shot 2022-06-16 at 3 26 06 AM

@rsek
Copy link
Collaborator Author

rsek commented Jun 16, 2022

oh, btw, this PR also adds @typescript/analyze-trace as a devDep. more info here: https://github.com/microsoft/TypeScript/wiki/Performance-Tracing

anyways, i should probably stop for the night; if webpack proves too stubborn, i can just roll back that upgrade

Copy link
Owner

@ben ben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for diving down the rabbit hole! The type updates look great, and it seems like we can still use Quill, we just have to avoid compiling Javascript? Not sure what's causing that.

tsconfig.json Outdated
@@ -26,5 +27,5 @@

"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
},
"exclude": ["node_modules", "webpack.config.js"]
"exclude": ["node_modules", "webpack.config.js", "**/*.js"]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be the thing that makes the compile succeed. Keep this and turn Quill back on everywhere, and it should work.

@@ -142,7 +142,7 @@
</section>

<section class="flexcol">
<quill-editor v-model="actor.data.description" />
<!-- <quill-editor v-model="actor.data.description" /> -->
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Roll this back, should be fine.

@@ -1,6 +1,6 @@
<template>
<div class="flexcol">
<quill-editor v-model="actor.data.notes" />
<!-- <quill-editor v-model="actor.data.notes" /> -->
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Roll this back, should be fine.

@@ -132,4 +132,4 @@ export default {
},
},
}
</script>
</script> -->
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git checkout main -- src/module/vue/components/quill-editor/ should be fine.

@@ -111,7 +111,7 @@
<progress-controls :actor="actor" />
</div>

<quill-editor theme="bubble" v-model="actor.data.biography" />
<!-- <quill-editor theme="bubble" v-model="actor.data.biography" /> -->
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Roll this back, should be fine.

@ben
Copy link
Owner

ben commented Jun 16, 2022

Not sure what's causing your web socket error. Mind works okay using Chrome.

@rsek
Copy link
Collaborator Author

rsek commented Jun 17, 2022

instead of excluding JS files manually, i've flipped the switch on tsconfig's checkJs option instead. webpack.options.js still needs to be excluded manually to prevent tsc from complaining, though. i've also updated a few more straggler dependencies where major semvers didn't introduce breaking changes that impact us.

webpacks' gripes about websocket are still present. chromium causes more verbose errors for me than FF did:

Screen Shot 2022-06-16 at 5 03 46 PM

(always two there are. no more, no less)

but the sheet itself still seems to work fine. weird. i have no evidence to support it but i'm inclined to blame monterey. ;) either way, i doubt it'll break anything user-facing, so i'll call this PR ready.

@rsek rsek marked this pull request as ready for review June 17, 2022 00:07
@rsek
Copy link
Collaborator Author

rsek commented Jun 17, 2022

i'm doing some housekeeping on the linter config to cut down on the noise - should i add ignore directives to these two files, use the suggested fixes, or something else?
Screen Shot 2022-06-16 at 6 27 33 PM

@rsek rsek requested a review from ben June 17, 2022 02:50
@rsek
Copy link
Collaborator Author

rsek commented Jun 17, 2022

i just noticed that dataforgedimport.js and dataswornimport.js are broken by some changes to how the marked dependency is organized. i'll rewrite them to accomodate. i'm thinking typescript, as they're fairly complex and aren't run frequently, thus the added compile time when running them isn't a huge deal.

@rsek
Copy link
Collaborator Author

rsek commented Jun 17, 2022

actually, it might be fine - i forgot CJS require handles those a bit differently 🤔. might bear a TS rewrite anyways though.

@ben
Copy link
Owner

ben commented Jun 17, 2022

I'll save you some effort: those two are the old way of importing, and should be retired. dataforgedimport.js is only used for setting truths at this point; the rest of the import machinery is in dataforged.ts. dataswornimport.js can be retired (I think) when rsek/dataforged#47 (comment) is resolved. No sense doing a hull paint job on the Titanic.

Copy link
Owner

@ben ben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it. Ready to merge?

@@ -416,7 +417,7 @@ export async function rollAndDisplayOracleResult(
}

// Do the random roll
const tableDraw = await (table as any).draw({ displayChat: false })
const tableDraw = await(table).draw({ displayChat: false } as RollTable.DrawOptions)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well that's an unfortunate typing. Too bad this call doesn't accept a Partial<RollTable.DrawOptions>.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ugh, yeah, that one made me grind my teeth. according to the API docs, the props on RollTable.DrawOptions are all optional (and, i mean, the rolls work), so i'm guessing this is just an error in the LoFD typings package. TBH, i'm surprised that they're not just extracting them directly from FVTT's source to avoid that kind of error, but maybe there's a good reason not to do that.

either way, i'll add a note about it... and i should probably open a PR there, too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, should be good to merge now 👍

@ben ben merged commit 8eb3bed into ben:main Jun 17, 2022
@ben ben mentioned this pull request Jun 17, 2022
2 tasks
@rsek rsek deleted the dependency-update branch June 17, 2022 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants