Page 1 of 1

Control JS Load Order (Before/After SpiderBasic Libraries)

Posted: Mon Apr 13, 2026 7:12 pm
by skinkairewalker
Hey everyone,

I’d like to suggest a feature that could really improve flexibility when integrating external JavaScript libraries with SpiderBasic.

As it stands, external JS files seem to be loaded after SpiderBasic’s internal libraries. However, some libraries
example : especially rendering engines like Babylon.js (need to be loaded before in order to work properly, since other parts of the app may depend on them being available during initialization ) .

Suggestion:
Add an option/configuration to control when external JS files are loaded:

Code: Select all

something like this

HeaderSection.a << ---- a == After
<meta name="description" content="babylon.js">
<script src="https://cdn.babylonjs.com/babylon.js"></script>
<canvas id="renderCanvas"></canvas>
EndHeaderSection

HeaderSection.b << ----- b == Before
<meta name="description" content="babylon.js">
<script src="https://cdn.babylonjs.com/babylon.js"></script>
<canvas id="renderCanvas"></canvas>
EndHeaderSection

Before SpiderBasic libraries
After SpiderBasic libraries (current behavior)

This could be implemented as a simple flag when including scripts, or as a project-level setting.

Benefits:

Better compatibility with modern JS libraries
More control over initialization order
Easier integration with external frameworks and engines

I believe this would open up a lot of possibilities for developers using SpiderBasic alongside other technologies.

Do you think this would be useful?

Re: Control JS Load Order (Before/After SpiderBasic Libraries)

Posted: Wed Apr 22, 2026 2:26 am
by Danilo
Controlling the order is a good idea. Maybe a priority system.

Code: Select all

IncludeJS „file.js“ [, optionalPriority]

IncludeJS „file.js“, 1
XIncludeJS „file2.js“, 501
SB libs are at priority 500. Priority <500 is loaded before SB libs, Priority >500 after.

Could there be an option to exclude the Dojo/GUI system entirely,
to get only the SB base system? Like a „SB console mode“.
Plain SB/JS/HTML coding without including all the SB GUI libs?

Just using plain Babylon.js, Three.js and other 3rd-party libs, excluding the SB GUI.