59 Commits
Author SHA1 Message Date
Lu Yifei 9538aa7559 feat(compiler): add program-specialized continuation backend
Export optimized IR and replace legacy compiled-package APIs with fused continuations. Preserve synchronous warp regions and thread lifecycle semantics; real-project performance tuning remains in progress.
2026-09-25 19:45:05 +08:00
Lu Yifei a5286f0231 Add source-stripped compiled project packages
- serialize and load precompiled JavaScript artifacts
- support runtime bindings and ABI validation
- add SHA-256 integrity manifests and optional signatures
- preserve assets and extension dependencies in compiled packages
- add playground, documentation, and integration coverage
2026-08-05 19:51:18 +08: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
Muffin d69256aa2d Replace jszip with @turbowarp/jszip 2024-05-19 21:58:36 -05:00
Muffin cd9782a64c Replace minilog with nanolog 2024-01-14 01:48:32 -06:00
Muffin 66cbf13a7b Replace scratch-svg-renderer with @turbowarp/scratch-svg-renderer 2023-12-30 00:13:22 -06:00
Thomas Weber b97ddc8730 Merge branch 'develop' of https://github.com/llk/scratch-vm into develop 2021-03-08 16:07:45 -06:00
adroitwhiz 1aa38db4e6 replace nets with Fetch API 2021-02-19 10:56:33 -05:00
Thomas Weber 00b5b2cfce Fix some eslint errors 2020-10-28 19:46:37 -05:00
Thomas Weber 047883e8ad Convert sound assets to use file-loader
This reduces the size of the scratch-gui JS bundle by nearly 2 MB.

This might make the music extension take longer to load or break it
entirely in some situations (file: URI), but that's a compromise I'm
willing to take.
2020-07-25 14:10:39 -05:00
Thomas Weber 093dd56cc8 Don't use uglify 2020-07-25 13:40:17 -05:00
Thomas Weber 099295a89f Modernize browser targets 2020-07-16 18:43:11 -05:00
Christopher Willis-Ford a308b1e02f use xmlEscape instead of escape-html for extensions 2019-04-17 16:48:58 -07:00
Michael "Z" Goddard d8ae96a58c build playground/benchmark.js 2019-01-24 17:48:17 -05:00
Ray Schamp fd0ff04198 Update babel-core to @babel/core
Also required updating @babel/preset-env.
2018-10-17 12:14:49 +01:00
Michael "Z" Goddard a15a9a1b7b Fix benchmark suite (#1397)
* add scratch-svg-renderer adaptors to benchmark vm

* disable benchmark with monitor error

* fixup! add scratch-svg-renderer adaptors to benchmark vm

* fixup! disable benchmark with monitor error
2018-08-08 14:36:38 -04:00
Ray Schamp bfa229535a Merge pull request #1188 from mzgoddard/resolve-webpack-playground
fix: resolve scratch-*/src/index.js for expose-loader
2018-06-01 16:28:11 -04:00
Michael "Z" Goddard fda288506a fix: resolve scratch-*/src/index.js for expose-loader
require.resolve is a nodejs api that resolves as node resolves. An
enhanced-resolve instance, the library webpack uses, could resolve as
webpack will or we can use some slightly more manual definitions here
for exposing parts of scratch on the global object for the playground's
benchmark to use.
2018-06-01 13:38:18 -04:00
Ray Schamp 6fb8d86880 Remove unused script-loader for highlightjs 2018-05-31 16:54:30 -04:00
Michael "Z" Goddard 4ceeebb257 Use src/index as browser entry point
Use src/index.js as the entry by default in tools building scratch-vm
into a larger package. This saves file space by excluding extra webpack
boilerplate and may allow for deeper optimizations.

Depend on script dependencies for downstream webpack. For another
package to build in scratch-vm's dependencies without them already
being built into a consumed webpack build they need to be listed as
dependencies. This can benefit large projects that reuse the same
dependencies multiple times. Node will still use the main entry point
and its webpack build leaves the dependencies as external references so
it may reuse common modules in Node as well as in a build a browser
environment.
2018-05-31 16:32:46 -04:00
Ray Schamp a9a23ef589 Merge pull request #1104 from mzgoddard/webpack-4
Update to webpack 4
2018-05-07 11:28:51 -04:00
Michael "Z" Goddard dcb6a3ac56 Update babel-preset-es2015 to babel-preset-env
Use the common scratch browserlist configuration used for styling and babel
transforming in other scratch repositories.
2018-05-04 15:49:12 -04:00
Michael "Z" Goddard f60d8fc4c1 Update to webpack 4 2018-05-03 18:57:48 -04:00
Michael "Z" Goddard d4bffcbddb Rename playground/motion.html to video-sensing.html 2018-04-03 16:19:52 -04:00
Michael "Z" Goddard c206dc3241 Add motion playground page for debugging video sensing 2018-03-29 19:02:07 -04:00
Eric Rosenbaum 5d5129d753 Don’t copy assets via webpack 2018-02-14 17:55:11 -05:00
Eric Rosenbaum 063ac39019 Load music extension assets with require 2018-02-14 17:53:05 -05:00
Christopher Willis-Ford 3717394f00 Playground: load renderer as UMD
The recent changes to the renderer's build output packaging broke this
repository's playground / benchmark suite. These changes aren't the only
way to fix the issue, but this is consistent with the way that the
storage module was already being loaded.
2018-01-29 14:04:19 -08:00
Ray Schamp e8fd5b1f13 Replace playground with benchmark 2017-12-12 12:17:33 -05:00
Ray Schamp 921ce24195 Merge branch 'benchmark-prototype' of https://github.com/mzgoddard/scratch-vm into mzgoddard-benchmark-prototype
# Conflicts:
#	.gitignore
2017-12-12 09:48:52 -05:00
Christopher Willis-Ford 88dada5cb8 Use UMD for web ouput
UMD output seems to be working well for the storage module; this change
adjusts the web-targeted build outputs of this module to use it as well.
Also, common output properties are now specified in the base config and
removed from each individual config.
2017-11-27 20:07:31 -08:00
Michael "Z" Goddard 7356546072 Add benchmark prototype
Build a page with webpack that loads a project and automatically runs
it, collecting performance information for a set amount of time,
stopping and displaying the results.
2017-11-20 18:40:55 -05:00
Eric Rosenbaum 614708d48c Merge pull request #785 from ericrosenbaum/feature/load-drums-from-storage
Load drum sounds from storage and play them
2017-11-20 13:56:23 -05:00
Paul Kaplan 26771e9e0c Only uglify if building for production.
Uglify was trying to run always, including the dev-server output, which
included es6 that broke uglifier.
2017-11-17 09:59:09 -05:00
Eric Rosenbaum f5b25a190e Add assets (drum sounds) for music extension 2017-11-13 16:23:10 -05:00
Chris Willis-Ford d8a3e659d5 Playground: use UMD to load storage as global (#722)
* Playground: use UMD to load storage as global

It appears that `expose-loader` is not compatible with WebPack's UMD
exporter, so the VM playground broke when I converted `scratch-storage`
to use UMD. This change causes the playground to load `scratch-storage`
as an independent script and relies on its UMD loader to expose it as a
global. Bonus points: we get better source mapping this way.

* Playground: tell eslint about global ScratchStorage
2017-10-17 17:40:11 -04:00
Ray Schamp bafdf8d9f2 Use ES6 linting rules in the project root
Update all tests for `no-var` and `prefer-arrow-callback` (using `--fix`)
2017-04-24 15:37:58 -04:00
Ray Schamp e96807b399 Merge branch 'develop' of https://github.com/LLK/scratch-vm into es6
# Conflicts:
#	src/import/sb2import.js
#	src/virtual-machine.js
#	webpack.config.js
2017-04-19 17:54:31 -04:00
Ray Schamp 9be29439b1 Fix webpack for ES6 2017-04-17 19:55:34 -04:00
Christopher Willis-Ford 0402b7ed8e Standardize repository settings
Set dev tool to `cheap-module-source-map`.
2017-04-11 11:38:58 -04:00
Christopher Willis-Ford c23e9c6bf8 Load projects & costumes through scratch-storage
This also sets up the framework to load sounds through scratch-storage,
to be finished in a later change.
2017-03-09 11:25:55 -08:00
Christopher Willis-Ford 243d68f88b Use Webpack to generate the whole playground
The previous configuration mixed Webpack output with static content in
order to create the playground. This change moves that static content
from `/playground/` into `/src/playground/` and adds a Webpack rule to
copy it into the playground as part of the build.

On the surface this might seem unnecessary, but it provides at least two
benefits:
- It's no longer possible to accidentally load stale build output
  through `webpack-dev-server` in the event of a misconfiguration. This
  was very easy in the previous configuration, and might in fact be the
  only way that `webpack-dev-server` ever worked for this repository.
- It's simpler to ensure that various rules apply to the hand-authored
  content and not build outputs. This includes lint rules, `.gitignore`,
  IDE symbol search paths, etc.
2017-02-10 14:21:37 -08:00
Ray Schamp a6568c4bf2 Update webpack config for webpack 2
* `module.loaders` -> `module.rules`
* loaders need `-loader` suffix
* `json-loader` is enabled by default
* `UglifyJsPlugin`'s `compress.warning` setting is false by default
2017-02-01 16:27:55 -05:00
Chris Willis-Ford 9b04392211 Move build outputs into a dist/ subdirectory (#375)
* Move Node output: /dist.js => /dist/node/scratch-vm.js
* Move web output: /vm{.js,.min.js} => /dist/web/scratch-vm{.js,.min.js}
* Update build output references in package.json and the playground's index.html
* Move the VirtualMachine class out of index.js into its own file, referenced by index.js. The VirtualMachine class is otherwise unchanged.
* Add .gitattributes rules for new file types which were added to this repository without specifying their text/binary attributes
* Turn on source maps in webpack and add corresponding .gitignore rule
2017-01-13 13:34:26 -08:00
Eric Rosenbaum fec9e5b91a add audio to playground 2017-01-06 11:49:25 -05:00
Ray Schamp 9859c3d91a Merge pull request #335 from rschamp/feature/port
Fix dev port number
2016-11-21 14:32:44 -05:00
Ray Schamp 5b36e3cacd Fix dev port number
scratch-www: 8333
scratch-api: 8491
scratch-gui: 8601

Clearly the port should be 8073 for scratch-vm.
2016-11-21 14:25:08 -05:00
Tim Mickel 16c405d559 Remove assets copy plugin 2016-10-31 10:41:16 -04:00
Ray Schamp 7712b2902f Fix quote-props 2016-10-24 11:02:19 -04:00
TheBrokenRail ebe8f63232 Fix 2016-10-13 20:01:17 -04:00