ballercat / walt

:zap: Walt is a JavaScript-like syntax for WebAssembly text format :zap:

Home Page:https://ballercat.github.io/walt/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use production build for walt-explorer

JobLeonard opened this issue · comments

Feature Request

Build the explorer website with production settings before putting it on-line

Overview

Currently the walt-explorer is using the dev build on the website. As a result, it's a 5mb JS file. I'm pretty sure it can be reduced to a fraction of that (not to mention run significantly faster) by instructing webpack to create a production build before publishing it on the website.

Perhaps the the minification pluginsbreak the walt code, but you should be able to run webpack without them and even then it will improve the payload.

Impact

Small to medium. Mostly it's just ironic to have a bloated website for a tool to make low-level fast WASM :P

One question: does walt-explorer (and other WALT modules) uses Webpack version 3.x?

The reason I asked is I started looking into supporting production build. I managed to reduce size from ~5MB -to- ~2.6MB. This does NOT uses any of the Webpack 4.x features such as compression, minification etc.

Please confirm so I could raise PR for my changes. Thanks!

Yes, it's an older version of Webpack (4+ was on its way to release at the time).

There isn't any good reason for 3.x so feel free to upgrade if you are up for it. Thanks!

Thanks for confirming it!

I would submit PR with what I have done so far that gives ~50% reduction in size.

Later on, I will give it a try to upgrade it to 4.x. For that, perhaps we can create a new feature story.

Hi moderator, can you please give me 'Write' access in order for me to submit PR for this story. Thanks!

You do not need write access to make a PR. If you cloned the repo locally, then you'll need to create a fork, push your changes to that remote instead and create a PR from there.

https://help.github.com/articles/creating-a-pull-request-from-a-fork/

I have created the following pull request, please help to review it. Thanks!
#170

I could not find anyone whom I can assign as 'Reviewer', however. So, what is the process of doing actual submission (merging to master branch) for this? Please suggest. Thanks!

I will review it and merge it as soon as I have a chance (within a day or so), thanks!

I have updated based on feedback. Please have a look again. Thanks!
#170 (review)

I think #176 is relevant to this topic ;)