Skip to content

feat: js api for compilation code generation results#10303

Merged
SyMind merged 8 commits intomainfrom
reflactor-code-generation-results
May 9, 2025
Merged

feat: js api for compilation code generation results#10303
SyMind merged 8 commits intomainfrom
reflactor-code-generation-results

Conversation

@SyMind
Copy link
Member

@SyMind SyMind commented May 8, 2025

Summary

Support compilation.codeGenerationResults in JS API.

const entry = compilation.entries.get("main");
const entryDependency = entry.dependencies[0];
const entryModule = compilation.moduleGraph.getModule(entryDependency);
const codeGenerationResult = compilation.codeGenerationResults.get(entryModule, "main");
expect(codeGenerationResult.sources.get("javascript")).toBeInstanceOf(Source);

This JS API is used in next.js for report error details.

Checklist

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

@netlify
Copy link

netlify bot commented May 8, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 41c5584
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/681d8858e563f3000838b3d8

@github-actions github-actions bot added team The issue/pr is created by the member of Rspack. release: feature release: feature related release(mr only) labels May 8, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented May 9, 2025

CodSpeed Performance Report

Merging #10303 will not alter performance

Comparing reflactor-code-generation-results (41c5584) with main (1232ecc)

Summary

✅ 11 untouched benchmarks

@SyMind SyMind marked this pull request as ready for review May 9, 2025 04:47
@SyMind SyMind merged commit 00cc2d7 into main May 9, 2025
71 of 73 checks passed
@SyMind SyMind deleted the reflactor-code-generation-results branch May 9, 2025 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: feature release: feature related release(mr only) 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