Thomas Weber
ccfd5f4006
Run no-op rAF workaround on Chrome Android
...
closes https://github.com/TurboWarp/scratch-vm/issues/343
2026-07-04 17:42:37 -05:00
Thomas Weber
43f13efd18
Add default URL for video sprites
2026-05-23 16:27:15 -05:00
Thomas Weber
8da02dcab3
Bump @turbowarp/scratch-svg-renderer peer dep
2026-05-23 01:41:53 -05:00
Thomas Weber
adaa47dec2
Update scratch-parser
2026-05-23 00:43:59 -05:00
Thomas Weber
925f113400
Don't start monitors if there are no targets
...
Fixes https://github.com/TurboWarp/sb3fix/issues/125 in the safest way that
hopefully has no unforseen breakages on weird behaviors
2026-05-16 01:42:59 -05:00
Thomas Weber
52f4369e63
Fix spork compatibility issue with mutation-less control_stop
...
Our editor relies on the mutation for control_stop to know if there is a connection below.
Spork does not export that mutation anymore.
Instead, we will just generate the mutation to fix errors on loading.
2026-05-03 10:27:39 -05:00
7b521ff000
Force shadow property for procedure blocks during deserialization ( #335 )
...
Co-authored-by: Cubester <78769806+CubesterYT@users.noreply.github.com >
Co-authored-by: Thomas Weber <muffin@muffin.ink >
2026-04-18 22:18:21 -05:00
Classfied3D
94276b1ee9
fix indefinite calls to analyzeScript when a large amount of procedures interlink ( #334 )
2026-04-09 18:08:06 -05:00
Thomas Weber
9f2106a290
Remove variable value safe stringification
...
I thought this may have been part of fixing a sb2 -> sb3 corruption issue.
But from commit log, it seems this was added to prevent extensions from making mistakes.
With the scratch-parser change, those mistakes are now considered features.
Seems safe to just do remove these checks all the time.
Closes https://github.com/TurboWarp/scratch-vm/pull/332
2026-03-02 22:43:29 -06:00
Thomas Weber
1ea395fe97
Don't allow reading video motion when external communication is possible ( #331 )
2026-02-08 11:22:19 -06:00
Thomas Weber
722014ee66
add sensing_online to compiler compat blocks
2026-01-24 14:05:46 -06:00
Thomas Weber
d825b5017f
add sensing_online
2026-01-24 14:01:42 -06:00
Thomas Weber
464a9c68dd
Support JS Map in externalDeltaToJS for extension compatibility
...
Nothing in Scratch uses this
2026-01-13 19:09:49 -06:00
Thomas Weber
676ba53e22
Compress extension images
2026-01-10 09:13:14 -06:00
Thomas Weber
6abc33d787
Remove immutable.js ( #329 )
...
Why:
* We use immutable.js 3.8.2 which is ancient and not getting updates
* immutable.js adds 55KB to the bundle, of which we use almost nothing
* immutable.js's treatment of 0 and -0 is nonsensical and would require weird workarounds like https://github.com/TurboWarp/scratch-vm/pull/320
* We don't benefit from the whole immutability thing
What we're doing instead:
* We have our own MonitorState and MonitorRecord classes
* We track dirty-ness at modification time instead of equality checking every tick
* scratch-gui and packager can continue to think we use immutable.js without causing issues in either direction
* our objects have enough stubs that immutable.js-expecting consumers are ok
* when receiving an object, we check if it looks like an immutable.js one and ask for the plain JS version so that works okay too
2026-01-09 22:30:18 -06:00
Thomas Weber
553a2a434d
Use safe stringify from -gui for visual reports
...
Fixes stringifying -0, objects, arrays
2026-01-09 22:23:46 -06:00
Thomas Weber
7fefa6f666
Check for either input never being numbers first in OP_EQUALS
...
Fixes https://github.com/TurboWarp/scratch-vm/issues/311
2025-12-29 20:06:36 -06:00
Thomas Weber
0e5043d4dc
Fix missing boolean cast in control_repeat_until
...
Fixes https://github.com/TurboWarp/scratch-vm/issues/317
2025-12-29 19:50:15 -06:00
Thomas Weber
c3a47de575
Fix incorrect type for looks_size
...
It can return 0 when fencing is disabled
2025-12-29 19:01:46 -06:00
Thomas Weber
7aa8930802
Fix incorrect types for sensing_of
...
They can return 0 if the sprite does not exist
Fixes https://github.com/TurboWarp/scratch-vm/issues/262
Closes https://github.com/TurboWarp/scratch-vm/pull/325
(this one uses a different fix and has tests)
There are broader issues about compiled sensing_of not handling dynamic
sprite create/delete. We should tackle that later. The other PR wouldn't
really fix this either.
2025-12-29 18:58:44 -06:00
Thomas Weber
779f0a196d
Add no-op rAF loop to improve frame pacing
...
It is still not perfect. Better though
Fixes https://github.com/TurboWarp/scratch-vm/issues/257
Closes https://github.com/TurboWarp/scratch-vm/pull/324
(this one uses a different approach and restricts to 30 FPS and checks
if the platform is known to benefit before we turn on battery draining
workarounds)
2025-12-29 18:57:47 -06:00
8to16
36bf998aee
Fix evalAndReturn with comments at the bottom of a script ( #322 )
...
This is because beepbox's script:
https://cdn.jsdelivr.net/npm/beepbox@4.2.0/global/beepbox_synth.min.js
has a sourceMappingURL comment at the bottom for whatever
reason, causing it to become
//# sourceMappingURL=beepbox_synth.min.js.map;return beepbox;
This is obviously going to break and might also be the case with
other libraries too, hot just beepbox.
Ported from AmpMod:
https://codeberg.org/ampmod/ampmod/commit/0daf1021bdc8e67a1f0d08b91ce500605fcaa711
2025-12-15 18:51:13 -06:00
Thomas Weber
fd13a98e2d
Merge pull request #305 from TurboWarp/compile-say
...
Compile looks_say and looks_think without compatibility layer
2025-12-04 21:42:32 -06:00
Thomas Weber
9624ea5456
Compile looks_say and looks_think without compatibility layer
2025-12-04 21:38:16 -06:00
Thomas Weber
08e850a825
Merge pull request #280 from TurboWarp/fix-negative-zero
...
Fix all remaining negative zero bugs
2025-12-04 21:35:58 -06:00
Thomas Weber
06dbe65a98
Use Number.isNaN instead
2025-12-04 21:32:19 -06:00
Thomas Weber
6f6845ba3c
Fix all remaining negative zero bugs
2025-12-04 21:32:19 -06:00
Thomas Weber
8252e2e60d
Merge pull request #285 from TurboWarp/use-Number.isNaN
...
Replace isNaN with Number.isNaN in jsexecute
2025-12-04 21:30:03 -06:00
Thomas Weber
fd1b85589e
Merge pull request #301 from TurboWarp/more-unnecessary-casts
...
Remove more unnecessary casts
2025-12-04 21:29:22 -06:00
Thomas Weber
d8c26ad156
Merge pull request #307 from TurboWarp/optimize-repeat-better
...
Improve repeat block analysis
2025-12-04 21:28:50 -06:00
Thomas Weber
4187f550a0
Record which keys the project has used
...
Related to https://github.com/TurboWarp/scratch-gui/issues/1106
2025-11-15 19:00:15 -06:00
Thomas Weber
92adc762d9
Merge pull request #313 from TurboWarp/update-languages
...
Update scratch-translate-extension-languages to 1.0.7
2025-11-01 20:36:39 -05:00
Thomas Weber
475ffd0cb4
Update scratch-translate-extension-languages to 1.0.7
2025-11-01 19:18:12 -05:00
Thomas Weber
55674f82ee
Implement Scratch.external - VM part ( #308 )
2025-10-18 23:43:22 -05:00
Thomas Weber
8860e2d602
Fix repeat block iteration count not being optimizable in yielding loops
2025-10-12 11:16:25 -05:00
Thomas Weber
eb0d678068
Only analyze repeat block inputs at the start of the loop
2025-10-12 11:12:05 -05:00
Thomas Weber
efb502a8ac
Remove unnecessary boolean casts
2025-10-08 18:44:51 -05:00
Thomas Weber
3b947da95e
Remove unnecessary number index casts
2025-10-08 18:43:50 -05:00
Thomas Weber
67cb7cfc5d
Remove unnecessary string casts
2025-10-08 18:42:43 -05:00
Thomas Weber
36d4d8224b
Merge pull request #300 from TurboWarp/fix-string-length-type
...
Use more specific type for string length
2025-10-08 18:33:55 -05:00
Thomas Weber
07309b6ebf
Use more specific type for string length
2025-10-08 17:15:44 -05:00
Thomas Weber
d09f82a2fe
Add new test case that does some simple string operations
2025-10-08 17:15:24 -05:00
Thomas Weber
2ee8d6cf6b
Merge pull request #299 from TurboWarp/face-sensing
...
Add face sensing to default extension URLs
2025-10-07 18:12:47 -05:00
Thomas Weber
4ab24673c9
Add face sensing to default extension URLs
2025-10-07 18:06:10 -05:00
Thomas Weber
d848fd0e6e
Convert default extension URLs from dict to object
2025-10-07 18:05:47 -05:00
Thomas Weber
51aacba14c
Merge pull request #295 from TurboWarp/optimize-loops
...
Optimize loops with provably-non-fraction iteration counts
2025-10-05 08:54:44 -05:00
Thomas Weber
5c5ff712b0
Merge pull request #296 from TurboWarp/round-floor-ceil-type
...
Use more specific type for round, floor, ceiling
2025-10-05 08:48:20 -05:00
Thomas Weber
2a2d15282b
Infinite iteration count can also use simpler condition
2025-10-04 20:37:54 -05:00
Thomas Weber
a2701efdf5
Use more specific type for round, floor, ceiling
2025-10-04 20:36:46 -05:00
Thomas Weber
2ac7095947
Optimize loops with provably-integer iteration counts
2025-10-04 20:05:31 -05:00