Any chance of replacing the MD-based JS injection with defined JS script locations?

clearly JS works, because the injection approach works, but it's a bit crazy to have to roundabout it, can there be an object prop that resolves down into a <script> tag or similar?

Examine @bmusson's open source work for ideas and existing solutions.

3 Likes

Oh, yeah, I'm aware of the...i guess one would call it literature/prior art here, just wondering if there's any chance of it getting Official Blessing/position in the designer

Perspective has existed for several years now, and it is pretty obvious that the limitation is not technical. It is policy. Considering the likely impact on tech support, the deliberate non-support is easily understood. Don't hold your breath waiting on any blessing.

4 Likes

Yep, makes sense, ty

I gotta bookmark this post too :smiley:

1 Like

I’ve got several related WIP features in Embr-Periscope.
There’s no timeline or even guarantee they will ever be finished.

  1. feat/periscope/web-library

    • Adds a location in the Ignition install directory where users can put JavaScript files to load into Perspective.
    • Adds the ability to load these files from any of Embr’s JavaScripting contexts (runJavaScriptAsync/component JavaScript proxies/prop function callbacks).
    • This feature is complete and working, I’m just not convinced yet that I want to merge it.
  2. feat/periscope/client-script

    • Adds a resource type and UI for editing JavaScript files within the designer.
    • Adds the ability to load these files from any of Embr’s JavaScripting contexts.
    • This feature is at a “barely” MVP stage.
    • I’d really like to have TypeScript support and Node module support (or at least leave the door open to add them in the future), but this makes things way more complicated.
  3. Web Jar Support

    • This one is only a mental WIP :wink:
    • I think it’d be nice to de-couple 3rd party web resources from a specific module version.
    • For example, I don’t really want to release a new version of Embr-Charts every time a new minor release of Chart.js/ApexCharts comes out.
    • I want users to have more control over the versions of the web resources used in their installations.
    • The idea is to add a gateway UI for uploading and managing WebJars. WebJars are publicly available and also very simple to DIY.
    • These WebJar resources would be used by components, as well as made available in Embr’s JavaScripting contexts.
    • This would also allow for multiple modules to easily use the same 3rd party web resources without collision/version mismatch issues.
2 Likes