Skip to content
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

Add Scratch 3.0 extension support #343

Merged
merged 30 commits into from
Jun 5, 2021
Merged

Conversation

apple502j
Copy link
Collaborator

@apple502j apple502j commented Jun 16, 2020

Resolves #335
Resolves #342
Resolves #347

Additions:

  • Support for all extension blocks
  • Boost & gdxfor icons

Changes:

  • inputs can now be omitted on commands.js
  • extensions.js is now used for extension data
  • Fixed Chinese extra messages

Misc:

  • Updated snapshots
  • Updated translations to include added blocks

@apple502j
Copy link
Collaborator Author

@tjvr review?

Copy link
Contributor

@GrahamSH-LLK GrahamSH-LLK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@apple502j
Copy link
Collaborator Author

@tjvr ???

@apple502j
Copy link
Collaborator Author

@tjvr any plans for merge?

@apple502j
Copy link
Collaborator Author

@tjvr updates???

@tjvr
Copy link
Member

tjvr commented Jun 4, 2021

I've had a skim and this looks like it's really a very good PR, thank you for sending it!

It's quite large so it may take me a little while to review, but I hope to get to it soon 🙏

Copy link
Member

@tjvr tjvr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really great PR, thanks so much for working on it!

I think it's all functionally there; really great work figuring out my code, which is a little lacking :P

I've left a few comments; I don't know how much more work you were expecting to do on this, so you're welcome to address as few or as many of them as you like. Happy to try and tackle them myself instead if you prefer! 🙏

width: "40px",
height: "40px",
href:
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAABGdBTUEAALGPC/xhBQAACCNJREFUeAHtnGtsFFUUgM+dfXbbbbcWaKHSFgrlkWgkJCb6A4kmJfiHIBYBpcFfRg1GEkmEVAvhFYw/TExMxGoICAECiZEIIUQCiiT4gh+KILRQCi2ENIV2t/ue6zl3u2Upu4XuzO4csCe587iPmXO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oN+SrmMI7tixo/v3337diNtQUzNpPq1RChIra5ccAFKDUEwYLra2fnXu3PmtA0gojqbaVUNl23ft+pPiPW73U7RGYdGH5QCQYCg93C73075S34I5c+ZQa0s/B1Njou51tVVVatJAXcrED3Q4EI5plgsHgAQiSiRCoRD9ECeam9fPo32UJzFQYwJLlix9mdZ9fb1naY2iyiQ2rVtyAEi199Pi5M8/tdB62vRpzceOH3+toaHBh61w2clTp96sqq5ehUnxw0eO7KA8KKpMYtO6JZcOKTUeNRhsp0+ffmtilYI1VLf4+Qvn1784d+5ezEfW144hMR05blglpDgHSbqxt6Wl5Y8ZM6afKq8oL7LZHd54PH7H7w+cOPj9dx8uXbLk+ICynbhm4cJDr7LVMKmhoP5dphaWoFGrHMTAQrgBJCjkFdQHpPntqCUmiWCge14PBsvdFnUYlP8AMAKfKIKmYukAAAAASUVORK5CYII=",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the other icons, I ran the SVGs through svgo to optimise them, and then manually translated them into SVG.el elements. This meant we could get vector graphics into the final result, and in most cases this helps keep the JS bundle size down too.

Unless it's completely impractical, it would be good to do the same for these new icons. Some people use scratchblocks to generate printed materials, so it would be good to keep everything as scalable vector graphics if at all possible! 🙏

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Real blocks use PNG image. Although there is a SVG version, I'm not sure if it's the right one: https://github.com/LLK/scratch-gui/blob/develop/src/lib/libraries/extensions/gdxfor/gdxfor-small.svg

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do they?! I’m sure they were using PNGs last I checked 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SVG version is used in extension library, and the PNG version is used in blocks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh interesting! We should probably reconsider things in that case...

syntax/blocks.js Outdated Show resolved Hide resolved
syntax/blocks.js Show resolved Hide resolved
syntax/blocks.js Show resolved Hide resolved
syntax/extensions.js Outdated Show resolved Hide resolved
scratch2/blocks.js Outdated Show resolved Hide resolved
syntax/commands.js Show resolved Hide resolved
@apple502j
Copy link
Collaborator Author

It's been a year since the PR, I forgot the most but gonna do the things...

Copy link
Member

@tjvr tjvr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating this! You were totally right about the PNG images; I'd completely forgotten we already had a couple in there :P

I'd like to leave (Position von Motor [A v]) uncommented for the snapshot but otherwise I think this is good to go! 🚀

tests/syntax.test.js Show resolved Hide resolved
snapshots/tests.js Outdated Show resolved Hide resolved
@apple502j apple502j requested a review from tjvr June 5, 2021 10:43
Co-authored-by: Tim Radvan <tjvr@fastmail.com>
Copy link
Member

@tjvr tjvr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one -- thanks so much for writing this, sorry it took a while to get round to!

@tjvr tjvr merged commit 042ad03 into scratchblocks:master Jun 5, 2021
@tjvr
Copy link
Member

tjvr commented Jun 8, 2021

This is now live on http://scratchblocks.github.io/ :)

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.

Add icons for extensions that do not have them commands.js is not updated New extensions aren't supported
3 participants