Skip to content

Conversation

@hardfist
Copy link
Contributor

@hardfist hardfist commented Jan 15, 2026

Summary

use newtype for artifact which is more extensible and we can add more meta info in artifact in the future

Related links

Checklist

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

@netlify
Copy link

netlify bot commented Jan 15, 2026

Deploy Preview for rspack ready!

Name Link
🔨 Latest commit de10988
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/6968f3724859300007009ada
😎 Deploy Preview https://deploy-preview-12754--rspack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@hardfist hardfist changed the title chore: use newtype for alias artifact refactor: use newtype for alias artifact Jan 15, 2026
@github-actions github-actions bot added release: refactor team The issue/pr is created by the member of Rspack. labels Jan 15, 2026
@github-actions
Copy link
Contributor

Rsdoctor Bundle Diff Analysis

Found 5 projects in monorepo, 0 projects with changes.

📊 Quick Summary
Project Total Size Change
react-10k 5.7 MB 0
react-1k 825.4 KB 0
react-5k 2.7 MB 0
rome 984.3 KB 0
ui-components 2.1 MB 0

Generated by Rsdoctor GitHub Action

@github-actions
Copy link
Contributor

📦 Binary Size-limit

Comparing de10988 to test: support filter test by absolute path (#12749) by 9aoy

🙈 Size remains the same at 48.03MB

@hardfist hardfist marked this pull request as ready for review January 15, 2026 14:40
Copilot AI review requested due to automatic review settings January 15, 2026 14:40
Copy link
Contributor

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 refactors type aliases for artifact types into dedicated newtype structs, improving extensibility and enabling future metadata additions without breaking existing code. The change converts six type aliases (AsyncModulesArtifact, ImportedByDeferModulesArtifact, DependenciesDiagnosticsArtifact, ModuleIdsArtifact, CgcRuntimeRequirementsArtifact, and ChunkRenderArtifact) into proper newtype wrapper structs with comprehensive trait implementations.

Changes:

  • Replaced type aliases with newtype structs in artifacts/mod.rs
  • Created six new artifact module files with consistent trait implementations (Deref, DerefMut, From, FromIterator, IntoIterator)
  • Updated usage sites to work with the new types using .into() conversion

Reviewed changes

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

Show a summary per file
File Description
artifacts/mod.rs Converted type aliases to module imports and exports
artifacts/async_modules_artifact.rs New newtype wrapper for IdentifierSet with standard trait impls
artifacts/cgc_runtime_requirements_artifact.rs New newtype wrapper for UkeyMap<ChunkUkey, RuntimeGlobals> with standard trait impls
artifacts/chunk_render_artifact.rs New newtype wrapper for UkeyMap<ChunkUkey, ChunkRenderResult> with standard trait impls
artifacts/dependencies_diagnostics_artifact.rs New newtype wrapper for IdentifierMap<Vec> with additional into_values method
artifacts/imported_by_defer_modules_artifact.rs New newtype wrapper for IdentifierSet with standard trait impls
artifacts/module_ids_artifact.rs New newtype wrapper for IdentifierMap with standard trait impls
compilation/finish_modules/mod.rs Updated to use explicit type conversion with .into()
compilation/create_chunk_assets/mod.rs Updated variable declaration to use new ChunkRenderArtifact type

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hardfist hardfist merged commit ef467b4 into main Jan 15, 2026
64 of 66 checks passed
@hardfist hardfist deleted the yj/new-artifact branch January 15, 2026 14:51
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.

3 participants