Control JS Load Order (Before/After SpiderBasic Libraries)

Got an idea for enhancing SpiderBasic? New command(s) you'd like to see?
skinkairewalker
Posts: 125
Joined: Tue Jun 14, 2016 7:17 pm

Control JS Load Order (Before/After SpiderBasic Libraries)

Post 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?