WickPM - #197
Conversation
…y exists todo: make uninstall() exist
|
I don't like the way WickPM works. Firstly, the name WickPM is misleading, it doesn't load scripts or objects made for Wick Editor. Secondly, I'm pretty sure you can just do |
|
No, you can't, you get main.381ffc55.js:2 Error: Unexpected token on line 1 in script "default". |
|
I think it's better to do this as a |
|
But then we'd have a MASSIVE boost in file size if we downloaded a lot of NPM packages like the old Wick Engine. My opinion is that script assets are definitely useful, but this would cut down on size if the majority of script assets are from NPM since we only really store the package names. |
My idea for script assets isn't to import them with the engine, but instead to provide an easy and simple way to run and execute JS code. I could even say it's better to make the actual 'running scripts' part another dedicated |
|
Even so, I still think this is a good feature. Our current code editor doesn't have |
WickPM is a package importer class that generates a script tag on the DOM to use to artificially construct esm.sh import statements, which are then attached to WickPM.imports . This PR has attached WickPM, WickPM.imports, and WickPM' s install/uninstall functions to the global API. It's also branched off the Rolldown migration branch of my fork (sorry), but the changed files from that are:
GlobalAPI.js,
WickPM.js,
Wick.mjs (some tiny import updates),
Editor.jsx,
and Project.js .
Read the diff here