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

[Feature]:Detecting Similar Dependencies in the Rspack or Webpack Build Analysis Tool #640

Open
easy1090 opened this issue Dec 16, 2024 · 0 comments

Comments

@easy1090
Copy link
Contributor

What problem does this feature solve?

RFC: Detecting Similar Dependencies in the Rspack or Webpack Build Analysis Tool

Summary

Introduce a new feature in the Rspack or webpack build analysis tool to detect the usage of similar dependencies, such as using both lodash and lodash-es, as well as mixing dayjs and moment. This feature will also consider the use of AI technology to provide more automated and comprehensive detection of similar dependencies.

Motivation

In modern frontend development, developers often inadvertently introduce similar or alternative dependencies, leading to redundant code and increased bundle size. For example, using both lodash and lodash-es may inflate the build size, while the mixing of dayjs and moment can lead to unnecessary dependencies. Identifying these similar dependencies can optimize the build output, reduce the final bundle size, and improve application performance.

Detailed Design

Feature Implementation:

  • Similar Dependency Detection:
    The build analysis tool scans the project's dependencies during the compilation process to discover similar libraries (such as lodash and lodash-es, dayjs and moment in the examples above).

  • Rule Configuration:
    Allows users to customize the rules for identifying similar dependencies and supports setting similarity thresholds.

AI Integration:

  • Intelligent Suggestions:
    Utilize machine learning models to analyze project dependencies and provide intelligent recommendations for replacing or eliminating similar dependencies.

  • Context Understanding:
    Use context analysis to identify which similar dependencies can be replaced in actual usage, potentially providing example code.


What does the proposed API look like?

inner Similar-detected-plugin

@easy1090 easy1090 changed the title [Feature]: [Feature]:Detecting Similar Dependencies in the Rspack or Webpack Build Analysis Tool Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant