Skip to content

Cache ruby.wasm #9

@palkan

Description

@palkan

Context

Currently, we have to load the ruby.wasm (via the @rails-tutorial/wasm NPM package) every time we initialize the WebContainer (does it uses any caching mechanism for node_modules/? not sure). That could be a blocker (and especially annoying in development when we need to reload the page often).

Task

We need to figure out if we can store the Wasm module in the browser (using File System API, for example—I used it at Workbook, worked fine) and mount it into a WebContainer on start.

The trickiest part here is, probably, to orchestrate the commands: we need to ensure that the Wasm is mounted before running any Rails command.

Previous attempts

I tried to keep the .wasm file within the template (src/templates/default) but that worked even worse, litterally freezing the browser for dozens of seconds.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesttutorialkitFix/patch TutorialKit packages

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions