Repository navigation
Conversation
Add the change document 2511-idevice-runtime-contract (proposal, spec, design, research and tasks) and three proposed ADRs: - ADR-2511-01: run every iDevice instance through one render lifecycle that ends in an `exe-idevice-rendered` DOM event. - ADR-2511-02: share one enhancement step between the editor and exported pages; enhancements take a context and are idempotent. - ADR-2511-03: own exported iDevice resources with a lifecycle shared with editions (the runtime counterpart of ADR-2293-01). Documentation only; adoption is planned in tasks.md. Closes #2511
Deploying exelearning with
|
| Latest commit: |
4a6be77
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://fc6cf1ad.exelearning.pages.dev |
| Branch Preview URL: | https://feature-2511-idevice-runtime.exelearning.pages.dev |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2513 +/- ##
=======================================
Coverage 92.25% 92.26%
=======================================
Files 479 479
Lines 89517 89517
=======================================
+ Hits 82584 82591 +7
+ Misses 6933 6926 -7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
Bundle ReportBundle size has no change ✅ |
ignaciogros
left a comment
There was a problem hiding this comment.
Thanks!
Could you please check if these details need to be fixed before moving the ADRs to Accepted?
- Where
enhance()lives:proposal.mdand the ADR table indesign.mdsay "incommon.js", butdesign.md§1 puts it in the separateexe_idevice_runtime.jsprecisely to keep it out ofcommon.js. - Editor after a save:
ADR-2511-02says the two editor methods become oneenhance(document)call, whiledesign.md§4 andtasks.mdstep 2 sayenhance(document)on page load plusenhance(node)after a save. Could the ADR say the same? - Scope of
destroy(node): the spec defines the instance as the.idevice_nodeand R7.2.4 drops jQuery data and events for its subtree, but the editor design callsdestroy(this.ideviceBody). Could you state that only the iDevice's content is cleaned, not the.idevice_nodeitself, so the handlers the editor binds to the node (drag, selection…) survive?
Additional comment:
The "Left out" note in the PR description about ADR-2510-01 is outdated: #2512 is merged and the files already link it.
- enhance() lives in the shared runtime script, not in common.js. - ADR-2511-02: the editor enhances the whole page on load and only the saved iDevice after a save, as design.md and tasks.md already said. - Define the content root, and make destroy(node) clean only the instance's content: the editor's handlers on the .idevice_node survive.
|
Thanks, all four were right and are fixed in the latest commit:
|
Addressed in 0f-latest commit; see the reply above.
|
Moving this to v4.0.7: we agreed to review the architecture decisions together in that release, and this PR adds ADR-2511-01/02/03 alongside the runtime contract, so it will be reviewed then with the related records (ADR-2510-01, ADR-2293-01). |
Closes #2511
Thanks @ignaciogros for opening this and for spotting the pattern behind #2170 and #2510.
Problem
iDevice runtime scripts, the two hosts that drive them (
exe_export.json exported pages,IdeviceNode/IdevicesEnginein the editor) and the shared libraries have no written contract. Every enhancement and every teardown gets wired again case by case: #2170 (effects), #2510 (lightbox), #2271 / #2293 (edition teardown), and #2434 (the editor reloads the whole page after a remote edit because runtimes act page-wide).What this PR adds (documentation only)
Change directory
doc/architecture/changes/2511-idevice-runtime-contract/:proposal.md: motivation, problem, scope, goals and non-goals.spec.md: the contract, as numbered requirements (R2–R8), scenarios and acceptance criteria:$exe.ideviceRuntime.rendered(node, 'update');exe-idevice-renderedevent per instance andexe-idevices-renderedper page, replacing the 200 ms delays before print and search highlighting;$exe.ideviceRuntime.destroy(node)and an optionaldestroyRuntimehook;design.md: how it is built. A new host-neutral classic script,exe_idevice_runtime.js, is loaded by both hosts; it is needed becauseexe_export.jsis not loaded in the workarea. The design also covers the changes to each host, migration, security, accessibility, performance and testing.research.md: a survey of all 53 base iDevices and the shared enhancements, with file and line evidence. It covers which runtimes act page-wide, which work asynchronously afterinit, which resources leak, and which enhancements are not idempotent.tasks.md: a phased adoption plan, one PR per step. The runtime core and the enhancement list come first, then the editor host, then thejsonOnlyIdevicesone by one, then the gamification helpers. The HTML-type games get a separate follow-up issue.ADRs, all
Proposed:ADR-2511-01: run every iDevice instance through one render lifecycle that ends in a DOM event.ADR-2511-02: share one enhancement step between the editor and exported pages. It builds onADR-2510-01from Export: bindlightboxlinks in iDevices rendered after page init. #2512.ADR-2511-03: own exported iDevice resources with a lifecycle shared with editions. It is the runtime counterpart ofADR-2293-01.Decisions to review
CustomEvent(exe-idevice-rendered, withreasonandstatusindetail).initmay return a Promise, which the host waits for under a timeout. Sync iDevices need no change.$exe.ideviceRuntime.enhance(context)in a file both hosts load.afterIdeviceRendered()stays as a wrapper around it, and the two copies ofloadLegacyExeFunctionalitiesExport()collapse into it.ResourceLifecyclewith the same API asEditionLifecycle, one per instance, plus an optionaldestroyRuntime(ideviceId, node)hook. The name avoidsdestroy, which the 3D viewer runtime and SimpleLightbox already use.EditionLifecyclewill delegate to it so the two lifecycles cannot drift apart.Left out
tasks.md, starting after this is accepted and Export: bindlightboxlinks in iDevices rendered after page init. #2512 is merged.: Export: bindADR-2510-01not yet listed in the metadatalightboxlinks in iDevices rendered after page init. #2512 is merged, and the proposal and ADR-2511-02 now link it.jsonOnlyIdevicesshould move into each iDevice'sconfig.xml(left as an open item in tasks).ideviceskill gets its "Runtime lifecycle" section when step 1 lands, so it never describes an API that does not exist yet.Validation
make architecture-check:Architecture records OK — 37 records, 7 changes.doc/architecture/adr/andchanges/are excluded from MkDocs navigation (mkdocs.yml).