Commit Graph

64 Commits

Author SHA1 Message Date
relrelb 508f541ada Revert "web: Simplify .wasm loading"
This reverts commit 66bfff7687.
2021-07-27 11:19:55 +03:00
relrelb 66bfff7687 web: Simplify .wasm loading
Use wasm-bindgen's built-in loader instead of relying on Webpack.

This allows to no longer declare .wasm files as resource assets in
each webpack.config.js.

Also the bundled JS is a bit smaller (e.g. demo is now ~88KB vs.
~90KB before).
2021-07-24 14:18:19 -07:00
relrelb 49e26338bc web: Fix and cleanup npm build scripts
* Remove `buildProduction` as it was equivalent to `build`.
* Fix `build:avm_debug` and change it to `build:debug`, which also
disables Webpack optimizations.
2021-07-17 11:40:25 +03:00
relrelb a33066f666 demo: Small cleanups 2021-07-12 23:21:14 +03:00
relrelb 70938b849c web: Remove babel-eslint dependency
Not only it's deprecated, it's also not needed because ESLint's
built-in "es2021" environment seems to support everything we use.
2021-07-03 21:18:42 +03:00
dependabot[bot] 4a145f71e2 chore: Bump style-loader from 2.0.0 to 3.0.0 in /web
Bumps [style-loader](https://github.com/webpack-contrib/style-loader) from 2.0.0 to 3.0.0.
- [Release notes](https://github.com/webpack-contrib/style-loader/releases)
- [Changelog](https://github.com/webpack-contrib/style-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/style-loader/compare/v2.0.0...v3.0.0)

---
updated-dependencies:
- dependency-name: style-loader
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-01 23:49:35 +03:00
Chris Midgley 8927500489 dev: update all package.json devDependencies to latest 2021-06-20 02:21:17 -07:00
Daniel Jacobs e6bc34cf1c Add favicon to demo page (fix #2910) 2021-06-10 23:57:31 -07:00
relrelb 0fa24b4ce0 web: Migrate file-loader to asset modules
file-loader is deprecated and asset modules are the recommended
alternative.
2021-04-21 19:03:19 -07:00
relrelb 201c4f5db0 web: Use relative paths for webpack entries
Only output.path needs to be absolute.
2021-04-21 19:03:19 -07:00
Daniel Jacobs c993ad8964 demo: Use absolute URLs for links in README 2021-04-19 16:50:52 -07:00
Daniel Jacobs 8c9db35baf
demo: Allow small screens to still upload local files 2021-04-18 21:04:02 -07:00
relrelb 9e4816c2f1 demo: Add missing class="hidden" 2021-04-15 15:56:52 -07:00
relrelb 792519a725 demo: Improvements 2021-04-11 21:49:18 -07:00
relrelb 690b51f15b web: Shorten CopyWebpackPlugin to CopyPlugin 2021-03-05 23:07:55 -08:00
relrelb 1ed8dea599 web: Improvements 2021-03-05 23:07:55 -08:00
Mike Welsh f6f7222221 web: Remove clean-webpack-plugin dependency 2021-03-03 06:44:45 -08:00
relrelb 73b5916b2a
web: Fix player positioning 2021-02-19 17:40:43 -08:00
relrelb 8f62236fe1 web: Remove demo/package-lock.json
demo is the only package to have its own package-lock.json.
2021-02-19 16:28:09 -08:00
Mike Welsh 836b631237 web: Revert style changes in #3239 2021-02-18 04:11:04 -08:00
relrelb 1c21856980
web: General refactoring
* web: Don't load a random SWF Instead, show a prompt to select or drag an SWF.
* web: Refactor webpack.config.js
* demo: Refactor index.js
* demo: Cleanup CSS
2021-02-16 20:39:46 -08:00
Andrew Larson f34bdb045d demo: Fix player not being destroyed when None is selected
Fix issue with duplicate instances in web demo when sample SWF
is unloaded.
2021-01-25 03:31:24 -08:00
relrelb 0ea7b857cf demo: Lint index.js 2021-01-22 09:19:26 -08:00
relrelb 0349d90fcd demo: Add drag-and-drop functionality 2021-01-22 09:19:26 -08:00
Maxwell DeKock b2594b2b6c web: Fix error in demo when selecting None for sample (close #2416) 2021-01-21 18:05:12 -08:00
Adrian Wielgosik b69e17bf35
web: Allow customizing log level 2021-01-19 18:10:35 -08:00
Mike Welsh c2b768c453 web: Fallback to instantiate with improper MIME type
Use --target web in wasm-bindgen and file-loader for WASM files,
allowing wasm-bindgen's built-in fallback from
WebAssembly.instantiateStreaming to instantiate.

file-loader spits out the WASM file directly in the output folder,
and imports will resolve to the URL, so that we can load the file
directly, avoiding webpack's built-in wasm loaders.

This allows Ruffle to function on web servers even if they serve
WASM files with the incorrect MIME type, fixing one of our biggest
support requests (#400, #1458). There is some performance impact
on loading with the fallback, but this is preferable to not
working at all.
2021-01-16 15:30:11 -08:00
relrelb 828d8b7339
demo: General refactor
General cleanup and refactoring of the web demo
2021-01-09 19:36:05 -08:00
Mike Welsh 87ae91963b demo: Enable letterbox for demo 2021-01-07 11:46:07 -08:00
Toad06 2d0c76c06f demo: Only accepts .swf and .spl files 2020-12-30 15:14:28 -08:00
Nathan Adams 797dd83766 web: Merge streamSwfUrl and streamSwfData into load 2020-11-25 11:33:51 -08:00
willbrindle 54ac1ea300 docs: Update demo README instructions to be correct 2020-11-24 17:50:30 -08:00
willbrindle c3e64f1b12 demo: Allow specifying file in demo via query params 2020-11-24 17:50:30 -08:00
Nathan Adams 600d267bf3 web: We no longer need git dependency in webpack builds - fixes #1517 2020-11-24 16:36:33 -08:00
Nathan Adams abb311670f web: Rename RufflePlayer.play_swf_data to RufflePlayer.playSwfData 2020-11-24 16:36:33 -08:00
Nathan Adams bc3b6ade4e web: Rename SourceAPI.create_player to SourceAPI.createPlayer 2020-11-24 16:36:33 -08:00
Nathan Adams c56d707045 web: Make demo depend directly on ruffle-core 2020-11-24 16:36:33 -08:00
Nathan Adams 5ff7168fe9 web: Switched core package from javascript to typescript 2020-11-24 16:36:33 -08:00
relrelb d71c886e48 web: Move margin to #nav 2020-11-18 17:50:12 -08:00
relrelb c8ed1debc6 web: Change margin to margin-top
This makes the demo page fit in a whole page without a scrollbar.
2020-11-18 17:50:12 -08:00
Nathan Adams dab79107b2 web: Include git details into the build 2020-11-04 16:46:14 -08:00
Mike Welsh cd96df7ee7 web: Disable automatic publicPath in webpack configs 2020-10-21 15:19:36 -07:00
Mike Welsh 8465638939 web: Drop webpack-dev-server and use webpack serve
See https://github.com/webpack/webpack-dev-server/issues/2759
2020-10-18 17:36:52 -07:00
dependabot-preview[bot] a965d2f6ba build(deps-dev): bump webpack-cli from 3.3.12 to 4.0.0 in /web
Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 3.3.12 to 4.0.0.
- [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/v3.3.12...webpack-cli@4.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-17 15:33:13 -07:00
Mike Welsh 990052db77 chore: Bump to webpack 5 2020-10-17 14:07:28 -07:00
Mike Welsh 212645d9b9 demo: Remove query parameter support (fix #1255)
The 'file' query parameter is no longer necessary now that the
sample drop-down box was added, populated by swfs.json.
2020-10-10 17:48:39 -07:00
Mike Welsh 3689bb607d docs: Update demo link in docs 2020-10-10 01:15:48 -07:00
Nathan Adams c07dbbb748 web: Remove & disable package-lock for subpackages, only root should have it 2020-06-13 12:35:14 -07:00
Nathan Adams d7092d0f30 web: Hoist common dev dependencies up to the top (except CLI) and hopefully improve how we bootstrap 2020-06-13 12:35:14 -07:00
Mike Welsh 4671740abe demo: Fix incorrect sample SWF loading
The indexing into the list of sample SWFs could be incorrect
depending on the order of the JSON data. Now we store the SWF info
directly on the option element for easy access, regardless of order.
2020-06-05 16:40:10 -07:00