-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
feat: Bundle optimization and first load improvements #21667
Conversation
This doesn’t work yet: postinstall scripts cause a recursive install loop
For some reason, after the Yarn v3 upgrade, some previously omitted TS errors are now visible. This commit fixes them.
During `yarn dedupe`, Yarn settled down on Blueprint Core v3.43. However, the current version of @blueprintjs/datetime relies on an import from @blueprintjs/core that’s not present in v3.43. In Yarn 1 setup, this used to work due to an accident: @blueprintjs/datetime installed a newer (3.47) version of @blueprintjs/core, which had the necessary import. Now that we deduped the versions, this doesn’t work anymore. This commit fixes this by upgrading the Blueprint Core to v3.47.
We moved package.json one level higher, and that somehow made webpack preference node_modules/entities over src/entities. The previous behavior was weird. (I can’t figure out *why* webpack would prefer src/entities, as it wasn’t configured [1] to do so.) But this commit fixes that. [1] https://github.com/facebook/create-react-app/blob/d960b9e38c062584ff6cfb1a70e1512509a966e7/packages/react-scripts/config/webpack.config.js#L306-L312
This: - adds `rts` into the list of workspaces - changes the build steps for `rts` to copy both the global and the workspaces’ node_modules into `dist`
This commit: - updates the icon names in the IconSelectControl tests. This was done because with the @blueprintjs/icon update, the control now has more icons, so the previous className checks don’t work anymore (now: https://user-images.githubusercontent.com/2953267/222846934-3b8ad6ae-8cf5-4de4-b5d0-cd3b7ef4234e.png; before: https://user-images.githubusercontent.com/2953267/222846936-bae05b25-dfc6-47cc-934d-3c1cb0d4080d.png) - switches the tests to snapshots: this makes it much easier to update icon names in case of future @blueprintjs/icon upgrades
perf: switch to yarn 3 + dedupe dependencies
Co-authored-by: Satish Gandham <[email protected]>
/perf-test |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/4488351778. |
/ok-to-test |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/4499321176. |
/ok-to-test sha=f3e0d4f |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/4935045082. |
/build-deploy-preview env=release |
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/4935121390. |
/build-deploy-preview |
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/4935418138. |
Build running here |
For some reason, the CI server fails to intercept JS requests. This change attempts to solve that
For more info why this is needed, see 5e5bc35
## Description #22652 introduced new styles to code in Appsmith. Along with it was some unintentional changes. Bundle optimization [PR](#21667) introduced, CodeEditorFallback component which incorrectly renders borders and causes UI to flicker. It also broke styles of lint message popover. This PR fixes these issues. Code changes - Added 6px padding to code editor lines - Use class variables instead of ref - Removed border for JSEditor's CodeEditorFallback component - Fixes lint message style > > Links to Notion, Figma or any other documents that might be relevant to the PR > https://www.notion.so/appsmith/Visual-changes-to-code-in-Appsmith-8bb530c60ee844e5b44adec039bf9280#d99e8450f022439f845b5a0d7deb1d3f > #### PR fixes following issue(s) Fixes # (issue number) > if no issue exists, please create an issue and ask the maintainers about this first > > #### Media > A video or a GIF is preferred. when using Loom, don’t embed because it looks like it’s a GIF. instead, just link to the video > > #### Type of change - Bug fix (non-breaking change which fixes an issue) > > > ## Testing > #### How Has This Been Tested? - [x] Manual > > #### Test Plan Visual checks to test for changes as per [this](https://www.notion.so/appsmith/Error-tooltip-for-data-fields-on-property-pane-Needs-design-810cdc489c3e4168a0b1b348730ac98c?utm_content=810cdc48-9c3e-4168-a0b1-b348730ac98c&utm_campaign=TGA9SH07N&n=slack&n=slack_link_unfurl&pvs=6) Notion doc > #### Issues raised during DP testing None > ## Checklist: #### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag #### QA activity: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Test-plan-implementation#speedbreaker-features-to-consider-for-every-change) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans/_edit#areas-of-interest) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [x] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed --------- Co-authored-by: Ravi Kumar Prasad <[email protected]>
After merging this PR, is everything in this guide still valid? https://github.com/appsmithorg/appsmith/blob/release/contributions/ClientSetup.md I noticed node_modules and ESLint configuration are now in a different level. Does this mean the Cc. @riodeuno |
You can do yarn install in any folder under app. We will move all UI related code under client in a couple of weeks. |
@SatishGandham Understood. Is there any issue number / branch / PR I can follow to be aware of those updates? Thanks in advance. |
## Description This issue is happening because we are getting lodash library as `undefined` when we pass it to` derived.value` function here. This is happening because of the following reason: * [Bundle optimisation PR](#21667) introduces a new plugin called: `babel-plugin-lodash`. It helps in transforming the imports. * But this plugin doesn't work on the following pattern: `import _ from "lodash"`. Here it replaces `_` with `undefined` [ This file](https://github.com/appsmithorg/appsmith/blob/3bc50d9632cf269935aed6657092ddb8b7e8c92f/app/client/src/workers/common/JSLibrary/lodash-wrapper.js#L1) explains the exact scenario that we are facing. There is also [an open bug](lodash/babel-plugin-lodash#235) for this issue on the `babel-plugin-lodash` repository. This PR imports lodash from the lodash-wrapper instead of directly importing as follows: `import _ from "lodash"` > #### PR fixes following issue(s) Fixes #23671 #### Type of change - Bug fix (non-breaking change which fixes an issue) ## Testing > #### How Has This Been Tested? - [x] Manual - [ ] Jest - [x] Cypress - should check that value entered in currency field appears in the actual field > > #### Test Plan > Add Testsmith test cases links that relate to this PR > > #### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) > > > ## Checklist: #### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag #### QA activity: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
## Description This issue is happening because we are getting lodash library as `undefined` when we pass it to` derived.value` function here. This is happening because of the following reason: * [Bundle optimisation PR](#21667) introduces a new plugin called: `babel-plugin-lodash`. It helps in transforming the imports. * But this plugin doesn't work on the following pattern: `import _ from "lodash"`. Here it replaces `_` with `undefined` [ This file](https://github.com/appsmithorg/appsmith/blob/3bc50d9632cf269935aed6657092ddb8b7e8c92f/app/client/src/workers/common/JSLibrary/lodash-wrapper.js#L1) explains the exact scenario that we are facing. There is also [an open bug](lodash/babel-plugin-lodash#235) for this issue on the `babel-plugin-lodash` repository. This PR imports lodash from the lodash-wrapper instead of directly importing as follows: `import _ from "lodash"` > #### PR fixes following issue(s) Fixes #23671 #### Type of change - Bug fix (non-breaking change which fixes an issue) ## Testing > #### How Has This Been Tested? - [x] Manual - [ ] Jest - [x] Cypress - should check that value entered in currency field appears in the actual field > > #### Test Plan > Add Testsmith test cases links that relate to this PR > > #### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) > > > ## Checklist: #### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag #### QA activity: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed (cherry picked from commit f47b1c8)
Description
This is an intermediate branch for the first load optimization
TL;DR
Improves the first load times via bundle optimization, code splitting, and prioritizing delivery of critical code.
Change 1
The Evaluation and Tern workers have several large dependencies:
This PR removes them from the main bundle. When applied to appsmithorg/appsmith on top of perf: mark design system modules as side-effect-free design-system#389, this makes the bundle 980 minified kB smaller (7.46 → 6.48 minified MB). perf: move worker dependencies to the corresponding workers #20972
Change 2
In total, this saves 1.34 minified MBs (8.34 → 7 MB), getting rid of these modules (+ making others smaller, thanks to the modern build target):
Fixes # (issue)
Media
Type of change
First load optimization and some housekeeping stuff.
Test Plan
Checklist:
Dev activity
QA activity: