Discuss Scratch

EngineerRunner
Scratcher
1000+ posts

allow users to PR features and bugfixes into a new beta version of scratch

scratch almost never gets new features. yeah, i know, "development is hard, “that isn't high on our priority list”, and so on. but the fact is, scratch-gui alone currently has 30 vulnerabilites. they aren't just low severity either. 2 are critical severity, and the other 28 are high severity. features that should take about 20 minutes for 1 dude to implement, were suggested 10 years ago and have support from multiple ST members like the exponent block still haven't been added.
to fix this, i suggest that ST allow people to PR in new features and bugfixes into a new branch that gets hosted as a beta version of the scratch editor. if they work fine, then they get added.
yeah thats my suggestion, im crap at ending suggestions
ajskateboarder
Scratcher
1000+ posts

allow users to PR features and bugfixes into a new beta version of scratch

EngineerRunner wrote:

scratch-gui alone currently has 30 vulnerabilites. they aren't just low severity either. 2 are critical severity, and the other 28 are high severity.
npm moment xD

I agree, the current contribution policy Scratch has looks like a pretty giant excuse for a variety of things: not wanting to review user code, not wanting to be fully open source, etc.. I haven't seen any other open-sourced org be so closed about new contributions than Scratch. If a PR doesn't align with their design goals, they can simply reject the PR lol
unmissable
Scratcher
1000+ posts

allow users to PR features and bugfixes into a new beta version of scratch

what is “PR”?
EngineerRunner
Scratcher
1000+ posts

allow users to PR features and bugfixes into a new beta version of scratch

unmissable wrote:

what is “PR”?
pull request
EngineerRunner
Scratcher
1000+ posts

allow users to PR features and bugfixes into a new beta version of scratch

bump so people could potentially help fix these outages
josueart
Scratcher
500+ posts

allow users to PR features and bugfixes into a new beta version of scratch

EngineerRunner wrote:

but the fact is, scratch-gui alone currently has 30 vulnerabilites. they aren't just low severity either. 2 are critical severity, and the other 28 are high severity.
Note that most of them are from packages and the standalone code doesn't have any vulnerabilities . But yeah, they're using outdated packages that are deprecated, outdated, slow, and insecure, as shown when you npm run build.

https://dpaste.org/3RxDL

Last edited by josueart (Jan. 5, 2024 15:00:54)

EngineerRunner
Scratcher
1000+ posts

allow users to PR features and bugfixes into a new beta version of scratch

bump
qwertyy_the_artist
Scratcher
100+ posts

allow users to PR features and bugfixes into a new beta version of scratch

this would be an interesting experiment, i support
josueart
Scratcher
500+ posts

allow users to PR features and bugfixes into a new beta version of scratch

Update on this:

Codubee wrote:

No, I'm going to respond that there's a lot of reasons why stick with “out of date packages”. Mainly because it takes a lot of time (engineering oversight and QA work) to make sure changes to underlying packages don't introduce instability/bugs.
source

Anyways. This would be really interesting, so support.
ajskateboarder
Scratcher
1000+ posts

allow users to PR features and bugfixes into a new beta version of scratch

josueart wrote:

Update on this:

Codubee wrote:

No, I'm going to respond that there's a lot of reasons why stick with “out of date packages”. Mainly because it takes a lot of time (engineering oversight and QA work) to make sure changes to underlying packages don't introduce instability/bugs.
source

Anyways. This would be really interesting, so support.
Yeah, I suspected that. It's very common to stick to specific versions of packages to prevent any breaking changes introduced by newer versions. Not going to pretend I know everything though, since it could be for other reasons. Although, there are still areas outside of package management that can be improved

Last edited by ajskateboarder (Jan. 6, 2024 15:58:18)

EngineerRunner
Scratcher
1000+ posts

allow users to PR features and bugfixes into a new beta version of scratch

bump
RobotChickens
Scratcher
500+ posts

allow users to PR features and bugfixes into a new beta version of scratch

Support! It would be awesome if other devs could help with the development of Scratch! It would take some load off the ST, especially with the recent layoffs. There would definitely need to be a bug-reporting system like there is with Scratch Labs.
ToastRoastBoast
Scratcher
500+ posts

allow users to PR features and bugfixes into a new beta version of scratch

