You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's not altogether obvious how to incorporate this in a plugin, partly because we use import.meta.url to fetch the nsd JSON file. If this is not handled correctly, it causes a load error.
So in an open-scd-core plugin which uses this library, it is important that these statement are correctly translated so that the paths are correct.
If using rollup, the plugin, "Import Meta Assets" does this very easily and is likely useful for other reasons as well.
The client should be able to decide when and how it loads these files.
Shouldn't the client just use the functions? If a file is required to use this library, I'd normally be happy to bundle it into my dependencies and tree-shake it as required... ⁉️
The problem is that you are making assumptions of the client's capabilities.
Usually it falls to the client to orchestrate its libraries. Which one does what, and when.
I usually do not like if libraries do something without me knowing it or having the ability to control it.
I think libraries should be configured and framework should work with conventions.
It's not altogether obvious how to incorporate this in a plugin, partly because we use
import.meta.url
to fetch thensd
JSON file. If this is not handled correctly, it causes a load error.So in an open-scd-core plugin which uses this library, it is important that these statement are correctly translated so that the paths are correct.
If using rollup, the plugin, "Import Meta Assets" does this very easily and is likely useful for other reasons as well.
https://modern-web.dev/docs/building/rollup-plugin-import-meta-assets/
I've incorporated this into my oscd-subscriber-later-binding plugin in the following commit: danyill/oscd-subscriber-later-binding@f101019
We should document what is required for new users of this library.
The text was updated successfully, but these errors were encountered: