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 React production mode in CI builds #16969

Merged
merged 3 commits into from
Apr 19, 2021
Merged

Conversation

germain-gg
Copy link
Contributor

Improves #14750

More and more people use Nightly builds as their main client. When bundling the app in a CI environment webpack is in development mode.

Doing so means that sources are not minified, we benefit from source maps, BUT we run React development build. Which is great when an engineer is actively working on the app, but adds significant runtime overhead (3-5x slower in development compared to production)

Screen Shot 2021-04-15 at 12 49 46

  • Fig1: React production, room filtering in a "small" account, 65ms blocking time, 445ms script execution time
  • Fig2: React development, room filtering in a "small" account, 401.6ms blocking time, 1461 script execution time

PS: Sorry for the larger diff, the linter was not happy, the tl;dr is 0532c9c

When running Nightly build we want to benefit from the fast runtime that React production offers and get rid of the runtime overhead that comes with development.

We are setting NODE_ENV and not "webpack.mode" to not loose sourcemaps and have minified sources in that environment
@germain-gg germain-gg requested a review from a team April 15, 2021 14:24
Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

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

overall this seems fine - just a couple nits

webpack.config.js Outdated Show resolved Hide resolved
webpack.config.js Outdated Show resolved Hide resolved
Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

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

thank you :D

@germain-gg germain-gg merged commit 4d6a8f9 into develop Apr 19, 2021
@germain-gg germain-gg deleted the gsouquet-nightly-react-prod branch April 19, 2021 08:19
jryans added a commit that referenced this pull request Apr 19, 2021
With the approach in #16969,
Webpack seems to sometimes do what we want, sometimes not... I haven't quite
worked out why. Perhaps there's some conflict or race in Webpack's defaults...?

This new approach seems to work as expected when running
`./scripts/ci_package.sh`, which matches what development deployments are doing.
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request May 1, 2021
Changes in [1.7.26](https:/vector-im/element-web/releases/tag/v1.7.26) (2021-04-26)
===============================================================================================
[Full Changelog](element-hq/element-web@v1.7.26-rc.1...v1.7.26)

 * Upgrade to React SDK 3.19.0 and JS SDK 10.0.0

Changes in [1.7.26-rc.1](https:/vector-im/element-web/releases/tag/v1.7.26-rc.1) (2021-04-21)
=========================================================================================================
[Full Changelog](element-hq/element-web@v1.7.25...v1.7.26-rc.1)

 * Upgrade to React SDK 3.19.0-rc.1 and JS SDK 10.0.0-rc.1
 * Translations update from Weblate
   [\#17031](element-hq/element-web#17031)
 * Bump ssri from 6.0.1 to 6.0.2
   [\#17010](element-hq/element-web#17010)
 * Fix `NODE_ENV` value for CI environments
   [\#17003](element-hq/element-web#17003)
 * Use React production mode in CI builds
   [\#16969](element-hq/element-web#16969)
 * Labs documentation for DND mode
   [\#16962](element-hq/element-web#16962)
 * Rename blackboxing to new option ignore list
   [\#16965](element-hq/element-web#16965)
 * Remove velocity-animate from lockfile
   [\#16963](element-hq/element-web#16963)
 * Add mobile download link configuration
   [\#16890](element-hq/element-web#16890)
 * Switch develop to not-staging Scalar by default
   [\#16883](element-hq/element-web#16883)
 * Support a config option to skip login/welcome and go to SSO
   [\#16880](element-hq/element-web#16880)

Changes in [1.7.25](https:/vector-im/element-web/releases/tag/v1.7.25) (2021-04-12)
===============================================================================================
[Full Changelog](element-hq/element-web@v1.7.25-rc.1...v1.7.25)

 * Upgrade to React SDK 3.18.0 and JS SDK 9.11.0

Changes in [1.7.25-rc.1](https:/vector-im/element-web/releases/tag/v1.7.25-rc.1) (2021-04-07)
=========================================================================================================
[Full Changelog](element-hq/element-web@v1.7.24...v1.7.25-rc.1)

 * Upgrade to React SDK 3.18.0-rc.1 and JS SDK 9.11.0-rc.1
 * Translations update from Weblate
   [\#16882](element-hq/element-web#16882)
 * Revert "Docker image: serve pre-compressed assets using gzip_static"
   [\#16838](element-hq/element-web#16838)
 * Move native node modules documentation to element-desktop
   [\#16814](element-hq/element-web#16814)
 * Add user settings for warn before exit
   [\#16781](element-hq/element-web#16781)
 * Change ISSUE_TEMPLATE bold lines to proper headers
   [\#16768](element-hq/element-web#16768)
 * Add example for deployment into Kubernetes
   [\#16447](element-hq/element-web#16447)
 * Create bare-bones `PULL_REQUEST_TEMPLATE.md`
   [\#16770](element-hq/element-web#16770)
 * Add webpack config and labs flag docs for voice messages
   [\#16705](element-hq/element-web#16705)

Changes in [1.7.24](https:/vector-im/element-web/releases/tag/v1.7.24) (2021-03-29)
===============================================================================================
[Full Changelog](element-hq/element-web@v1.7.24-rc.1...v1.7.24)

 * Upgrade to React SDK 3.17.0 and JS SDK 9.10.0

Changes in [1.7.24-rc.1](https:/vector-im/element-web/releases/tag/v1.7.24-rc.1) (2021-03-25)
=========================================================================================================
[Full Changelog](element-hq/element-web@v1.7.23...v1.7.24-rc.1)

 * Upgrade to React SDK 3.17.0-rc.2 and JS SDK 9.10.0-rc.1
 * Translations update from Weblate
   [\#16766](element-hq/element-web#16766)
 * Docker image: serve pre-compressed assets using gzip_static
   [\#16698](element-hq/element-web#16698)
 * Fix style lint issues
   [\#16732](element-hq/element-web#16732)
 * Updated expected webpack output in setup guide
   [\#16740](element-hq/element-web#16740)
 * Docs for `loginForWelcome`
   [\#16468](element-hq/element-web#16468)
 * Disable rageshake persistence if no logs would be submitted
   [\#16697](element-hq/element-web#16697)

Changes in [1.7.23](https:/vector-im/element-web/releases/tag/v1.7.23) (2021-03-15)
===============================================================================================
[Full Changelog](element-hq/element-web@v1.7.23-rc.1...v1.7.23)

 * Upgrade to React SDK 3.16.0 and JS SDK 9.9.0

Changes in [1.7.23-rc.1](https:/vector-im/element-web/releases/tag/v1.7.23-rc.1) (2021-03-10)
=========================================================================================================
[Full Changelog](element-hq/element-web@v1.7.22...v1.7.23-rc.1)

 * Upgrade to React SDK 3.16.0-rc.2 and JS SDK 9.9.0-rc.1
 * Translations update from Weblate
   [\#16655](element-hq/element-web#16655)
 * Improve docs for customisations
   [\#16652](element-hq/element-web#16652)
 * Update triage guide to match the new label scheme
   [\#16612](element-hq/element-web#16612)
 * Remove a couple useless 'use strict' calls
   [\#16650](element-hq/element-web#16650)
 * Remove old conferencing doc
   [\#16648](element-hq/element-web#16648)
 * Bump elliptic from 6.5.3 to 6.5.4
   [\#16644](element-hq/element-web#16644)
 * Add option for audio live streaming
   [\#16604](element-hq/element-web#16604)
 * Update velocity-animate dependency
   [\#16605](element-hq/element-web#16605)
 * Add Edge to the supported tier
   [\#16611](element-hq/element-web#16611)
 * Add multi language spell check
   [\#15851](element-hq/element-web#15851)
 * Document feature_spaces
   [\#16538](element-hq/element-web#16538)
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.

2 participants