Skip to content

HTML5: document host-set Module opt-outs (defold/defold#12396 follow-up)#635

Open
birdingman0626 wants to merge 1 commit into
defold:masterfrom
birdingman0626:dmloader-host-module-opt-outs
Open

HTML5: document host-set Module opt-outs (defold/defold#12396 follow-up)#635
birdingman0626 wants to merge 1 commit into
defold:masterfrom
birdingman0626:dmloader-host-module-opt-outs

Conversation

@birdingman0626
Copy link
Copy Markdown

Follow-up documentation for defold/defold#12396, which expands dmloader.js to respect six host-set properties on the global Module object:

  • Module.isWASMPthreadSupported
  • Module.isWebGL2Supported
  • Module.webGLContextAttributes
  • Module.webGLExtensionFilter
  • Module.showButtonStrip
  • Module.autoReloadOnWebGLContextRestore

Each is captured before the loader's own var Module = {...} redefinition and applied in an IIFE that runs at the same site. Default behaviour is byte-identical when nothing is pre-set.

This PR adds a new "Host-set Module properties" subsection to docs/en/manuals/html5.md, placed between the existing "Engine arguments" and "Query arguments in the URL" subsections under "Passing arguments to an HTML5 game". The new content includes:

  • The example shape (a var Module = { ... }; block before the <script src=\"dmloader.js\"> tag).
  • A per-property table with the type constraint, the effect, and the concrete failure mode each opt-out addresses.
  • Two callouts: the let vs var binding gotcha (top-level let Module is invisible to the loader's var Module), and the strict sentinel-value semantics (=== false / === true / function typeof, no coercion).

Should land after defold/defold#12396 merges, since this references behaviour the engine doesn't have yet. Adjustable to whatever the final API surface looks like if the engine PR shrinks during review.

PR checklist

dmloader.js now respects six host-set properties on the global
Module object when they're declared before <script src="dmloader.js">
loads (defold/defold#12396). Document the full surface — pthread,
WebGL2, context attrs, extension filter, button strip, context-loss
recovery — in the HTML5 manual under a new "Host-set Module
properties" subsection, between Engine arguments and Query
arguments. Includes the example shape, the per-property reference
table, and the two important notes (let-vs-var binding, strict
sentinel checks).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant