Skip to content

refactor: remove js stats warning #10900

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

Merged
merged 3 commits into from
Jul 3, 2025
Merged

refactor: remove js stats warning #10900

merged 3 commits into from
Jul 3, 2025

Conversation

SyMind
Copy link
Member

@SyMind SyMind commented Jul 3, 2025

Summary

JsStatsWarning and JsStateError have same data, just keep one.

Related links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label Jul 3, 2025
Copy link

netlify bot commented Jul 3, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit a2372ea
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/68665d7e62a9a90008ff674b

Copy link
Contributor

github-actions bot commented Jul 3, 2025

📦 Binary Size-limit

Comparing binary size with Commit: feat: render css runtime module with dojang (#10896) by qixuan

🎉 Size decreased by 8.38KB from 59.81MB to 59.80MB (⬇️0.01%)

Copy link

codspeed-hq bot commented Jul 3, 2025

CodSpeed Performance Report

Merging #10900 will not alter performance

Comparing remove-js-stats-warning (a2372ea) with main (48a276e)

🎉 Hooray! codspeed-rust just leveled up to 2.7.2!

A heads-up, this is a breaking change and it might affect your current performance baseline a bit. But here's the exciting part - it's packed with new, cool features and promises improved result stability 🥳!
Curious about what's new? Visit our releases page to delve into all the awesome details about this new version.

Summary

✅ 16 untouched benchmarks

@SyMind SyMind marked this pull request as ready for review July 3, 2025 10:40
@SyMind SyMind requested review from h-a-n-a and Copilot July 3, 2025 10:40
Copy link
Contributor

@Copilot 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.

Pull Request Overview

This PR removes the separate JsStatsWarning/StatsWarning types by treating warnings as JsStatsError/StatsError, unifying error and warning data and updating tests and docs.

  • Replaced all JsStatsWarning references with JsStatsError in TypeScript and plugin code.
  • Deleted the StatsWarning struct in Rust core and removed JsStatsWarning in the binding API.
  • Updated test expectations and snapshots to include loc for warnings now modeled as errors.

Reviewed Changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/rspack/src/stats/statsFactoryUtils.ts Swapped JsStatsWarning for JsStatsError in extractor and adjusted signature.
packages/rspack/src/stats/StatsFactory.ts Changed cachedGetWarnings to return JsStatsError[].
packages/rspack/src/stats/DefaultStatsFactoryPlugin.ts Updated EXTRACT_ERROR to accept only JsStatsError.
packages/rspack/etc/core.api.md Removed JsStatsWarning import and updated docs to use JsStatsError.
packages/rspack-test-tools/tests/... Adjusted diagnostics tests and snapshots to include new loc field.
crates/rspack_core/src/stats/struct.rs Deleted the StatsWarning struct in core.
crates/rspack_core/src/stats/mod.rs Unified get_warnings to yield StatsError and populated name.
crates/rspack_binding_api/src/stats.rs Removed JsStatsWarning, added name to JsStatsError, updated warnings type.
Comments suppressed due to low confidence (4)

packages/rspack/src/stats/statsFactoryUtils.ts:727

  • [nitpick] Function name warningFromStatsWarning no longer aligns with its parameter type binding.JsStatsError; consider renaming it to something like warningFromStatsError or a more generic name for clarity.
export const warningFromStatsWarning = (

packages/rspack/etc/core.api.md:61

  • Removed import of JsStatsWarning, but ensure all other documentation references to JsStatsWarning are also updated or removed to prevent stale docs.
import type { JsStatsError } from '@rspack/binding';

packages/rspack/src/stats/DefaultStatsFactoryPlugin.ts:611

  • [nitpick] This extractor now handles both errors and warnings but is still named EXTRACT_ERROR; consider renaming to EXTRACT_ISSUE or adding a comment to clarify it covers warnings too.
		error: JsStatsError,

crates/rspack_binding_api/src/stats.rs:139

  • [nitpick] New field name added to JsStatsError; consider updating API reference in core.api.md or inline comments to explain its purpose and when it will be set.
pub struct JsStatsError<'a> {

@h-a-n-a
Copy link
Contributor

h-a-n-a commented Jul 3, 2025

nitpick: I would cat this into a refactor.

@SyMind SyMind changed the title chore: remove js stats warning refactor: remove js stats warning Jul 3, 2025
@SyMind SyMind merged commit b0069f1 into main Jul 3, 2025
47 checks passed
@SyMind SyMind deleted the remove-js-stats-warning branch July 3, 2025 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release: refactor team The issue/pr is created by the member of Rspack.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy