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: Move existing middlewares to a middlewares folder and added pass through middleware for packages #39410

Open
wants to merge 1 commit into
base: release
Choose a base branch
from

Conversation

ashit-rath
Copy link
Contributor

@ashit-rath ashit-rath commented Feb 24, 2025

Description

Move middlewares to a new folder and added an ee specific middleware app/client/src/ee/middlewares/PackageMiddleware.ts.
This will eventually be added to the store but as of now it is detached since the functionality is incomplete. It will be extended in EE

PR for https://github.com/appsmithorg/appsmith-ee/pull/6324

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/13493097420
Commit: a0a94db
Cypress dashboard.
Tags: @tag.All
Spec:


Mon, 24 Feb 2025 08:58:32 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Introduced an enterprise middleware that enhances package-specific functionality.
  • Refactor

    • Improved internal integration by adjusting module access and reorganizing route handling.
    • Updated import paths and consolidated middleware components to streamline application structure.

@ashit-rath ashit-rath self-assigned this Feb 24, 2025
Copy link
Contributor

coderabbitai bot commented Feb 24, 2025

Walkthrough

This pull request makes several adjustments to the codebase’s module exports and file organization. The getUpdatedWidgetLists function in the canvas widgets reducer is now exported instead of private. An old EE RouteParamsMiddleware file is removed while new middleware files are added under the EE middlewares directory, including a simple PackageMiddleware and a re-export of the RouteParamsMiddleware from the CE module. Additionally, the import path for routeParamsMiddleware in the store is updated accordingly. No changes were made to the function logic or control flow.

Changes

File(s) Change Summary
app/client/src/ce/reducers/entityReducers/canvasWidgetsReducer.ts Updated getUpdatedWidgetLists from a private to an exported function.
app/client/src/ee/RouteParamsMiddleware.ts Deleted file that re-exported from ce/RouteParamsMiddleware.
app/client/src/ee/middlewares/PackageMiddleware.ts
app/client/src/ee/middlewares/RouteParamsMiddleware.ts
Added new middleware: PackageMiddleware in the former; added re-export of RouteParamsMiddleware in the latter.
app/client/src/store.ts Updated import path for routeParamsMiddleware to use the new middlewares folder.

Sequence Diagram(s)

sequenceDiagram
    participant ActionSender as Action Sender
    participant PackageMW as PackageMiddleware
    participant Next as Next Middleware/Reducer

    ActionSender->>PackageMW: Dispatch Action
    PackageMW->>Next: Forward action
Loading

Suggested labels

Task

Suggested reviewers

  • hetunandu

Poem

Functions exported now, no secrets to hide,
Middleware marches, with actions to guide.
Files restructured in a rhythmic array,
Paths aligned clearly, improving the way.
Cheers to clean code and a delightful upgrade!


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8de6040 and a0a94db.

📒 Files selected for processing (5)
  • app/client/src/ce/reducers/entityReducers/canvasWidgetsReducer.ts (1 hunks)
  • app/client/src/ee/RouteParamsMiddleware.ts (0 hunks)
  • app/client/src/ee/middlewares/PackageMiddleware.ts (1 hunks)
  • app/client/src/ee/middlewares/RouteParamsMiddleware.ts (1 hunks)
  • app/client/src/store.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • app/client/src/ee/RouteParamsMiddleware.ts
✅ Files skipped from review due to trivial changes (2)
  • app/client/src/ee/middlewares/RouteParamsMiddleware.ts
  • app/client/src/store.ts
🔇 Additional comments (2)
app/client/src/ee/middlewares/PackageMiddleware.ts (1)

1-9: Clean implementation with clear purpose.

The middleware follows the standard Redux middleware pattern and provides a clear comment about its intended use. This is a good foundation for future package-specific extensions in the EE version.

app/client/src/ce/reducers/entityReducers/canvasWidgetsReducer.ts (1)

42-42: Function exported for wider use.

The change makes getUpdatedWidgetLists function available for use outside this module. The function already has appropriate JSDoc documentation and maintains its original implementation.

Could you provide information on which modules will consume this newly exported function? This would help validate the necessity of this export.

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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. (Beta)
  • @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.

@ashit-rath ashit-rath added the ok-to-test Required label for CI label Feb 24, 2025
@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Feb 24, 2025
@ashit-rath ashit-rath changed the title chore: Move existing middlewares to a middlewares folder and added pa… chore: Move existing middlewares to a middlewares folder and added pass through middleware for packages Feb 25, 2025
@ashit-rath ashit-rath requested a review from brayn003 February 25, 2025 11:56
@ashit-rath ashit-rath marked this pull request as ready for review February 25, 2025 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Required label for CI skip-changelog Adding this label to a PR prevents it from being listed in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant