chore: bump dev dependencies (eslint 10, vite 8, typescript 6, jsdom 29)#30
Merged
Conversation
Picks up the 17-package dev-dependencies group Dependabot proposed in #25 (docxodus excluded — main already carries 7.0.1 from #28). Fixes needed to land cleanly: - eslint-plugin-react-hooks bumps to 7.1.1 (forced by eslint 10's peer range) and enables react-hooks/static-components, which flagged Toolbar/SettingsModal being redefined as new component types on every DocumentViewer render. Fixed by calling them as plain functions (renderToolbar()/renderSettingsModal()) instead of JSX components — same output, but React no longer remounts that subtree every render. - Same eslint-plugin-react-hooks bump enables react-hooks/set-state-in-effect. The worker-init effect's workerLoading is now derived from workerReady/workerError instead of tracked as separate state, which also fixes a staleness bug where workerLoading could get stuck if useWorker toggled off mid-flight. The auto-convert effect's isConverting can't be derived without breaking controlled-html mode, so that one instance is suppressed with a comment explaining why. - TypeScript 6.0 requires tsconfig.lib.json's rootDir to be explicit instead of inferring it from outDir + include.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Picks up the 17-package dev-dependencies group Dependabot proposed in #25, which was failing CI and had drifted out of mergeable state (conflicts with main after #28).
docxodusis excluded here — main already carries 7.0.1 from #28/#29.This closes #25 (superseded).
Why this needed source changes, not just version bumps
react-hooks/static-components(new ineslint-plugin-react-hooks@7.1.1, force-installed as an eslint 10 peer dependency):ToolbarandSettingsModalinDocumentViewer.tsxwere defined asconst Toolbar = () => (...)inside the component body and invoked as<Toolbar />— a new component type created on every render, which resets any DOM/focus state in that subtree each time. Fixed by calling them as plain functions (renderToolbar()/renderSettingsModal()) instead of JSX elements — identical output, but no longer treated as a distinct component type.react-hooks/set-state-in-effect(same plugin bump) flagged two effects:workerLoadingis now derived (useWorker && isWorkerSupported() && !workerReady && !workerError) instead of tracked as separate state set synchronously in the effect. Bonus: this also fixes a pre-existing staleness bug whereworkerLoadingcould get stucktrueifuseWorkertoggled off mid-flight.convert(file):isConvertingis genuinely imperative state here and can't be cleanly derived without breaking controlled-htmlmode (a parent can keephtmlnon-null across a reconvert). This one is suppressed witheslint-disable-next-lineand a comment explaining why — verified there's no behavior-preserving derivation, and confirmed a microtask-wrapper "fix" only fools the lint pattern-matcher without changing actual render timing, so rejected that in favor of an honest suppression.TypeScript 6.0 requires
tsconfig.lib.json'srootDirto be explicit rather than inferred fromoutDir+include. Added"rootDir": "src".Verification
npm test— 33/33 passingnpm run lint— cleannpm run build— lib + demo build succeednpm installresolves with 0 vulnerabilities (down from 13 on the old toolchain)