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

chore: fix missing source-maps & reduce bundle size #781

Merged
merged 2 commits into from
Jan 13, 2022

Conversation

reznord
Copy link
Contributor

@reznord reznord commented Jan 7, 2022

Context

Earlier in #772 , I have disabled source-maps temporarily for suppressing the warnings in the console.

Problem Statement

But that disabled source-maps overall for the entire gardens project and it is a bit hard to debug UI issues since it will point to the transpiled code.

Solution

This PR fixes the missing source-maps warnings and enables source-maps which would allow us for easy debugging over-all.

Also, apart from that, I installed fork-bn.js and aliased all the bn.js chunks in the bundle to the fork-bn.js. This allowed us to trim off ~46kB from the main bundle.

Note:

Please follow the below mentioned steps for testing:

  • Remove node_modules & build folders: rm -rf node_modules build
  • Install depenedencies yarn install or yarn
  • Run the project in development / production mode.

Images

Before:

image

After:

image

@vercel
Copy link

vercel bot commented Jan 7, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/1hive/gardens-ui/AwKegs3M5yBa6ut2NVeb7sm9khkZ
✅ Preview: https://gardens-ui-git-fix-missing-source-maps-1hive.vercel.app

Copy link
Collaborator

@tmoutinho tmoutinho left a comment

Choose a reason for hiding this comment

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

LGTM!

package.json Show resolved Hide resolved
@reznord reznord changed the title chore: fix missing source-maps chore: fix missing source-maps & reduce bundle size Jan 7, 2022
@reznord reznord self-assigned this Jan 7, 2022
@reznord reznord merged commit 4220c29 into staging Jan 13, 2022
@reznord reznord deleted the fix/missing-source-maps branch January 13, 2022 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants