Repository navigation
fix(html): exclude custom bundler from worker configuration - #1204
OKAN-SOFTWARE wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1204 +/- ##
==========================================
+ Coverage 93.77% 93.78% +0.01%
==========================================
Files 289 289
Lines 28813 28875 +62
Branches 2913 2916 +3
==========================================
+ Hits 27018 27081 +63
+ Misses 1773 1772 -1
Partials 22 22 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
| // The bundler runs on the main thread and contains non-cloneable functions. | ||
| workerConfigOmit: ['bundler'], |
There was a problem hiding this comment.
This is smart, but would it be smarter to just omit keys containing unclone-ables?
There was a problem hiding this comment.
Good point.
I considered automatic filtering, but my concern is that it could silently remove configuration values that workers actually need, particularly with nested objects.
I went with workerConfigOmit to make those exclusions explicit and predictable.
Each generator declares which options belong only on the main thread, while the remaining configuration stays intact.
Thanks
There was a problem hiding this comment.
it could silently remove configuration values that workers actually need
How? Workers can't need uncloneables, since they would fail to clone
There was a problem hiding this comment.
You're right — my wording was imprecise. Workers cannot receive uncloneable values through structured cloning.
My concern is that automatically dropping those values could hide configuration mistakes. A future option containing a function might require a different design, and silently removing it could produce unexpected behavior.
With workerConfigOmit, we explicitly exclude only bundler, which we've verified runs on the main thread. Unexpected uncloneable values still produce an error instead of being silently discarded.
I think that makes the behavior easier to maintain and debug.
ovflowd
left a comment
There was a problem hiding this comment.
SGTM but left a review comment
|
Apologies @OKAN-SOFTWARE, can you rebase? |
Signed-off-by: OKAN TIKTAS <346542017+OKAN-SOFTWARE@users.noreply.github.com>
1d9a266 to
4b122c7
Compare
Rebased onto the latest main and pushed the updated branch. The merge conflict is resolved. Thanks for the feedback and review! Stay Safe |
|
The latest CI results look good overall. Unit tests, E2E tests, linting, formatting, and documentation generation passed. The CodeQL TypeScript job failed during repository checkout ( I don't have permission to rerun the workflow. Could a maintainer please rerun the failed CodeQL job? Thank you! |
kgeminicdev
left a comment
There was a problem hiding this comment.
Checked the bundler's call sites to answer the auto-omit question: it's only read in html/generate.mjs on the main thread (buildServer, buildClient, and compile per page). Nothing under processChunk touches config.bundler, and it's the only html option typed to hold functions (virtualImports etc. are Record<string, string>), so ['bundler'] is the complete list today.
I'd keep it explicit. Auto-dropping uncloneable values would also drop a function from an option a worker does read, and turn today's loud DataCloneError into silently wrong output.
Description
Fix
DataCloneErrorwhen the HTML generator uses a custom bundler with parallel worker threads.The bundler is needed on the main thread but contains functions that cannot be cloned into worker messages.
Changes
workerConfigOmitsupport to generator metadata.@doc-kit/coreand@doc-kit/generator-react.Validation
GitHub Actions
gitexit code 128). Analysis did not start; maintainer rerun needed.Related Issues
Fixes #1201
Check List