fix: pin dll module deps to exact versions, not carets PIE-923 - #3104
Merged
Conversation
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.
https://illuminate.atlassian.net/browse/PIE-923
@pie-element/extended-text-entry@15.1.10/module/print.js crashes with "Cannot read
properties of null (reading 'useState')" -- React 18's resolveDispatcher() returning
null, the signature of two copies of React on the page.
print.js imported React from @pie-lib/shared-module@^5.2.13, while the file jsDelivr
serves for @pie-lib/editable-html-module@^7.1.15 imported it from
@pie-lib/shared-module@^5.2.14. Both carets resolve to the same 5.2.14 file, byte for
byte, and it still crashed: the browser keys module identity on the resolved URL string,
so ^5.2.13 and ^5.2.14 are two different modules regardless of what they serve. The
version substring is the only part of that URL that can drift, and exact versions are the
only spelling that cannot.
That is why this broke retroactively rather than at publish time. ETE 15.1.10 shipped Aug
13 against the 5.2.13 dll set and worked for six days, because editable-html-module@^7.1.15
then served 7.1.15, whose bytes also said ^5.2.13. The 5.2.14 lib set published Aug 19
replaced what that caret serves, and the new bytes said ^5.2.14 -- disagreeing with the
^5.2.13 frozen into print.js.
pie-lib has already published the dll set as new majors under range: 'exact', so the
carets baked into already-published elements cannot reach them and every
currently-working element stays frozen. This is the pie-elements half, and both halves
have to land together. A mixed regime is deterministically broken rather than
intermittently, which is worse than today: exact element edges against the old caret libs
make the element say shared-module@5.2.14 while the immutable editable-html-module@7.1.16
says ^5.2.14; caret element edges against the new exact libs make the element say ^6.0.0
while editable-html-module@8.0.0 says 6.0.0. Two strings either way.
Verified across all 26 built elements, 137 artifacts: 11 distinct import specifiers in
total, one spelling per dll target per element, no ^ or ~ anywhere, nothing left on the
5.2.x / 7.1.x / 4.0.x lines, and React resolving to exactly one URL,
@pie-lib/shared-module@6.0.0. hotspot and drawing-response read React internals off that
same shared import -- react-konva's react-reconciler, not a second React.
Only the eight print-enabled elements ship module/ bundles, since scripts/build runs pslb
for packages declaring exports['./print'], so those are what need republishing:
complex-rubric, ebsr, explicit-constructed-response, extended-text-entry, math-templated,
multiple-choice, passage, rubric.
@pie-lib/graphing-module stays absent from the libs list; graphing and
graphing-solution-set keep bundling @pie-lib/graphing and @pie-lib/plot themselves.
Sharing it is a size win, not a correctness fix, and it would change those two elements'
bundles far more than the others.