msfssdk.js is used a lot, especially if you are utilising the MSFS Avionics Framework.
I also see it included in a lot of packages, which leads to a lot of issues due to differing versions floating around, package conflicts etc.
Is there a central repo where you can just include this from, like the base framework libraries for the UI or how you can pull a library in over the web via CDN with standard webdev?
Or is there some other way to pull this in from a single source of current truth?
We do not recommend referencing local package versions of the compiled framework (msfssdk.js in many packages, but is also bundled with avionics in other packages), as those can be different for different packages.
If you are developing an avionics plugin, you should use the Avionics Framework NPM package version that shipped with those avionics. You can see the current avionics source (and their respective package.json) for reference at GitHub - microsoft/msfs-avionics-mirror: MSFS Avionics Source Code Mirror
The Getting Started documentation (MSFS Avionics Framework | MSFS Avionics Frameworks and Instruments) on the framework docs website is a good place to start to get up and get a project rolling. Do note that while it can be used from vanilla JS without a build step, it is really intended to be used from a standard modern TS development pipeline and we definitely recommend using it in that way.
Actually you can use whatever you want for your application, from vanilla javascript to the msfs-sdk or other alternatives as long you define the right things for efb_api.
You can use the version you want of the msfs-sdk, bundle it in your app or use it in IIFE format. It doesn’t need to be the exact same version as the efb-os or efb-api is using.
I like the MSFS Avionics Framework approach, but my use case is a utility app so not sure it’s needed for it.
I’m also only using a small subset of the msfssdk.js, though important one (facilities and maybe FP).
Is it possible for me to strip out just the facilities code, or can it be implemented in a similar way directly using Coherent.js calls, for example?
Just seems a waste not to use msfssdk.js though, as it’s already there and working. Reinventing the wheel and all that!