Skip to content

Add data-sync support for sequential script loading - #5945

Merged
knolleary merged 1 commit into
node-red:mainfrom
GogoVega:fix-load-scripts
Oct 6, 2026
Merged

knolleary merged 1 commit into
node-red:mainfrom
GogoVega:fix-load-scripts

Conversation

@GogoVega

Copy link
Copy Markdown
Contributor

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Proposed changes

By default, node and plugin scripts are loaded asynchronously. This can cause major initialization issues if a list of scripts is supposed to be loaded and executed synchronously.

Scripts marked with data-sync="true" are added to force a sequential loading queue.

For example:

<script src="foo.js" data-sync="true"></script>
<script src="bar.js" data-sync="true"></script>
<script src="baz.js" data-sync="true"></script>

The scripts will be loaded and executed sequentially: foo.js -> bar.js -> baz.js.

The next script is not started until the previous script has finished loading.

Checklist

  • I have read the contribution guidelines
  • For non-bugfix PRs, I have discussed this change on the forum/slack team.
  • I have run npm run test to verify the unit tests pass
  • I have added suitable unit tests to cover the new/changed functionality

@knolleary
knolleary merged commit 85549fb into node-red:main Oct 6, 2026
4 of 5 checks passed
@GogoVega
GogoVega deleted the fix-load-scripts branch October 6, 2026 15:41
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.

2 participants