-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why is code to work with scratch-js part of sb-edit? #4
Comments
The I think it's possible to set up the sb-edit library in a way that allows importing individual loaders/exporters (so you could import the stuff for dealing with sb2/sb3/scratchblocks/whatever without importing other stuff like the scratch-js handler), although I don't know what the right architecture is to make that happen. |
Maybe in |
Since the generated code is heavily dependent on the implementation of My opinion is that since |
@adroitwhiz I think this is right. It probably makes sense for nonstandard I/O formats to be treated like extensions or plugins of some kind. (Although at that point why not just treat all I/O formats like extensions?) |
I think you could in fact move all the output (and maybe input) formats into a separate repo.
The "export" (and maybe "import") code would simply interface with that API. IMO there's value in having a standardized way for JS to interact with Scratch projects that's free of implementation-specific warts (e.g. shadow blocks vs non-shadowed inputs). For example, my Phosphorus fork Bismuth parses both SB2 and SB3 files into its own intermediate representation that it can generate JS from. I have some interest in replacing this with |
That all makes a lot of sense. I think the internal representation used by sb-edit needs a pretty solid upheaval. In particular, references to other objects in a project should be actual references to instances instead of string ids. (So if you have a To that end, I would love to see someone (@adroitwhiz? 😉) make a PR that heavily restructures the guts of |
Ehh, I'd say it makes sense to have the intermediate representation of a costume be a |
But more to the point, I'd love to look more at the internals of |
Also on that note, if you pass a reporter into the dropdown, then there are two potential, totally unrelated types for the input value - PS: I've been following this discussion since it's interesting to me, but not really adding much, as I don't have a whole lot of thoughts either-way :P But I'm definitely excited to see what breaking apart the IO code from the main library could look like!! |
I'm going to close this in favor of more comprehensive and recent discussion in #53, which covers the same topics and more. |
I was trying to use webpack to build a project that depends on sb-edit, but it failed to build due to the dependency
prettier
trying to use thefs
module. It'ssrc/io/scratch-js/toScratchJS.ts
that usesprettier
, and since my project doesn't use scratch-js, I worked around the problem by just commenting out references to it elsewhere in the library code. It's probably worth investigating why scratch-js can't be built with webpack in the first place, but it got me wondering: what's the purpose of including code related to scratch-js in the otherwise more general library sb-edit? If it's not needed here, should it be moved to the scratch-js library (thus getting rid of the prettier dep for sb-edit)? I'd guess it's to make the two libraries interact better and may be difficult to separate from sb-edit, but I wouldn't really know, so just asking. :PThe text was updated successfully, but these errors were encountered: