Skip to content

Comments

test(rust): ensure unused pure function call got treeshaked#4524

Merged
shulaoda merged 1 commit intomainfrom
05-13-test_rust_ensure_unused_pure_function_call_got_treeshaked
Sep 8, 2025
Merged

test(rust): ensure unused pure function call got treeshaked#4524
shulaoda merged 1 commit intomainfrom
05-13-test_rust_ensure_unused_pure_function_call_got_treeshaked

Conversation

@hyf0
Copy link
Member

@hyf0 hyf0 commented May 13, 2025

Description

Closes #3245.

Copy link
Member Author

hyf0 commented May 13, 2025


How to use the Graphite Merge Queue

Add the label graphite: merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@hyf0 hyf0 marked this pull request as ready for review May 13, 2025 07:55
Copilot AI review requested due to automatic review settings May 13, 2025 07:55
@netlify
Copy link

netlify bot commented May 13, 2025

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 5d3ceb3
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/68bebd345c6a5a0008cacb97

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 adds tests to ensure that unused pure function calls are properly tree-shaken, addressing issue 3245.

  • Updates the integration snapshot to include a marker for issue 3245.
  • Introduces a new test case in main.js with a pure annotation and verifies through a test that the function call is removed during tree-shaking.
  • Updates artifact snapshots and adds necessary test configuration.

Reviewed Changes

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

Show a summary per file
File Description
crates/rolldown/tests/snapshots/integration_rolldown__filename_with_hash.snap Updates snapshot with a new section for issue 3245.
crates/rolldown/tests/rolldown/issues/3245/main.js Adds test code with a pure annotation for the unused function call.
crates/rolldown/tests/rolldown/issues/3245/artifacts.snap Reflects the expected output post tree-shake in the snapshot.
crates/rolldown/tests/rolldown/issues/3245/_test.mjs Introduces a test to assert that the function call is tree-shaken.
crates/rolldown/tests/rolldown/issues/3245/_config.json Adds an empty configuration file for the test suite.

@hyf0 hyf0 marked this pull request as draft May 13, 2025 07:59
@sapphi-red sapphi-red force-pushed the 05-13-test_rust_ensure_unused_pure_function_call_got_treeshaked branch from d43e083 to ec59792 Compare September 8, 2025 10:38
@sapphi-red sapphi-red marked this pull request as ready for review September 8, 2025 10:46
@sapphi-red sapphi-red enabled auto-merge (squash) September 8, 2025 10:47
@hyf0 hyf0 disabled auto-merge September 8, 2025 10:48
Copy link
Member Author

hyf0 commented Sep 8, 2025

Merge activity

  • Sep 8, 10:49 AM UTC: The merge label 'graphite: merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Sep 8, 11:07 AM UTC: hyf0 added this pull request to the Graphite merge queue.
  • Sep 8, 11:31 AM UTC: The Graphite merge queue couldn't merge this PR because it was not satisfying all requirements (Failed CI: 'node-test (ubuntu-latest) / Node Test', 'node-test (macos-latest) / Node Test', 'node-test (windows-latest) / Node Test').
  • Sep 8, 11:31 AM UTC: The merge label 'graphite: merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Sep 8, 11:31 AM UTC: The merge label 'graphite: merge' was removed. This PR will no longer be merged by the Graphite merge queue

<!-- Thank you for contributing! -->

### Description

Closes #3245.

<!-- Please insert your description here and provide especially info about the "what" this PR is solving -->
@graphite-app graphite-app bot force-pushed the 05-13-test_rust_ensure_unused_pure_function_call_got_treeshaked branch from ec59792 to 5d3ceb3 Compare September 8, 2025 11:25
@shulaoda shulaoda merged commit d6d924c into main Sep 8, 2025
34 of 38 checks passed
@shulaoda shulaoda deleted the 05-13-test_rust_ensure_unused_pure_function_call_got_treeshaked branch September 8, 2025 11:45
@github-actions github-actions bot mentioned this pull request Sep 8, 2025
shulaoda added a commit that referenced this pull request Sep 8, 2025
## [1.0.0-beta.36] - 2025-09-08
> [!warning]
> ### 💥 BREAKING CHANGES
> 
> - drop CJS format, increase minimum required node (#6025) by @sxzz


### 🚀 Features

- rolldown_plugin_reporter: statically imported dynamic import warning (#6065) by @shulaoda
- rolldown_plugin_reporter: warn large chunks (#6063) by @shulaoda
- rolldown: oxc v0.87.0 (#5975) by @Boshen

### 🐛 Bug Fixes

- allow keeping whitespace while enabling minify (#5893) by @sapphi-red
- dev/watch: build connection between file in `this.addWatchFile` and currently transformed module during transform hook (#6048) by @hyf0
- validator of `output.minify` (#6062) by @IWANABETHATGUY
- codspeed rust benchmark ci (#6052) by @IWANABETHATGUY
- just command in ci (#6045) by @IWANABETHATGUY
- watch: only consider files read from disk are able to watch (#6037) by @hyf0

### 🚜 Refactor

- dev: introduce `DevWatchOptions` for enhanced file watching configuration (#6057) by @hyf0
- unify to use `is_in_node_modules` from `rolldown_plugin_utils` (#6066) by @shulaoda

### 🧪 Testing

- rust: ensure unused pure function call got treeshaked (#4524) by @hyf0
- hmr: tweak improper test (#6034) by @hyf0
- hmr: add test of editing multiple files in the same timeframe (#6029) by @hyf0
- hmr: support to edit multiple files in the same timeframe (#6014) by @hyf0

### ⚙️ Miscellaneous Tasks

- deps: lock file maintenance rust crates (#6003) by @renovate[bot]
- deps: lock file maintenance npm packages (#5995) by @renovate[bot]
- add auto-assign PR workflow for organization members (#6058) by @IWANABETHATGUY
- fix benchmark-node workflow (#6060) by @IWANABETHATGUY
- adding `test-node-rolldown-only` just command (#6055) by @IWANABETHATGUY
- just commands in ci (#6056) by @IWANABETHATGUY
- run test ci when `justfile` is changed (#6049) by @IWANABETHATGUY
- remove unused warning for conditional compiled`SimplifyMinifyOptions` (#6047) by @IWANABETHATGUY
- remove auto approval ci (#6051) by @IWANABETHATGUY
- adding rustfmt components for `repo-validation` (#6053) by @IWANABETHATGUY
- repo: check format/style in `just lint-rust` (#6050) by @hyf0
- repo/ai: refine `justfile` (#6038) by @hyf0
- repo/ai: add `AGENTS.md` and `CLAUDE.md` (#6039) by @hyf0
- deps: update github-actions (major) (#6041) by @renovate[bot]
- deps: update github-actions (#6040) by @renovate[bot]
- deps: update dependency rolldown-plugin-dts to v0.16.1 (#6035) by @renovate[bot]

Co-authored-by: shulaoda <[email protected]>
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.

[Bug]: /* #__PURE__ */ inside an IIFE is not respected

4 participants