RobotChickens
Scratcher
500+ posts

allow users to PR features and bugfixes into a new beta version of scratch

ToastRoastBoast wrote:

(#13)
dupe
No, this is about PRs for the scratch editor itself; not projects that people make…
Edit: 600th post woooooo

Last edited by RobotChickens (Jan. 7, 2024 23:06:29)

EngineerRunner
Scratcher
1000+ posts

allow users to PR features and bugfixes into a new beta version of scratch

bump
EDawg2011
Scratcher
1000+ posts

allow users to PR features and bugfixes into a new beta version of scratch

EngineerRunner wrote:

features that should take about 20 minutes for 1 dude to implement, were suggested 10 years ago and have support from multiple ST members like the exponent block still haven't been added.
An exponent block would be convenient for some people, and I'd be fine if they brought the servers down for only 20 minutes to add the block.
completeness
Scratcher
100+ posts

allow users to PR features and bugfixes into a new beta version of scratch

EDawg2011 wrote:

EngineerRunner wrote:

features that should take about 20 minutes for 1 dude to implement, were suggested 10 years ago and have support from multiple ST members like the exponent block still haven't been added.
An exponent block would be convenient for some people, and I'd be fine if they brought the servers down for only 20 minutes to add the block.
Scratch wouldn't even have to go down to add this block.

In fact, I can't understate how easy it would be for Scratch to add this highly requested block. Yes, this is kind of cynical and sardonic, but here's a step by step tutorial on how to do it. Note that this is not a userscript or anything to paste in the console - in fact, if you have the technical knowledge to know how to do what I'm saying, I doubt you can't tell it's not malicious. So here goes:

Step 1: Go to scratch-vm/src/blocks/scratch3_operators.js and add this at line 23:
operator_exponent: this.exponent,
and this at line 57:
exponent (args) {
  return Cast.toNumber(args.NUM1) ** Cast.toNumber(args.NUM2);
}
Step 2: Go to scratch-blocks/blocks_vertical/default_toolbox.js and add this at line 400:
'<block type="operator_exponent" id="operator_exponent">' +
 '<value name="NUM1">' +
    '<shadow type="math_number">' +
  '<field name="NUM"></field>' +
  '</shadow>' +
'</value>' +
Now go to scratch-blocks/blocks_vertical/operators.js and add this at line 127:
Blockly.Blocks['operator_exponent'] = {
  /**
   * Block for raising one number to the power of another. 
  * @this Blockly.Block
  */
  init: function() {
    this.jsonInit({
      "message0": Blockly.Msg.OPERATORS_EXPONENT,
      "args0": [
        {
         "type": "input_value",
          "name": "NUM1"
        },
        {
          "type": "input_value",
          "name": "NUM2"
        }
      ],
     "category": Blockly.Categories.operators,
     "extensions": ["colours_operators", "output_number"]
    });
  }
};
Now go to scratch-blocks/msg/messages.js and add this at line 188:
Blockly.Msg.OPERATORS_EXPONENT = '%1 ^ %2';
Step 3: Go to scratch-gui/src/lib/make-toolbox-xml.js and add this at line 581:
<block type="operator_exponent">
   <value name="NUM1">
   <shadow type="math_number">
      <field name="NUM"/>
    </shadow>
   </value>
   <value name="NUM2">
   <shadow type="math_number">
     <field name="NUM"/>
    </shadow>
  </value>
</block>

Ok, we're done! BUT WAIT. Scratch is a big big organization with millions of users, and to supply these millions of users with this perfect service we must put every JavaScript function through grueling tests!

Step 1: Go to scratch-vm/test/unit/blocks_operators.js and add this at line 35:
test('exponent', t => {
  t.strictEqual(blocks.exponent({NUM1: '2', NUM2: '3'}), 8);
  t.strictEqual(blocks.exponent({NUM1: 'foo', NUM2: 'bar'}), 1);
  t.end();
});
Step 2: then go to scratch-vm/test/unit/blocks_operators_infinity.js and add this at line 14:
test('exponent: exponentiation with Infinity', t => {
  t.strictEqual(
    blocks.exponent({NUM1: 'Infinity', NUM2: 111}), Infinity, '"Infinity" ^ 111 = Infinity'
  );
  t.strictEqual(
    blocks.exponent({NUM1: 'INFINITY', NUM2: 222}), 0, '"INFINITY" ^ 222 = 0'
  );
  t.strictEqual(
   blocks.exponent({NUM1: Infinity, NUM2: 333}), Infinity, 'Infinity ^ 333 = Infinity'
   );
  t.strictEqual(
    blocks.exponent({NUM1: 111, NUM2: 'Infinity'}), Infinity, '111 ^ "Infinity" = Infinity'
  );
  t.strictEqual(
    blocks.exponent({NUM1: 222, NUM2: 'INFINITY'}), 1, '222 ^ "INFINITY" = 1'
  );
  t.strictEqual(
    blocks.exponent({NUM1: 333, NUM2: Infinity}), Infinity, '333 ^ Infinity = Infinity'
  );
  t.strictEqual(
    blocks.exponent({NUM1: '-Infinity', NUM2: 111}), -Infinity, '"-Infinity" ^ 111 = -Infinity'
  );
  t.strictEqual(
    blocks.exponent({NUM1: '-INFINITY', NUM2: 222}), 0, '"-INFINITY" ^ 222 = 0'
  );
  t.strictEqual(
    blocks.exponent({NUM1: -Infinity, NUM2: 333}), -Infinity, '-Infinity ^ 333 = -Infinity'
  );
  t.strictEqual(
    blocks.exponent({NUM1: 111, NUM2: '-Infinity'}), 0, '111 ^ "-Infinity" = 0'
  );
  t.strictEqual(
    blocks.exponent({NUM1: 222, NUM2: '-INFINITY'}), 1, '222 ^ "-INFINITY" = 1'
  );
  t.strictEqual(
    blocks.exponent({NUM1: 333, NUM2: -Infinity}), 0, '333 ^ -Infinity = 0'
  );
  t.end();
});
Step 3: go to scratch-blocks/tests/vertical_playground_compressed.html and at line 499:
<block type="operator_exponent">
  <value name="NUM1">
  <shadow type="math_number">
    <field name="NUM"></field>
  </shadow>
  </value>
  <value name="NUM2">
          <shadow type="math_number">
           <field name="NUM"></field>
          </shadow>
        </value>
      </block>
All tests passed! Are you taking notes ST? In total that whole thing took me less than 10 minutes, most of it was spent copying and pasting.

So what was the purpose of that exercise? It certainly wasn't to flex my JavaScript skills. This is a heavily requested feature that poses only benefit and no harm, but if I were to send a PR to scratch right now it would go ignored for years. Fun fact: the last time any sort of change was made to the Scratch language (not the website/UI) was the release of 3.0 at the beginning of 2019. More than 5 years ago, when most Scratchers weren't even alive . The last time any sort of functionality of the programming language changed was March 2, 2021. I mean, if the Scratch team thinks that Scratch is finalized, they could say so. But all we get is perpetual disappointment. Remember Scratch Lab? Neither do I.

Last edited by completeness (Feb. 21, 2024 04:15:47)

completeness
Scratcher
100+ posts

allow users to PR features and bugfixes into a new beta version of scratch

nvm

Last edited by completeness (Feb. 22, 2024 19:38:45)

CST1229
Scratcher
1000+ posts

allow users to PR features and bugfixes into a new beta version of scratch

completeness wrote:

(#17)
(snip)
Also, somewhat related is capitalizing Account settings. This is a trivial single-letter string fix (or two since there's 2.0 and 3.0 pages), which the developers don't seem to want to do, due to being minor. Someone else submitted a pull request to fix it in scratch-www, and it got closed because… the developers don't want to do it? Don't contributions exist so anyone can submit fixes/changes that the main developers haven't found/can't/don't want to do?


And about the suggestion itself, not even features just bugfixes please. Scratch has so, so many bugs that still haven't been fixed since 3.0's release in 2019, that have been fixed by mods like TurboWarp or browser extensions (capitalizing Account settings being one of them) or existing user contributions.

Last edited by CST1229 (Feb. 24, 2024 18:31:37)

completeness
Scratcher
100+ posts

allow users to PR features and bugfixes into a new beta version of scratch

Bump

Powered by DjangoBB