Skip to content

WickPM - #197

Open
hobbsythe6th wants to merge 58 commits into
Candlestickers:developmentfrom
hobbsythe6th:wickpm
Open

WickPM#197
hobbsythe6th wants to merge 58 commits into
Candlestickers:developmentfrom
hobbsythe6th:wickpm

Conversation

@hobbsythe6th

Copy link
Copy Markdown
Contributor

WickPM is a package manager 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 .

…e terminal up with annoying deprecation warnings
@InternetAstronaut

Copy link
Copy Markdown

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 import from scripts.

@hobbsythe6th

Copy link
Copy Markdown
Contributor Author

No, you can't, you get main.381ffc55.js:2 Error: Unexpected token on line 1 in script "default".
at onError (main.381ffc55.js:2:2845680)
at Wick.Project.stop (wickengine.js:51318:47)
at wickengine.js:51234:14
a. @ main.381ffc55.js:2
main.381ffc55.js:2 Error: Unexpected token on line 1 in script "default".
at onError (main.381ffc55.js:2:2845680)
at Wick.Project.stop (wickengine.js:51318:47)
at A_.componentDidUpdate (main.381ffc55.js:2:2845971)
at ca (main.381ffc55.js:2:1372514)
at wl (main.381ffc55.js:2:1390121)
and well you get the idea
from just trying to run import _ from 'https://esm.sh/lodash'; in a script.
As for the name, it just popped into my head before I started so I stuck with it, but I'm open to alternatives.

@InternetAstronaut

Copy link
Copy Markdown

I think it's better to do this as a ScriptAsset (accepting JS files) class which the project runs every single one loaded when starting for the first time. We could also have a ScriptAsset.prototype.run(), which would allow for script assets to be used as mods for games.

@hobbsythe6th

hobbsythe6th commented Aug 23, 2026

Copy link
Copy Markdown
Contributor Author

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.

@InternetAstronaut

Copy link
Copy Markdown

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 Script class, which would replace the script objects inside Tickable objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants