You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Mixed per-document doenetmlVersions in one assignment load multiple distinct 29 MB standalone bundles — warn or normalize #39
Each document in an assignment carries its own version (singleDocState.ts:22), passed per-item as doenetmlVersion={source.version} (SingleDocActivity.tsx:161). In @doenet/doenetml-iframe this selects the CDN bundle per iframe (https://cdn.jsdelivr.net/npm/@doenet/standalone@<version>/doenet-standalone.js, with autodetect-from-source also possible). An assignment mixing versions therefore downloads and parses several distinct ~29 MB standalone bundles — each version is a separate CDN cache entry and a separate parse per iframe.
Note createSourceHash deliberately strips version before hashing (activityState.ts:762-779), so saved state already survives a version change.
Proposed change
At minimum, detect mixed versions in one assignment and emit a console warning naming the versions involved.
Preferably, offer a normalization option (assignment-level version override, defaulting to the newest compatible version present) so one bundle serves the whole assignment. Since state hashing ignores version, normalization does not invalidate student state; the risk to evaluate is behavioral differences between DoenetML versions for older documents.
Impact
Prevents the worst-case bundle multiplication on heterogeneous assignments; keeps memory/parse costs at one bundle per page rather than one per version.
The PR reports mixed per-document DoenetML versions to the containing page through a new typed reportWarningsCallback prop (ActivityViewerWarning[], first member { type: "mixedDoenetmlVersions", versions: string[] }), reported once per distinct source analysis; a console.warn is still emitted for developers, and the README documents the bundle-multiplication cost and the normalization path.
As discussed here, automatic version normalization was a deliberate non-choice — rendering older documents under a newer version can change their behavior, so it stays the consumer's explicit decision (normalize version in the source; saved student state survives because its hash already ignores version). The "at minimum, warn" bar is met and the "preferably normalize" option was consciously left to the consumer, so this is resolved.
Closing manually: #43's description used "Implements #39" rather than a closing keyword, so GitHub didn't auto-close it on merge.
Activity
Report mixed DoenetML versions to the containing page
Report mixed DoenetML versions to the containing page
dqnykamp commentedon Jul 13, 2026
Implemented by #43 (merged in a4a5853).
The PR reports mixed per-document DoenetML versions to the containing page through a new typed
reportWarningsCallbackprop (ActivityViewerWarning[], first member{ type: "mixedDoenetmlVersions", versions: string[] }), reported once per distinct source analysis; aconsole.warnis still emitted for developers, and the README documents the bundle-multiplication cost and the normalization path.As discussed here, automatic version normalization was a deliberate non-choice — rendering older documents under a newer version can change their behavior, so it stays the consumer's explicit decision (normalize
versionin the source; saved student state survives because its hash already ignoresversion). The "at minimum, warn" bar is met and the "preferably normalize" option was consciously left to the consumer, so this is resolved.Closing manually: #43's description used "Implements #39" rather than a closing keyword, so GitHub didn't auto-close it on merge.