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

Performance and SEO optimisations #96

Merged
merged 8 commits into from
Mar 13, 2023

Conversation

JSKitty
Copy link
Member

@JSKitty JSKitty commented Mar 4, 2023

Abstract

To improve MPW's size and loading time, this PR employs a bunch of webpack-level and dependency changes, such as:

  • Setting webpack to production mode (enables many dist optimisations) for builds.
  • Plugging in a CSS minimizer.
  • Replacing the bloaty whole lodash import for per-function lodash-es imports.
  • For SEO/Indexing purposes: switching the navbar <a> buttons to <span>.

Much of these issues were shown with the help of Lighthouse, in which MPW has quite bad performance and loading times - this PR will dramatically decrease the loading time for MPW.

My current local tests (using production and this PR) show these results:

Production (CSS and JS only)
image

Pull Request (CSS and JS only)
image

What does this PR address?

The PR helps address the slow loading times of MPW, by vastly decreasing the app's compiled size and by stripping unused dependency bloat from the app.

What features or improvements were added?

No user-level features, just faster loading! (Which also means less bandwidth usage).

How does this benefit users?

MPW will now load significantly faster, especially notable on slower networks or hosts, this PR also improves SEO and search engine indexing by the boost in performance, and the tweak to the navbar which resolves some indexing issues.

JSKitty added 3 commits March 4, 2023 16:19
This removes the large amount of unused lodash bloat compiled in to MPW.
This prevents search engines trying to index them as "href" URLs, and thus will help with solidifying indexing better.
@JSKitty JSKitty added the Enhancement New feature or request label Mar 4, 2023
@JSKitty JSKitty self-assigned this Mar 4, 2023
BreadJS
BreadJS previously approved these changes Mar 5, 2023
Copy link

@BreadJS BreadJS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm all for it! LGTM!

Liquid369
Liquid369 previously approved these changes Mar 5, 2023
Copy link

@Liquid369 Liquid369 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK 6cfcff7
We absolutely need this the question is nonsensical in the perf increase alone and then SEO we do need to start addressing.
Great start

@JSKitty JSKitty dismissed stale reviews from Liquid369 and BreadJS via 86fea82 March 5, 2023 23:12
Copy link
Member

@Duddino Duddino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you commit package.lock.json as well?

Adding this to the config should prevent bn.js to get loaded multiple times

resolve: {
  alias: {
    'bn.js': path.join(__dirname, 'node_modules/bn.js/lib/bn.js'),
  }
},

@JSKitty JSKitty requested review from Duddino, BreadJS and Liquid369 March 6, 2023 18:19
Duddino
Duddino previously approved these changes Mar 6, 2023
Copy link
Member

@Duddino Duddino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK, it's perfect now

Liquid369
Liquid369 previously approved these changes Mar 8, 2023
Copy link

@Liquid369 Liquid369 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK 500ada3

Shoot, just saw, resolve conflicts lol

@JSKitty JSKitty dismissed stale reviews from Liquid369 and Duddino via b3be63b March 9, 2023 01:49
@JSKitty
Copy link
Member Author

JSKitty commented Mar 9, 2023

Resolved conflicts, good to go again.

@JSKitty JSKitty requested review from Liquid369 and Duddino March 9, 2023 01:52
Copy link
Member

@Duddino Duddino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK

Copy link

@Liquid369 Liquid369 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK b3be63b

@JSKitty JSKitty merged commit 337f3d7 into master Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
Development

Successfully merging this pull request may close these issues.

4 participants