Skip to content

Conversation

@RakshaKShetty
Copy link
Contributor

Description

We are improving the LCP by reducing the time to reach the first evaluation, aiming for a 1.8 to 2.2 second reduction. To achieve this, we’ve implemented the following changes:

Code Splitting of Widgets: During page load, only the widgets required for an evaluation are loaded and registered. For every evaluation cycle we keep discovering widget types and load them as required.

Web Worker Offloading: Macro tasks such as clearCache and JavaScript library installation have been moved to the web worker setup. These are now executed in a separate thread, allowing the firstUnevaluatedTree to be computed in parallel with JS library installation.

Parallel JS Library Loading: All JavaScript libraries are now loaded in parallel within the web worker, instead of sequentially, improving efficiency.

Deferred Rendering of AppViewer: We now render the AppViewer and Header component only after registering the remaining widgets. This ensures that heavy rendering tasks—such as expensive selector computations and loading additional chunks related to the AppViewer—can execute in parallel with the first evaluation, further enhancing performance.

Automation

/ok-to-test tags="@tag.All"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run:
https://github.com/appsmithorg/appsmith/actions/runs/16202622510
Commit: b648036
Cypress dashboard.
Tags: @tag.All
Spec:


Thu, 10 Jul 2025 19:22:25 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

  • Widgets are now loaded and registered asynchronously, improving app startup and modularity.

  • Widget registration and configuration changes are now versioned, ensuring selectors and UI update appropriately.

  • Widget initialization and factory cache management are more robust, with explicit cache clearing after widget registration.

  • Added new Redux actions and selectors to manage first page load, deferred JS library loading, and page rendering state.

  • Theme handling and widget initialization in AppViewer are streamlined for faster evaluation and rendering.

  • Deferred loading of JavaScript libraries on first page load improves performance.

  • Conditional rendering gates added to AppViewer and Navigation components based on evaluation state.

  • Bug Fixes

  • Prevented errors when conditionally rendering widgets and navigation components before evaluation is complete.

  • Improved widget property pane and configuration tests to ensure all widgets are properly loaded and validated.

  • Refactor

  • Widget import and registration logic was refactored to support dynamic, on-demand loading.

  • Evaluation and initialization sagas were modularized for better maintainability and performance.

  • Widget factory and memoization logic were enhanced to allow explicit cache clearing and version tracking.

  • JavaScript library loading logic was parallelized for faster startup.

  • Theme application extracted into a dedicated component for clarity and reuse.

  • Tests

  • Expanded and updated widget and evaluation saga test suites to cover asynchronous widget loading, cache management, and first evaluation scenarios.

  • Added tests verifying widget factory cache behavior and first evaluation integration.

  • Chores

  • Updated internal dependencies and selectors to track widget configuration version changes, ensuring UI consistency.

Description

Tip

Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content, marketing, and DevRel team).

Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR.

Fixes #Issue Number
or
Fixes Issue URL

Warning

If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.

Automation

/ok-to-test tags=""

🔍 Cypress test results

Caution

If you modify the content in this section, you are likely to disrupt the CI result for your PR.

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

## Description
We are improving the LCP by reducing the time to reach the first
evaluation, aiming for a 1.8 to 2.2 second reduction. To achieve this,
we’ve implemented the following changes:

Code Splitting of Widgets: During page load, only the widgets required
for an evaluation are loaded and registered. For every evaluation cycle
we keep discovering widget types and load them as required.

Web Worker Offloading: Macro tasks such as clearCache and JavaScript
library installation have been moved to the web worker setup. These are
now executed in a separate thread, allowing the firstUnevaluatedTree to
be computed in parallel with JS library installation.

Parallel JS Library Loading: All JavaScript libraries are now loaded in
parallel within the web worker, instead of sequentially, improving
efficiency.

Deferred Rendering of AppViewer: We now render the AppViewer and Header
component only after registering the remaining widgets. This ensures
that heavy rendering tasks—such as expensive selector computations and
loading additional chunks related to the AppViewer—can execute in
parallel with the first evaluation, further enhancing performance.

## Automation

/ok-to-test tags="@tag.All"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/16202622510>
> Commit: b648036
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=16202622510&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Thu, 10 Jul 2025 19:22:25 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

* **New Features**
* Widgets are now loaded and registered asynchronously, improving app
startup and modularity.
* Widget registration and configuration changes are now versioned,
ensuring selectors and UI update appropriately.
* Widget initialization and factory cache management are more robust,
with explicit cache clearing after widget registration.
* Added new Redux actions and selectors to manage first page load,
deferred JS library loading, and page rendering state.
* Theme handling and widget initialization in AppViewer are streamlined
for faster evaluation and rendering.
* Deferred loading of JavaScript libraries on first page load improves
performance.
* Conditional rendering gates added to AppViewer and Navigation
components based on evaluation state.

* **Bug Fixes**
* Prevented errors when conditionally rendering widgets and navigation
components before evaluation is complete.
* Improved widget property pane and configuration tests to ensure all
widgets are properly loaded and validated.

* **Refactor**
* Widget import and registration logic was refactored to support
dynamic, on-demand loading.
* Evaluation and initialization sagas were modularized for better
maintainability and performance.
* Widget factory and memoization logic were enhanced to allow explicit
cache clearing and version tracking.
* JavaScript library loading logic was parallelized for faster startup.
* Theme application extracted into a dedicated component for clarity and
reuse.

* **Tests**
* Expanded and updated widget and evaluation saga test suites to cover
asynchronous widget loading, cache management, and first evaluation
scenarios.
* Added tests verifying widget factory cache behavior and first
evaluation integration.

* **Chores**
* Updated internal dependencies and selectors to track widget
configuration version changes, ensuring UI consistency.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@RakshaKShetty RakshaKShetty requested review from a team and ApekshaBhosale as code owners July 14, 2025 05:36
@RakshaKShetty RakshaKShetty requested review from rahulbarwal and removed request for a team July 14, 2025 05:36
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 14, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • pg
  • release

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link

🔴🔴🔴 Cyclic Dependency Check:

This PR has increased the number of cyclic dependencies by 574, when compared with the master branch.

Refer this document to identify the cyclic dependencies introduced by this PR.

You can view the dependency diff in the run log. Look for the check-cyclic-dependencies job in the run.

@btsgh btsgh merged commit f96f581 into master Jul 14, 2025
240 of 247 checks passed
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.

4 participants