Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use production build for walt-explorer #128

Open
JobLeonard opened this issue Jul 9, 2018 · 10 comments
Open

Use production build for walt-explorer #128

JobLeonard opened this issue Jul 9, 2018 · 10 comments

Comments

@JobLeonard
Copy link

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

@randy7d0
Copy link
Contributor

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!

@ballercat
Copy link
Owner

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!

@randy7d0
Copy link
Contributor

randy7d0 commented Oct 17, 2018

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.

@randy7d0
Copy link
Contributor

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

@ballercat
Copy link
Owner

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/

randy7d0 added a commit to randy7d0/walt that referenced this issue Oct 26, 2018
…sting "Development" build. It essentially addresses the requirement of the following story to some extent:

ballercat#128

To execute production build, "build:prod" mode has been added to package.json  (in ~/packages/walt-docs/)
It reduces output JS file, explorer.js, by about 50%
Following testings have been performed for this submission:
- manually loading explorer.js file from /docs folder
- npm test
@randy7d0
Copy link
Contributor

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

@randy7d0
Copy link
Contributor

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!

@ballercat
Copy link
Owner

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

@randy7d0
Copy link
Contributor

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

@JobLeonard
Copy link
Author

I think #176 is relevant to this topic ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants