Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

[$100] Optimize production builds to reduce size #13

Closed
maxceem opened this issue Dec 3, 2020 · 12 comments
Closed

[$100] Optimize production builds to reduce size #13

maxceem opened this issue Dec 3, 2020 · 12 comments

Comments

@maxceem
Copy link
Contributor

maxceem commented Dec 3, 2020

Currently, production builds are not optimized:

image

We should configure webpack in such a way that npm run build create a minified file. Note, that this application is configured to be a microapp inside a Single SPA application, so it cannot be run as a standalone application. And it has a special custom webpack config which we can extend in https://github.com/topcoder-platform/taas-app/blob/feature/api-integration/webpack.config.js#L3.

Development build should not be minified.

For minifying, we can use the same approach as our Topcoder Community App config https://github.com/topcoder-platform/topcoder-react-lib

  • JS files should be minified
  • CSS should be minified

In this task we only need to optimize the built for the TaaS App. Later we would apply the same approach for the Navbar App.

@maxceem maxceem added the enhancement New feature or request label Dec 7, 2020
@maxceem maxceem changed the title Optimize production builds to reduce size [$75] Optimize production builds to reduce size Dec 14, 2020
@maxceem maxceem changed the title [$75] Optimize production builds to reduce size [$100] Optimize production builds to reduce size Dec 25, 2020
@maxceem
Copy link
Contributor Author

maxceem commented Dec 25, 2020

Contest https://www.topcoder.com/challenges/30160318 has been created for this ticket.

This is an automated message for maxceem via Topcoder X

@yoution
Copy link
Contributor

yoution commented Dec 30, 2020

@maxceem please assign to me

@maxceem
Copy link
Contributor Author

maxceem commented Dec 30, 2020

Contest https://www.topcoder.com/challenges/30160318 has been updated - it has been assigned to yoution.

This is an automated message for maxceem via Topcoder X

@maxceem
Copy link
Contributor Author

maxceem commented Jan 5, 2021

@yoution nice catch with APPMODE I haven't noticed that this have been already implemented. We don't need to add a new command "build:prod": "webpack --mode=${APPMODE:-production} --env.config=${APPENV:-prod}", as we just set environemtn variable APPMODE before running npm run build to production and it works.

Meanwhile, we should still minify CSS classnames:

image

At the moment generated classnames via CSS Modules have long names like teams_src-routes-PositionDetails-PositionCandidates-styles-module___table-row___2fH15n they should be minified to short classnames like _2fH15n.

See how it looks for Connect App or Community App:

image

So we have to config CSS Modules to use short classnames in production mode.

@maxceem
Copy link
Contributor Author

maxceem commented Jan 5, 2021

Please, work on this issue as the last one, this has small priority and other issues are more important.

yoution added a commit to yoution/taas-app that referenced this issue Jan 6, 2021
@yoution yoution mentioned this issue Jan 6, 2021
@maxceem maxceem added this to the v1.0 - Initial Launch milestone Jan 7, 2021
yoution added a commit to yoution/taas-app that referenced this issue Jan 19, 2021
@yoution
Copy link
Contributor

yoution commented Jan 19, 2021

@maxceem please review

@maxceem
Copy link
Contributor Author

maxceem commented Jan 19, 2021

Payment task has been updated: https://software.topcoder.com/review/actions/ViewProjectDetails?pid=30160318

This is an automated message for maxceem via Topcoder X

@maxceem
Copy link
Contributor Author

maxceem commented Jan 27, 2021

Reopen for tracking purposes.

@maxceem maxceem reopened this Jan 27, 2021
@maxceem
Copy link
Contributor Author

maxceem commented Feb 8, 2021

QA Guide:
We have to check that CSS and JS is minified but functionality is not broken. Very quick smoke testing is enough. Just check a few pages if they open and looks correctly and nothing is visually broken. The same time we have to check that code is minified.

  1. CSS: See how to check that CSS is optimized https://monosnap.com/file/SSJR2VaI7op4LnWn8065W10jjgWRjf. See how NOT-optimized CSS looks like https://monosnap.com/file/IHOMugVkEbgHZJxfFrlnbWWonTCK3k
  2. JS: See hot to check that JS is optimized https://monosnap.com/file/qgfs7YXCGOM6vGGd7r2W8dufiPxclO. See how NOT-optimized JS looks like https://monosnap.com/file/MPNjKJn9XAaYjxSWULkgGymsCdnuXN

@sandhiyakavi
Copy link
Collaborator

CSS and JS both are optimized.

image
image

@maxceem Not able to do smoke test as the changes done in api are not reflecting in Front End.

image
image

@sandhiyakavi
Copy link
Collaborator

@maxceem Changes done in api are reflecting now in FE. Completed smoke testing. Everything is fine.

@sandhiyakavi
Copy link
Collaborator

Fixed: 🆗 in Production via milestone v1.5

image
image

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

No branches or pull requests

3 participants