Skip to content

feat: support arrow function in on_chunks_loaded callback#12193

Merged
chenjiahan merged 2 commits intomainfrom
on_chunk_loaded_callback_1113
Nov 14, 2025
Merged

feat: support arrow function in on_chunks_loaded callback#12193
chenjiahan merged 2 commits intomainfrom
on_chunk_loaded_callback_1113

Conversation

@chenjiahan
Copy link
Copy Markdown
Member

@chenjiahan chenjiahan commented Nov 13, 2025

Summary

Check arrow function support and use appropriate function syntax in the on_chunks_loaded callback to output shorter runtime code.

Before

__webpack_require__.O(undefined, ["vendor"], function () => { return webpack_require("./a.js") });
__webpack_require__.O(undefined, ["vendor"], function () => { return webpack_require("./b.js") });
__webpack_require__.O(undefined, ["vendor"], function () => { return webpack_require("./c.js") });

After

__webpack_require__.O(undefined, ["vendor"], () => webpack_require("./a.js"));
__webpack_require__.O(undefined, ["vendor"], () => webpack_require("./b.js"));
__webpack_require__.O(undefined, ["vendor"], () => webpack_require("./c.js"));

Checklist

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

Copilot AI review requested due to automatic review settings November 13, 2025 13:42
@netlify
Copy link
Copy Markdown

netlify bot commented Nov 13, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit aa28ac3
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/6916931cdb37fd000871f935

@github-actions github-actions bot added release: feature release: feature related release(mr only) team The issue/pr is created by the member of Rspack. labels Nov 13, 2025
Copy link
Copy Markdown
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 adds support for arrow functions in the on_chunks_loaded callback to generate shorter and more modern runtime code when the target environment supports arrow functions.

  • Checks the compilation environment's arrow function support
  • Conditionally generates arrow function or traditional function syntax based on support

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 13, 2025

📦 Binary Size-limit

Comparing aa28ac3 to chore(ci): support force use github artifacts (#12187) by pshu

❌ Size increased by 384bytes from 47.45MB to 47.45MB (⬆️0.00%)

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Nov 13, 2025

CodSpeed Performance Report

Merging #12193 will not alter performance

Comparing on_chunk_loaded_callback_1113 (aa28ac3) with main (8abe4b1)

Summary

✅ 17 untouched

@chenjiahan chenjiahan requested a review from JSerFeng November 14, 2025 02:50
@chenjiahan chenjiahan merged commit 09eaac7 into main Nov 14, 2025
44 checks passed
@chenjiahan chenjiahan deleted the on_chunk_loaded_callback_1113 branch November 14, 2025 03:15
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.

3 participants