Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
f13ce16
test: Effect service method demand fixtures (base case)
effect-bot Nov 4, 2026
3fd6cc6
feat(experimental): remove unread Effect service methods (base case)
effect-bot Nov 4, 2026
53a28ed
test: Effect service shaking regressions and real-Effect gates
effect-bot Nov 4, 2026
fb4abb3
fix(experimental): close service shaking escapes found in review
effect-bot Nov 4, 2026
fd9d678
test: Effect service shaking regressions from second review
effect-bot Nov 4, 2026
c1696e4
fix(experimental): close second-review service shaking escapes
effect-bot Nov 4, 2026
22b5459
test: Effect service shaking explicit-prototype regression
effect-bot Nov 4, 2026
89f0ddb
fix(experimental): keep provider objects that set an explicit prototype
effect-bot Nov 4, 2026
e83a7bf
refactor(experimental): simplify the Effect service shaking pass
effect-bot Nov 4, 2026
d33d53d
ci, docs: fork CI and documentation for effect service shaking
effect-bot Nov 4, 2026
2bb9679
test: real-Effect gates for the sink-based escape rules
effect-bot Nov 4, 2026
e036ce1
test: drop snapshots for the not-yet-passing sink gates
effect-bot Nov 4, 2026
0237fae
ci: scope effect service shaking CI to Effect's Node use case
effect-bot Nov 4, 2026
3dc5709
ci: fail fast in the effect service shaking workflow
effect-bot Nov 4, 2026
4a910a0
feat(effect-service-shaking): replace the API allow-list with sinks
effect-bot Nov 4, 2026
c4efd5e
test(effect-service-shaking): cover effectServiceShakingAssumeNoRefle…
effect-bot Nov 4, 2026
dbb7fb6
test(effect-service-shaking): provenance gates without the reflection…
effect-bot Nov 4, 2026
d40a5ca
test(effect-service-shaking): regression probes for the review findings
effect-bot Nov 4, 2026
ca16acc
feat(effect-service-shaking): provenance-based sinks, drop the reflec…
effect-bot Nov 4, 2026
fae83b5
fix(effect-service-shaking): scope externals to user code; bound fixt…
effect-bot Nov 4, 2026
dd8f07b
style(effect-service-shaking): if let for the module loop
effect-bot Nov 4, 2026
b40dc49
test(effect-service-shaking): regression coverage for the consolidate…
effect-bot Nov 5, 2026
0e01da3
feat(effect-service-shaking): consolidated provenance specification
effect-bot Nov 5, 2026
ccf0826
test(effect-service-shaking): map and all regressions
effect-bot Nov 5, 2026
1f15718
test(effect-service-shaking): keep coverage inside the A1-A4 contract
effect-bot Nov 5, 2026
b15486b
docs(effect-service-shaking): document the A1-A4 contract
effect-bot Nov 5, 2026
c8ffb45
refactor(effect-service-shaking): A1-A4 contract, drop provenance ana…
effect-bot Nov 5, 2026
ac88b41
test(effect-service-shaking): review regressions under A1-A4
effect-bot Nov 5, 2026
938d803
fix(effect-service-shaking): close review gaps under A1-A4
effect-bot Nov 5, 2026
02dc700
test(effect-service-shaking): switch TDZ and dynamic Function constru…
effect-bot Nov 5, 2026
c942a96
fix(effect-service-shaking): switch cases do not prove initialisation
effect-bot Nov 5, 2026
ff05c31
test(effect-service-shaking): import that cycles back to its own module
effect-bot Nov 5, 2026
2ea38cc
fix(effect-service-shaking): keep provider reads of every import
effect-bot Nov 5, 2026
7497bcd
refactor(effect-service-shaking): drop dead tag and numeric-key paths
effect-bot Nov 5, 2026
7b6e855
docs(effect-service-shaking): describe the current bailout warning
effect-bot Nov 5, 2026
2c06c54
test(effect-service-shaking): runtime-computed loader names are out o…
effect-bot Nov 5, 2026
dfdea2b
docs(effect-service-shaking): state the runtime-computed loader assum…
effect-bot Nov 5, 2026
67ad756
test(effect-service-shaking): Reflect.get with a literal loader name
effect-bot Nov 5, 2026
c4f7248
fix(effect-service-shaking): check loader names read through Reflect.get
effect-bot Nov 5, 2026
e426c02
test(effect-service-shaking): qualified and spread Reflect.get loaders
effect-bot Nov 5, 2026
f422d04
fix(effect-service-shaking): global-qualified and spread Reflect.get
effect-bot Nov 5, 2026
9d1771b
test(effect-service-shaking): check the inlined Reflect alias at its …
effect-bot Nov 5, 2026
a084244
test(effect-service-shaking): measurement fixture for the generated O…
effect-bot Nov 5, 2026
f5654cf
test(effect-service-shaking): coverage for per-key lookups and constr…
effect-bot Nov 5, 2026
8f73e74
feat(effect-service-shaking): class keys, per-key lookups and constru…
effect-bot Nov 5, 2026
3e99580
test(effect-service-shaking): allow-listed constructor pipeable, esca…
effect-bot Nov 5, 2026
0799b40
test(effect-service-shaking): regressions for the review of 3e99580e
effect-bot Nov 5, 2026
9f0eda8
fix(effect-service-shaking): close the four review findings of 3e99580e
effect-bot Nov 5, 2026
96fc45d
test(effect-service-shaking): named provider callbacks escape through…
effect-bot Nov 5, 2026
7f3c87e
fix(effect-service-shaking): do not follow named callbacks that refer…
effect-bot Nov 5, 2026
c364cc0
test(effect-service-shaking): provider reads its binding inside the i…
effect-bot Nov 5, 2026
08e5226
fix(effect-service-shaking): a binding is not initialised inside its …
effect-bot Nov 5, 2026
d64c06c
test(effect-service-shaking): parameter defaults and loop heads are i…
effect-bot Nov 5, 2026
af570f1
fix(effect-service-shaking): parameters and loop heads in their TDZ
effect-bot Nov 5, 2026
dcc3dea
test(effect-service-shaking): catch-pattern defaults are in TDZ
effect-bot Nov 5, 2026
9140354
fix(effect-service-shaking): catch bindings in their own pattern are …
effect-bot Nov 5, 2026
7f8a8e0
refactor(effect-service-shaking): name the found-site record, share m…
effect-bot Nov 5, 2026
4d04232
docs(effect-service-shaking): class-key protocol and named builder rules
effect-bot Nov 5, 2026
81230a1
docs(effect-service-shaking): inner-name rule and initialization reads
effect-bot Nov 5, 2026
ea4a1e5
test(effect-service-shaking): measurement fixture for a Distilled client
effect-bot Nov 5, 2026
8434b35
test(effect-service-shaking): drop a removal check for a schema the c…
effect-bot Nov 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 110 additions & 0 deletions .github/workflows/effect-service-shaking.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: Effect Service Shaking

# Fork-owned CI for `experimental.effectServiceShaking`, scoped to Effect's
# use case on Node: one Linux job that runs the Effect service fixtures and the
# real-Effect gates through the JS API. It builds only the integration test
# binary, the NAPI binding and the JS glue those checks need. The rest of
# Rolldown's CI (full integration suite, test262, other targets, lints) is
# intentionally not run here.

on:
# PR runs only, so a push to the PR branch does not start a second run.
pull_request:
branches:
- effect-pinned-v1.2.16
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0

jobs:
effect-service-shaking:
name: Effect service fixtures and real-Effect gates (Linux, Node 24)
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm

# Fixtures resolve npm packages from the root, including `effect` for the
# real-Effect gates.
- run: pnpm install --frozen-lockfile --ignore-scripts

- name: Install the pinned Rust toolchain
run: rustup show

- uses: Swatinem/rust-cache@v2
with:
key: effect-service-shaking

# Compile once with the optimized `effect-verify` profile, then run the
# fixtures against the prebuilt binary under a hard 10 second budget. A
# timeout fails the job (exit 124); it is never treated as a pass.
- name: Build the Effect service fixture runner
run: cargo test --profile effect-verify -p rolldown --test integration --no-run

- name: Effect service fixtures (stub and real Effect, 10s budget)
run: timeout 10 cargo test --profile effect-verify -p rolldown --test integration -- effect_service

- name: Effect service snapshots are up to date
run: |
changes=$(git status --porcelain -- crates/rolldown/tests/rolldown/tree_shaking/effect_service crates/rolldown/tests/rolldown/tree_shaking/effect_service_real)
if [ -n "$changes" ]; then
echo "$changes"
git diff -- crates/rolldown/tests/rolldown/tree_shaking
exit 1
fi

# Only the binding and the JS glue; the JS type check is not needed to
# run the gates.
- name: Build the NAPI binding (debug)
run: pnpm --filter rolldown build-binding

- name: Build the JS glue
run: pnpm --filter rolldown build-node

# Bundles the two real-Effect removal gates through the JS API with the
# option on, then runs each gate's own `_test.mjs` (behaviour and removal
# checks). Other `effect_service_real` fixtures are covered by the cargo
# step above.
- name: Real-Effect gates through the JS API
run: |
cat > run-gates.mjs <<'SCRIPT'
import { rolldown } from './packages/rolldown/dist/index.mjs'
import { execFileSync } from 'node:child_process'
import fs from 'node:fs'
import path from 'node:path'

const root = 'crates/rolldown/tests/rolldown/tree_shaking/effect_service_real'
for (const name of ['lifecycle', 'cross_module']) {
const dir = path.resolve(root, name)
const bundle = await rolldown({
input: path.join(dir, 'main.js'),
cwd: dir,
platform: 'node',
experimental: { effectServiceShaking: true },
})
await bundle.write({ dir: path.join(dir, 'dist'), format: 'esm' })
await bundle.close()
fs.writeFileSync(path.join(dir, 'dist', 'package.json'), '{ "type": "module" }')
execFileSync(process.execPath, ['_test.mjs'], { cwd: dir, stdio: 'inherit' })
console.log(`${name}: ok`)
}
SCRIPT
node run-gates.mjs
9 changes: 9 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -339,3 +339,12 @@ opt-level = "s"
# it will strip these information for non-debug files
debug = "full"
strip = "none"

# Effect service shaking verification: the fixtures bundle the real `effect`
# package four times each, which is parse-bound in an unoptimized build.
[profile.effect-verify]
inherits = "test"
opt-level = 1

[profile.effect-verify.package."*"]
opt-level = 3
56 changes: 56 additions & 0 deletions crates/rolldown/examples/effect_service_shaking.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#![expect(clippy::print_stdout, reason = "prints measurements")]

use std::time::Instant;

use rolldown::{Bundler, BundlerOptions, ExperimentalOptions, InputItem, OutputFormat, Platform};
use sugar_path::SugarPath;

// Bundles one entry twice, without and with `experimental.effectServiceShaking`,
// and reports the output size and the median build time of each.
//
// cargo run --release --example effect_service_shaking -- <entry> <out-dir> [runs]

async fn build(entry: &std::path::Path, out_dir: &std::path::Path, enabled: bool) -> u128 {
let mut bundler = Bundler::new(BundlerOptions {
input: Some(vec![InputItem {
name: Some("main".to_string()),
import: entry.to_string_lossy().into_owned(),
}]),
cwd: Some(entry.parent().unwrap().to_path_buf()),
dir: Some(out_dir.to_string_lossy().into_owned()),
format: Some(OutputFormat::Esm),
platform: Some(Platform::Node),
experimental: Some(ExperimentalOptions {
effect_service_shaking: Some(enabled),
..Default::default()
}),
..Default::default()
})
.expect("Failed to create bundler");
let start = Instant::now();
bundler.write().await.expect("build failed");
start.elapsed().as_micros()
}

#[tokio::main]
async fn main() {
let args: Vec<String> = std::env::args().collect();
let entry = std::path::Path::new(&args[1]).absolutize().into_owned();
let out = std::path::Path::new(&args[2]).absolutize().into_owned();
let runs: usize = args.get(3).and_then(|n| n.parse().ok()).unwrap_or(5);
// Interleave the two configurations so machine load affects both alike.
let mut times = [vec![], vec![]];
for _ in 0..runs {
for (index, enabled) in [false, true].into_iter().enumerate() {
let dir = out.join(if enabled { "on" } else { "off" });
times[index].push(build(&entry, &dir, enabled).await);
}
}
for (index, label) in ["off", "on"].into_iter().enumerate() {
let times = &mut times[index];
times.sort_unstable();
let size =
std::fs::metadata(out.join(label).join("main.js")).map(|m| m.len()).unwrap_or_default();
println!("{label}: {size} bytes, median {} ms", times[times.len() / 2] / 1000);
}
}
Loading
Loading