Skip to content

Commit b01086e

Browse files
authored
Merge pull request #666 from andreahlert/fix/deferred-plugin-loading
Thank you!
2 parents 8d3d3e4 + 1226279 commit b01086e

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

β€Žsrc/_hyperscript.jsβ€Ž

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,14 @@ if (typeof document !== 'undefined') {
180180
})
181181
);
182182

183-
// Evaluate loaded scripts
184-
scriptTexts.forEach(sc => _hyperscript(sc));
185-
186-
// Wait for DOM ready, then initialize
183+
// Wait for DOM ready, then parse external scripts and initialize.
184+
// Parsing is deferred until after ready() so plugins loaded via
185+
// synchronous <script> tags (e.g. hdb.js) have registered their
186+
// commands before behavior files are evaluated.
187+
// See https://github.com/bigskysoftware/_hyperscript/issues/533
187188
ready(() => {
189+
scriptTexts.forEach(sc => _hyperscript(sc));
190+
188191
_hyperscript.process(document.documentElement);
189192
document.dispatchEvent(new Event("hyperscript:ready"));
190193

0 commit comments

Comments
 (0)