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
Currently only javascript plugins can be loaded. However when implementing custom components and such, being able to inject css as well is preferable. Current obvious workaround is to load said css via entry point of plugin, but it's not ideal, since plugin have no clue where it is relative to IDE working directory (well, via Ide.inst.scripts clutch it can, but yeah - clutches).
What I propose:
Replace loadScript with loadPlugin method that also capable of loading css files. (Keeping loadScript for backward compat, just in case)
When presented with a string path, check file extension and load plugin as css stylsheet when extension is css.
Where file and type can be used as path to specified plugin file and it's type. js and css are just file paths that would be loaded with their respective types.
As a result, plugins that are purely css (or js) can be loaded as: ["plugin.css", { css: "plugin.css" }, { file: "plugin.css", type: "css" }]
And when plugin utilizes both, it can be logically joined in a single object: [ { js: "plugin.js", css: "plugin.css" } ].
P.S. I already kinda implemented it, so I can just make a PR, but want to discuss it first. I'm doubting the need in file/type part for example.
The text was updated successfully, but these errors were encountered:
Currently only javascript plugins can be loaded. However when implementing custom components and such, being able to inject css as well is preferable. Current obvious workaround is to load said css via entry point of plugin, but it's not ideal, since plugin have no clue where it is relative to IDE working directory (well, via Ide.inst.scripts clutch it can, but yeah - clutches).
What I propose:
loadScript
withloadPlugin
method that also capable of loading css files. (KeepingloadScript
for backward compat, just in case)css
.Where
file
andtype
can be used as path to specified plugin file and it's type.js
andcss
are just file paths that would be loaded with their respective types.As a result, plugins that are purely css (or js) can be loaded as:
["plugin.css", { css: "plugin.css" }, { file: "plugin.css", type: "css" }]
And when plugin utilizes both, it can be logically joined in a single object:
[ { js: "plugin.js", css: "plugin.css" } ]
.P.S. I already kinda implemented it, so I can just make a PR, but want to discuss it first. I'm doubting the need in
file
/type
part for example.The text was updated successfully, but these errors were encountered: