ruffle/web
dependabot-preview[bot] b90a7ad5ad build(deps-dev): bump webpack-cli from 4.3.0 to 4.3.1 in /web
Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 4.3.0 to 4.3.1.
- [Release notes](https://github.com/webpack/webpack-cli/releases)
- [Changelog](https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-cli/compare/webpack-cli@4.3.0...webpack-cli@4.3.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-31 13:20:21 -08:00
..
common chore: Update some dependencies 2020-12-11 11:28:33 -08:00
packages demo: Only accepts .swf and .spl files 2020-12-30 15:14:28 -08:00
src web: Flush shared objects in unload intead of beforeunload 2020-12-27 14:01:42 -08:00
.eslintignore web: Switched core package from javascript to typescript 2020-11-24 16:36:33 -08:00
.eslintrc.json Fix files in wrong places & eslint errors 2020-07-29 17:06:51 -07:00
.prettierignore web: Add 'docs' command to generate jsdocs 2020-11-24 16:36:33 -08:00
.prettierrc.json web: Reformatted all javascript with prettier 2020-05-16 01:58:18 -07:00
Cargo.toml chore: Bump to rand 0.8 2020-12-19 14:33:12 -08:00
LICENSE_APACHE chore: Copy LICENSE* to relevant places where package managers complain if they don't exist, and make sure they're included in distributions 2020-05-27 00:11:02 -07:00
LICENSE_MIT chore: Copy LICENSE* to relevant places where package managers complain if they don't exist, and make sure they're included in distributions 2020-05-27 00:11:02 -07:00
README.md web: Allow avm_debug in web 2020-07-23 11:25:59 -07:00
lerna.json web: Remove & disable package-lock for subpackages, only root should have it 2020-06-13 12:35:14 -07:00
package-lock.json build(deps-dev): bump webpack-cli from 4.3.0 to 4.3.1 in /web 2020-12-31 13:20:21 -08:00
package.json build(deps-dev): bump source-map-loader from 1.1.3 to 2.0.0 in /web 2020-12-24 23:32:54 -08:00

README.md

ruffle-web

Test Web

ruffle-web is a Wasm version of Ruffle, intended for use by either using the ruffle-selfhosted or ruffle-extension NPM packages.

This project is split into two parts: The actual Flash player written in Rust, and a javascript interface to it. Most of the time, you will be building the actual rust part through the npm build scripts.

Using ruffle-web

Please refer to our wiki for instructions on how to use Ruffle either on your own website, or as a browser extension.

How it works

We compile Ruffle down to a Wasm (WebAssembly) binary, which will be loaded into web pages either deliberately (installing the selfhosted package onto the website), or injected by users as a browser extension.

By default we will detect and replace any embedded Flash content on websites with the Ruffle player (we call this "polyfilling"), but this can be configured by the website. This means that Ruffle is an "out of the box" solution for getting Flash to work again; include Ruffle and it should just work™.

For rendering the content, we prefer to use WebGL. WebGL is very accurate, hardware-accelerated and very fast, but is not universally supported. Additionally, many privacy related browsers or extensions will disable WebGL by default. For this reason, we include a fallback using the canvas API.

Building from source

Requirements

Before you are able to build this project, you must first install a few dependencies:

Rust

Follow the instructions to install rust on your machine.

We do not have a Minimum Supported Rust Version policy. If it fails to build, it's likely you may need to update to the latest stable version of rust. You may run rustup update to do this (if you installed rust using the above instructions).

Node.js

Follow the instructions to install node.js on your machine.

We recommend using the currently active LTS 12, but we do also run tests with maintenance LTS 10.

wasm-pack

Follow the instructions to install wasm-pack on your machine.

Building

In this project, you may run the following commands to build all packages:

  • npm run bootstrap
    • This will install every dependency for every package.
    • Run this every time you pull in new changes, otherwise you may be missing a package and the build will fail.
  • npm run build
    • This will build the wasm binary and every node package (notably selfhosted and extension).
    • Output will be available in the dist/ of each package (for example, ./packages/selfhosted/dist), save for the extension which is directory build/.
    • You may also use npm run build:avm_debug to activate the (extremely verbose) actionscript debugging output

From here, you may follow the instructions to use Ruffle on your website, or run a demo locally with npm run demo.

Testing

To run all of the tests in this project, we currently require that you have Chrome installed to its default location.

First, ensure you've build every package (see above), and then run npm run test to run the full suite of tests.

Structure

  • This directory is a cargo crate which is the actual Flash player, and also a root node package.
  • packages/core is a node package which contains the core ruffle web API & wasm bindings.
  • packages/selfhosted is a node package intended for consumption by websites to include Ruffle on their site.
  • packages/extension is a node package that turns Ruffle into a browser extension.
  • packages/demo is an example node package of how to use self-hosted ruffle on your site, and testing it locally.

Contributing

Please follow the general contribution guidelines for Ruffle.

In addition to those, we ask that you ensure that you pass all tests with npm run test, and check the automatic code linting & styler by running npm run format before you commit.

Where possible, please add tests to all new functionality or bug fixes that you contribute.

Thank you!