Skip to content

Add scaffolding for native symbol prop#1010

Merged
benjervis merged 22 commits intomainfrom
symbol-prop-progressive
Feb 19, 2026
Merged

Add scaffolding for native symbol prop#1010
benjervis merged 22 commits intomainfrom
symbol-prop-progressive

Conversation

@benjervis
Copy link
Contributor

Motivation

This is the very first piece of re-writing symbol propagation in Rust. It contains mostly wiring, and just enough functionality to not be nonsense.

This also sets up the progressive symbol prop pattern, where we track symbols as we go through the build step rather than doing the two pass pattern afterwards.

Changes

The essence of this change is that we now have a SymbolTracker that makes up part of the build process.
As we run a build, and discover assets, the result of that asset returns the dependencies that that asset will require (which then will need transforming etc) and the symbols that the asset exports.

We feed both of these pieces of information to the symbol tracker. It takes the dependencies and registers them as SymbolRequirements, some symbol that we'll need but have not located. Then it takes the new symbols from the asset and, if it's not here as a re-export, attempts to see what symbol requirements can be satisfied with this new symbol. Further documentation of the process incoming once the functionality is a bit more fleshed out.

At the moment it only handles the basic case of a regular re-export, export { mySymbol } from './dep';. Renames, star re-exports, and circular deps are all on the todo list. There are also a bunch of panic!s in there, those will be handled properly in further iterations.

Proper changes

  • The AssetGraphBuilder now contains the symbol tracker. The tracker needs access to the asset graph, and so can't be on the asset graph.
  • Got some TODOs in there about caching a prev_symbol_tracker for incremental builds, but that hasn't been implemented yet
  • The symbol tracker information gets serialised back to JS and applied to the nodes to match the existing API
  • New feature flag is rustSymbolTracker

Bits and bobs

  • Symbols on an Asset now contain is_weak. This didn't exist in JS, so we had hard coded it to false, but it's real useful for the symbol tracker
  • A couple of new methods on the asset graph to get the incoming graph nodes, rather than just outgoing.
  • A new type alias for DependencyId has been added to match AssetId
  • Some structs now need to derive Eq as well so that they're compatible with HashMaps

Checklist

  • Existing or new tests cover this change
  • There is a changeset for this change, or one is not required

@benjervis benjervis requested a review from a team as a code owner February 8, 2026 23:45
@changeset-bot
Copy link

changeset-bot bot commented Feb 8, 2026

🦋 Changeset detected

Latest commit: 6031d45

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 114 packages
Name Type
@atlaspack/feature-flags Minor
@atlaspack/core Minor
@atlaspack/rust Minor
@atlaspack/bundler-default Patch
atlaspack Patch
@atlaspack/build-cache Patch
@atlaspack/cache Patch
@atlaspack/cli Patch
@atlaspack/fs Patch
@atlaspack/graph Patch
@atlaspack/types-internal Patch
@atlaspack/utils Patch
@atlaspack/inspector Patch
@atlaspack/optimizer-inline-requires Patch
@atlaspack/packager-html Patch
@atlaspack/packager-js Patch
@atlaspack/reporter-cli Patch
@atlaspack/reporter-compiled-css-in-js-migration-map Patch
@atlaspack/reporter-conditional-manifest Patch
@atlaspack/runtime-js Patch
@atlaspack/runtime-react-refresh Patch
@atlaspack/transformer-compiled-css-in-js Patch
@atlaspack/transformer-css Patch
@atlaspack/transformer-html Patch
@atlaspack/transformer-js Major
@atlaspack/transformer-react-refresh-wrap Patch
@atlaspack/transformer-tokens Patch
@atlaspack/node-resolver-core Patch
@atlaspack/config-default Major
@atlaspack/config-webextension Major
@atlaspack/e2e-tests Patch
@atlaspack/register Patch
@atlaspack/test-utils Patch
@atlaspack/bundle-stats Patch
@atlaspack/packaging-test-harness Patch
@atlaspack/query Patch
@atlaspack/optimizer-image Major
@atlaspack/reporter-bundle-stats Patch
@atlaspack/transformer-image Major
@atlaspack/inspector-frontend Patch
@atlaspack/logger Patch
@atlaspack/source-map Patch
@atlaspack/link Patch
@atlaspack/transformer-postcss Patch
@atlaspack/transformer-svg Patch
@atlaspack/package-manager Patch
@atlaspack/workers Patch
@atlaspack/codeframe Patch
@atlaspack/plugin Patch
@atlaspack/profiler Patch
@atlaspack/types Patch
@atlaspack/packager-css Patch
@atlaspack/reporter-bundle-buddy Patch
@atlaspack/transformer-less Patch
@atlaspack/transformer-xml Patch
@atlaspack/ts-utils Patch
@atlaspack/optimizer-blob-url Patch
@atlaspack/optimizer-css Patch
@atlaspack/optimizer-data-url Patch
@atlaspack/optimizer-svgo Patch
@atlaspack/optimizer-swc Patch
@atlaspack/optimizer-terser Patch
@atlaspack/packager-raw-url Patch
@atlaspack/packager-svg Patch
@atlaspack/packager-webextension Patch
@atlaspack/packager-xml Patch
@atlaspack/reporter-build-metrics Patch
@atlaspack/reporter-bundle-analyzer Patch
@atlaspack/reporter-dev-server Patch
@atlaspack/reporter-json Patch
@atlaspack/reporter-lsp Patch
@atlaspack/reporter-sourcemap-visualiser Patch
@atlaspack/reporter-tracer Patch
@atlaspack/resolver-glob Patch
@atlaspack/runtime-browser-hmr Patch
@atlaspack/runtime-service-worker Patch
@atlaspack/runtime-webextension Patch
@atlaspack/transformer-babel Patch
@atlaspack/transformer-compiled Patch
@atlaspack/transformer-posthtml Patch
@atlaspack/transformer-typescript-types Patch
@atlaspack/transformer-webextension Patch
@atlaspack/transformer-webmanifest Patch
@atlaspack/watcher-watchman-js Patch
@atlaspack/validator-eslint Patch
@atlaspack/validator-typescript Patch
@atlaspack/resolver-default Patch
@atlaspack/resolver-tesseract Patch
@atlaspack/optimizer-cssnano Patch
@atlaspack/transformer-compiled-external Patch
@atlaspack/transformer-sass Patch
@atlaspack/transformer-typescript-tsc Patch
@atlaspack/bundler-library Patch
@atlaspack/compressor-brotli Patch
@atlaspack/compressor-gzip Patch
@atlaspack/compressor-raw Patch
@atlaspack/namer-default Patch
@atlaspack/optimizer-htmlnano Patch
@atlaspack/packager-raw Patch
@atlaspack/packager-ts Patch
@atlaspack/packager-wasm Patch
@atlaspack/transformer-glsl Patch
@atlaspack/transformer-graphql Patch
@atlaspack/transformer-inline-string Patch
@atlaspack/transformer-inline Patch
@atlaspack/transformer-json Patch
@atlaspack/transformer-jsonld Patch
@atlaspack/transformer-mdx Patch
@atlaspack/transformer-pug Patch
@atlaspack/transformer-raw Patch
@atlaspack/transformer-svg-react Patch
@atlaspack/transformer-toml Patch
@atlaspack/transformer-worklet Patch
@atlaspack/transformer-yaml Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2026

Rust Package Changeset Check

✅ The @atlaspack/rust package has been included in your changeset. Your Rust changes will be published.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2026

📊 Type Coverage Report

Coverage Comparison

Metric Baseline Current Change
Coverage Percentage 92.24% 92.23% 📉 -0.01%
Correctly Typed 219,978 220,130 +152
Total Expressions 238,480 238,674 +194
Untyped Expressions 18,502 18,544 +42

Files with Most Type Issues (Top 15)

File Issues Affected Lines
packages/core/integration-tests/test/javascript.ts 1152 745
packages/core/integration-tests/test/cache.ts 885 626
packages/core/integration-tests/test/scope-hoisting.ts 622 489
packages/utils/node-resolver-core/test/resolver.ts 476 177
packages/core/integration-tests/test/html.ts 468 294
packages/core/integration-tests/test/sourcemaps.ts 364 182
packages/core/test-utils/src/utils.ts 330 205
packages/core/integration-tests/test/incremental-bundling.ts 298 206
packages/core/core/src/dumpGraphToGraphViz.ts 251 108
packages/core/integration-tests/test/transpilation.ts 230 139
packages/core/integration-tests/test/output-formats.ts 227 161
packages/transformers/webextension/src/WebExtensionTransformer.ts 210 80
packages/core/core/src/requests/BundleGraphRequestRust.ts 194 67
packages/core/integration-tests/test/css-modules.ts 191 107
packages/core/core/src/requests/TargetRequest.ts 190 133

This report was generated by the Type Coverage GitHub Action

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

📊 Benchmark Results

⚠️ Performance regressions detected!

📊 Benchmark Results

Overall Performance

Test Duration JS Memory Peak Native Memory Peak vs Baseline Status
Three.js Real Repository (JS) 16.98s 2.01GB 2.21GB +7.10% duration, +0.26% JS memory 🔴 Regression
Three.js Real Repository (V3) 22.32s 3.22GB 3.30GB +13.34% duration, +4.45% JS memory 🔴 Regression

🔍 Detailed Phase Analysis

Three.js Real Repository (JS)

Phase Duration (avg) Duration (p95) Memory Peak (avg) Memory Peak (p95)
resolving 7.98s 8.93s 1.47GB 1.78GB
transforming 7.97s 8.89s 1.47GB 1.78GB
bundling 7.76s 8.69s 1.47GB 1.78GB
bundled 7.37s 8.32s 1.57GB 1.85GB
packaging 4.91s 5.34s 1.67GB 1.95GB
optimizing 4.74s 5.15s 2.01GB 2.20GB

Three.js Real Repository (V3)

Phase Duration (avg) Duration (p95) Memory Peak (avg) Memory Peak (p95)
bundling 12.62s 17.47s 2.55GB 2.75GB
bundled 12.26s 17.11s 2.72GB 2.89GB
packaging 6.53s 6.94s 2.82GB 3.00GB
optimizing 6.38s 6.83s 3.22GB 3.33GB

💾 Unified Memory Analysis

Three.js Real Repository (JS) Memory Statistics

Memory Type Metric Min Mean Median P95 P99 Max Std Dev
JavaScript RSS 1.39GB 1.85GB 1.84GB 2.20GB 2.20GB 2.20GB 236.01MB
Heap Used 80.37MB 87.74MB 92.19MB 99.43MB 99.43MB 99.43MB 6.81MB
Heap Total 93.85MB 120.47MB 128.09MB 163.16MB 163.16MB 163.16MB 20.08MB
External 38.88MB 105.96MB 173.02MB 173.02MB 173.02MB 173.02MB 67.06MB
Native (Rust) Physical Memory 1.70GB 1.88GB 1.88GB 2.06GB 2.16GB 2.21GB 126.24MB
Virtual Memory 29.92GB 30.57GB 30.59GB 30.77GB 30.90GB 30.95GB 168.47MB

Sample Counts: JS: 14, Native: 277

Three.js Real Repository (V3) Memory Statistics

Memory Type Metric Min Mean Median P95 P99 Max Std Dev
JavaScript RSS 2.49GB 2.96GB 3.04GB 3.33GB 3.33GB 3.33GB 290.16MB
Heap Used 77.56MB 77.98MB 77.95MB 78.74MB 78.74MB 78.74MB 0.29MB
Heap Total 85.95MB 89.32MB 89.20MB 94.20MB 94.20MB 94.20MB 2.77MB
External 179.70MB 182.60MB 185.49MB 185.49MB 185.49MB 185.49MB 2.89MB
Native (Rust) Physical Memory 2.67GB 2.94GB 2.95GB 3.21GB 3.30GB 3.30GB 174.03MB
Virtual Memory 30.73GB 33.16GB 33.49GB 33.76GB 33.89GB 33.89GB 861.22MB

Sample Counts: JS: 14, Native: 253

🖥️ Environment

  • Node.js: v22.17.0
  • Platform: linux (x64)
  • CPU: AMD EPYC 7763 64-Core Processor
  • Total Memory: 15.62GB
  • Git SHA: 6031d45
  • Branch: symbol-prop-progressive
  • Timestamp: 2026-02-18T03:06:33.626Z

@benjervis benjervis force-pushed the symbol-prop-progressive branch from d730e39 to 6188cd5 Compare February 9, 2026 04:24
@benjervis benjervis merged commit 45a0dc5 into main Feb 19, 2026
56 of 59 checks passed
@benjervis benjervis deleted the symbol-prop-progressive branch February 19, 2026 00:41
@atlaspack-ci atlaspack-ci bot mentioned this pull request Feb 17, 2026
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.

2 participants