Skip to content

refactor: remove unnecessary checks for query#53

Merged
JounQin merged 1 commit intomainfrom
ci/query_case
Apr 7, 2025
Merged

refactor: remove unnecessary checks for query#53
JounQin merged 1 commit intomainfrom
ci/query_case

Conversation

@JounQin
Copy link
Member

@JounQin JounQin commented Apr 7, 2025

which is already handled by oxc-project/oxc-resolver#443

Summary by CodeRabbit

  • Refactor
    • Removed query-based export definitions and associated arithmetic operations, streamlining how modules are imported.
  • Tests
    • Eliminated tests that verified functionality related to the removed query-based exports.

@JounQin JounQin requested a review from Copilot April 7, 2025 02:24
@coderabbitai
Copy link

coderabbitai bot commented Apr 7, 2025

Walkthrough

This update removes the query parameter handling support from the codebase. The package.json for the export-query module is deleted along with its export definitions, and the corresponding arithmetic functions (add, minus, equal) in separate files are removed. In addition, the tests covering these exports are eliminated, and a block in the resolver’s implementation that handled path queries has been removed. No new features were introduced; instead, the changes simplify and restrict module resolution behavior when dealing with query strings.

Changes

File(s) Change Summary
fixtures/.../export-query/package.json Removed the file that defined the module’s name and exports (./add, ./minus, ./equal with query parameters).
fixtures/.../export-query/{add.js, minus.js, equal.js} Removed exported functions: add (addition), minus (subtraction), and equal (equality check) that were previously available for module consumers.
src/lib.rs Removed the block in resolve_impl that handled resolving paths containing a query string, now defaulting to throwing a “not found” error for such cases.
src/tests/exports_field.rs Deleted the variable and three test cases related to the export-query module, reducing the test coverage for query string resolution.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Resolver

    Client->>Resolver: Request module (e.g., "export-query/add?query1?query2")
    Resolver-->>Client: Process request (no query handling)
    Resolver-->>Client: Return "not found" error
Loading

Poem

I'm a bouncy rabbit, quick on my feet,
Hopping past queries, the code's neat and sweet.
Exports have vanished, tests took a leap,
The resolver now sleeps, no more puzzling deep.
I nibble fresh logic, in bytes I trust—hooray! 🐇💻


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1ec535e and 3afa7ae.

📒 Files selected for processing (6)
  • fixtures/enhanced_resolve/test/fixtures/export-query/add.js (0 hunks)
  • fixtures/enhanced_resolve/test/fixtures/export-query/equal.js (0 hunks)
  • fixtures/enhanced_resolve/test/fixtures/export-query/minus.js (0 hunks)
  • fixtures/enhanced_resolve/test/fixtures/export-query/package.json (0 hunks)
  • src/lib.rs (0 hunks)
  • src/tests/exports_field.rs (0 hunks)
💤 Files with no reviewable changes (6)
  • fixtures/enhanced_resolve/test/fixtures/export-query/minus.js
  • fixtures/enhanced_resolve/test/fixtures/export-query/equal.js
  • fixtures/enhanced_resolve/test/fixtures/export-query/add.js
  • fixtures/enhanced_resolve/test/fixtures/export-query/package.json
  • src/lib.rs
  • src/tests/exports_field.rs
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Test (windows-latest)
  • GitHub Check: Benchmark

🪧 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.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 6 changed files in this pull request and generated no comments.

Files not reviewed (4)
  • fixtures/enhanced_resolve/test/fixtures/export-query/add.js?query: Language not supported
  • fixtures/enhanced_resolve/test/fixtures/export-query/equal.js?query: Language not supported
  • fixtures/enhanced_resolve/test/fixtures/export-query/minus.js?query: Language not supported
  • fixtures/enhanced_resolve/test/fixtures/export-query/package.json: Language not supported
Comments suppressed due to low confidence (1)

src/tests/exports_field.rs:57

  • [nitpick] The test description 'should resolve with query string #10' is used repeatedly for different cases. Consider adding distinguishing details to each test case to aid in identifying failure points.
        ("should resolve with query string #10", f6.clone(), "export-query/add?query", f6.join("add.js?query1?query2")),

@codecov
Copy link

codecov bot commented Apr 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.03%. Comparing base (5c511b5) to head (3afa7ae).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #53      +/-   ##
==========================================
+ Coverage   92.75%   93.03%   +0.28%     
==========================================
  Files          13       13              
  Lines        2842     2830      -12     
==========================================
- Hits         2636     2633       -3     
+ Misses        206      197       -9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codspeed-hq
Copy link

codspeed-hq bot commented Apr 7, 2025

CodSpeed Performance Report

Merging #53 will not alter performance

Comparing ci/query_case (3afa7ae) with main (5c511b5)

Summary

✅ 3 untouched benchmarks

@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 7, 2025

@JounQin JounQin merged commit a9b347c into main Apr 7, 2025
18 checks passed
@JounQin JounQin deleted the ci/query_case branch April 7, 2025 02:37
This was referenced Apr 7, 2025
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