Skip to content

Releases: fallow-rs/srcmap

v0.3.8 — SIMD mappings scan + incremental sort tracking

01 Jun 20:57
v0.3.8
236d208

Choose a tag to compare

Performance

This release is a focused performance pass on the hottest path in the library: decoding and encoding the mappings VLQ string. All three changes are internal, with no API changes.

SIMD-accelerated mappings pre-count (srcmap-sourcemap, srcmap-codec)

Both decoders pre-scan the mappings string to count ; and , separators for capacity hints before decoding. That scan was a scalar byte loop LLVM does not vectorize. It's now backed by memchr's SIMD-accelerated count (already in the dependency tree), roughly 7x faster on the scan itself.

  • srcmap-sourcemap: the pre-count was ~18% of total VLQ decode time, and decode is ~93% of a parse (the most common operation). from_vlq dropped ~19% on the chartjs fixture.
  • srcmap-codec: the pre-count was ~26% of decode() on a 50K-segment synthetic fixture; decode() is ~22% faster on that input.

Incremental sort-order tracking (srcmap-generator)

Encoding previously re-scanned the entire mappings array (is_sorted_by_position, O(n)) to decide whether a sort was needed. That's replaced with an O(1) mappings_in_order flag maintained through a single push_mapping choke point, removing one full cold pass per encode on the default path. The removed scan measured at ~15% of to_json on a 100K-mapping map. Out-of-order insertion is still correctly sorted at encode time (covered by a new test).

Full Changelog: v0.3.7...v0.3.8

v0.3.7 - Source map interop and offset lookup helpers

01 Jun 14:03
v0.3.7
7ed6167

Choose a tag to compare

Features

  • Added SourceMap::from_parts and SourceMap::from_parts_with_extensions for building source maps directly from decoded components. This helps Rust integrations and bundler pipelines avoid serializing intermediate source-map JSON just to parse it again before lookup or remapping.
  • Added GeneratedOffsetLookup, a reusable helper for converting generated UTF-8 byte offsets, such as V8 coverage ranges, into source-map line and UTF-16 column positions. It works with eager and lazy source maps through the shared lookup trait.

Performance

  • Added benchmark coverage around parsing from decoded parts and offset-based source-map lookups.

Bug Fixes

  • Restored CI compatibility on stable Rust by avoiding the reserved gen keyword in examples.
  • Pinned the fallow CI dependency to keep repository checks reproducible.

Infrastructure / CI

  • Updated Rust, Node.js, and GitHub Action dependencies, including napi, sonic-rs, ureq, criterion, simd-json, and release workflow actions.
  • Released all Rust crates and npm packages at 0.3.7.

Breaking Changes

  • None.

Full Changelog: v0.3.6...v0.3.7

v0.3.6 — scopes-based symbolication and trace-mapping parity fixes

17 Apr 08:06
v0.3.6
e755128

Choose a tag to compare

Features

  • Scopes-based function name resolution in srcmap-symbolicate. When a mapping has no associated name, the symbolicator now walks the scopes-proposal range tree at the generated position, skips hidden ranges, and returns the innermost stack-frame scope's original name. Implements the FindOriginalFunctionName operation from the ECMA-426 scopes proposal, so symbolicated frames pick up readable function names from scopes data alone.

Bug fixes

  • srcmap-sourcemap: match @jridgewell/trace-mapping tie-break for duplicate-column segments. When two segments share a generated column, GLB now returns the earliest-equal segment and LUB returns the latest-equal, matching trace-mapping semantics. Rust's binary_search_by_key previously returned an unspecified index among equal keys, which could pick a NO_SOURCE segment over the source-bearing one and break drop-in parity.
  • srcmap-sourcemap: preserve metadata when flattening indexed (sectioned) maps. debugId, x_* / x-* extensions, and sourceRoot from the outer map are now propagated into the flattened result, and scopes from each section are merged (generated ranges offset, definition and source indices remapped) instead of being dropped.
  • srcmap-remapping: only compose the inner map against its matching outer source. compose_pair previously returned the inner map for every outer source, so unrelated passthrough sources were incorrectly rewritten through the inner map. The match is now restricted to outer sources that equal inner.file (or the sole outer source when inner.file is unset).

Docs

  • Reframe "full ECMA-426 compliance" as stable core support plus explicitly-labelled draft proposals. debugId, rangeMappings, scopes/variables, and sourcesFunctionMappings are not in the published ECMA-426 core — README, ROADMAP, crate/package READMEs, and the repo badge now say so, and ROADMAP links point at the canonical tc39/ecma426 proposal files.

Full Changelog: v0.3.5...v0.3.6

v0.3.5 - Corrected Release Tagging

13 Apr 09:34
v0.3.5
d991337

Choose a tag to compare

Bug fixes

  • Corrected the release sequencing after the earlier v0.3.4 tag mismatch.
  • Cut a clean follow-up patch release from the actual release commit.

Infrastructure / CI

  • Carries forward the npm trusted publishing alignment from v0.3.4.
  • Keeps the release workflow on the same OIDC/trusted publishing path used by fallow.

Full Changelog: v0.3.4...v0.3.5

v0.3.4 - Trusted Publishing Alignment

13 Apr 09:28
v0.3.4
67d9b21

Choose a tag to compare

Features

  • Aligned npm publishing with the trusted publishing flow used in fallow.

Bug fixes

  • Removed NODE_AUTH_TOKEN from the npm publish job so package publishing no longer depends on the legacy npm token path.
  • Added a recent npm bootstrap step for trusted publishing compatibility.
  • Added publish fallback logic so package jobs retry without provenance if provenance publishing fails.

Infrastructure / CI

  • Updated the release workflow to use the OIDC/trusted publishing path consistently for npm releases.

Full Changelog: v0.3.3...v0.3.4

v0.3.3 - Coverage Workflow Hardening

13 Apr 08:54
v0.3.3
37ad90f

Choose a tag to compare

New crates / packages

  • No new crates or top-level packages in this patch release.
  • The existing npm wrapper packages now participate more reliably in the release and test flow.

Features

  • Added a first-class offset-based coverage helper for @srcmap/sourcemap-wasm.
  • Added a fallow-cloud-style coverage benchmark fixture that models cached maps and beacon-style offset batches.

Performance

  • Optimized coverage offset lookup paths for repeated batch workloads.
  • Added batch-oriented measurement for WASM and NAPI lookups so the benchmark reflects the real bulk coverage path instead of only individual lookup loops.

Bug fixes

  • Fixed release/version synchronization so newly published JS wrapper packages stay aligned.
  • Fixed CI and release workflow issues around npm publishing, benchmark imports, and JS hygiene.
  • Corrected coverage helper compatibility across WASM and NAPI batch APIs.

Breaking changes

  • None.

Infrastructure / CI

  • Expanded JS test coverage to include wrapper and compat suites.
  • Extended coverage/reporting to cover more of the published JS surface.
  • Tightened CI around benchmark compilation, JS hygiene, and production-coverage workflow validation.

Full Changelog: v0.3.2...v0.3.3

v0.3.2 - Repo hardening and package refresh

12 Apr 12:12
v0.3.2
3469ccc

Choose a tag to compare

Features

  • Refresh the JS and WASM package surfaces across @srcmap/gen-mapping, @srcmap/source-map, @srcmap/trace-mapping, @srcmap/remapping, and @srcmap/sourcemap.
  • Tighten the CLI surface and test coverage around schema, lookup, validation, and remapping workflows.

Performance

  • Expand benchmark coverage and real-world fixture handling to make package and runtime comparisons more representative.
  • Continue tuning Rust core crates and bindings with follow-on cleanup across generator, sourcemap, remapping, scopes, and symbolication paths.

Bug Fixes

  • Fix compatibility and API edge cases across the Rust crates and the Node.js bindings.
  • Sync all published Rust and npm package versions to 0.3.2 so internal package references stay aligned.

Infrastructure / CI

  • Raise the repository quality baseline with stricter linting, formatting, dependency, and workflow checks.
  • Update release automation and supporting GitHub workflows for more reliable publishing.
  • Add pnpm workspace metadata and related maintenance configuration to keep JS package management predictable.

Full Changelog: v0.3.1...v0.3.2

v0.3.1 — Codec decode 2-4x faster, repo moved to fallow-rs

12 Apr 07:36
v0.3.1
e236f0b

Choose a tag to compare

Performance

  • srcmap_codec::decode is 2-4x faster on real-world source maps. A single attribute change (#[inline]#[inline(always)] on vlq_decode) closes the cross-crate inlining gap that prevented rustc from inlining the VLQ inner loop into the codec's decode path. Benchmarks on real fixtures:

    • preact (17 KB mappings): 68.6 µs → 17.2 µs (−75%)
    • chartjs (490 KB mappings): 3.15 ms → 1.22 ms (−61%)
    • pdfjs (2.3 MB mappings): 11.49 ms → 6.15 ms (−46%)

    This benefits all consumers of @srcmap/codec and srcmap-codec — the speedup propagates through NAPI and WASM bindings automatically.

Infrastructure

  • Repository transferred from BartWaardenburg/srcmap to fallow-rs/srcmap. The old URL redirects automatically. All repository fields in Cargo.toml and package.json files updated.
  • NAPI build no longer overwrites hand-written type definitions. The --dts flag now redirects auto-generated types to target/, protecting the curated index.d.ts in @srcmap/codec and @srcmap/sourcemap.
  • Five new criterion benchmark groups (parse_backends, json_only, real_world, lite_paths, vlq_isolation) for profiling parse-path performance. Includes real-world fixtures (preact, chartjs, pdfjs) and A/B comparisons across JSON deserializers.

Full Changelog: v0.3.0...v0.3.1

v0.3.0 — Remote debugging: fetch, sources, and context

15 Mar 12:08
v0.3.0
8da77f4

Choose a tag to compare

Features

Remote source map debugging workflow

Three new CLI commands that enable debugging any production website without access to its source code:

srcmap fetch <url> — Download a JS/CSS bundle and its source map from a URL. Automatically resolves sourceMappingURL references (inline data URIs, external URLs, and conventional .map suffix fallback).

srcmap fetch https://cdn.example.com/app.min.js -o ./debug
# Fetching https://cdn.example.com/app.min.js...
#   Saved ./debug/app.min.js (142 KB)
# Fetching https://cdn.example.com/app.min.js.map...
#   Saved ./debug/app.min.js.map (1.2 MB)

srcmap sources <file.map> — List or extract embedded sourcesContent entries. Extract mode writes all original source files to disk, preserving directory structure and handling webpack:///, file:///, and relative path prefixes.

srcmap sources app.min.js.map                      # list all sources
srcmap sources app.min.js.map --extract -o ./src   # extract to disk

srcmap lookup --context <n> — Show surrounding lines of original source code around a mapped position. Works with both human-readable and --json output.

srcmap lookup bundle.js.map 0 500 --context 5
# ../src/create-element.js:33:20
#
#   30 |
#   31 | 	// If a Component VNode, check for and apply defaultProps
#   32 | 	// Note: type may be undefined in development, must never error here.
# > 33 | 	if (typeof type == 'function' && type.defaultProps != null) {
#   34 | 		for (i in type.defaultProps) {
#   35 | 			if (normalizedProps[i] === UNDEFINED) {
#   36 | 				normalizedProps[i] = type.defaultProps[i];

Full debugging workflow

These three commands chain together for the complete "debug any website" use case:

srcmap fetch https://cdn.example.com/app.min.js -o ./debug
srcmap sources ./debug/app.min.js.map --extract -o ./src
srcmap lookup ./debug/app.min.js.map 0 84729 --context 5

This is the use case where srcmap is genuinely needed — LLMs can't decode VLQ mappings, position lookup requires binary search over decoded segments, and there's no other service doing this for you.

Testing

  • 43 integration tests (up from 32) covering all new commands and edge cases
  • New test fixture for webpack:/// and relative path source name sanitization
  • Edge case coverage for --context 0, missing sourcesContent, and --json error output

Documentation

  • CLI README and root README updated with all new commands
  • Schema introspection (srcmap schema) includes fetch, sources, and --context flag
  • New FETCH_ERROR error code documented

Infrastructure

  • Added ureq HTTP client dependency (blocking, rustls TLS) for the fetch command

Full Changelog: v0.2.3...v0.3.0

v0.2.3 — jridgewell remapping parity & wrapper packages

14 Mar 11:19
v0.2.3
2df27c7

Choose a tag to compare

New Packages

Three wrapper packages provide drop-in compatibility with the jridgewell source map ecosystem:

  • @srcmap/source-map — Mozilla source-map v0.6 synchronous API compatible replacement
  • @srcmap/gen-mapping — Drop-in for @jridgewell/gen-mapping
  • @srcmap/remapping — Drop-in for @jridgewell/remapping / @ampproject/remapping

All three use WASM under the hood and pass cross-validation tests against their jridgewell counterparts.

Bug Fixes

  • Fix generatedPositionFor default bias — The Rust public API incorrectly defaulted to LeastUpperBound. Now defaults to GreatestLowerBound, matching @jridgewell/trace-mapping semantics.

  • Remapping: match jridgewell deduplication behavior — Implement skipSourceless and skipSource logic so remapped output is byte-identical to @jridgewell/remapping:

    • Skip sourceless segments at line start
    • Skip consecutive sourceless segments on the same line
    • Skip sourced segments identical to the previous on the same line
  • Remapping: filter empty-string sources — Sources that are empty strings (from JSON null) are now treated as generated-only segments instead of being passed through, matching jridgewell's if (!source) behavior.

  • Remapping: drop unmapped upstream segments — When an upstream source map has no mapping at the queried position, the segment is now dropped entirely (matching jridgewell's if (traced == null) continue;), rather than keeping the outer reference.

  • Remapping: lazy source/name registration — Upstream sources and names are only added to the output when a mapping actually references them. Previously, all upstream sources/names were eagerly registered, causing unreferenced entries to appear in the output.

  • Auto-wrap duck-typed objects in originalPositionFor / generatedPositionFor — Objects with source map properties (like Vite's DecodedMap) are automatically wrapped in a TraceMap.

  • Handle undefined sourcesContent and decoded mappings — Gracefully handle edge cases in parsed source map inputs.

  • Fix generatedPositionFor same-line constraint — Both GLB and LUB are now properly constrained to the same original line.

Features

  • remap_chain — Compose a chain of pre-parsed source maps without a loader closure
  • from_data_url / fromDataUrl — Parse source maps from data: URLs
  • into_parts() / to_writer() — Zero-copy generator output for embedding
  • Mutable setters on SourceMapset_file, set_source_root, set_debug_id
  • WASM serializationtoJson() on WASM SourceMap
  • Web target buildswasm-pack build --target web for browser bundles

Performance

  • Generator VLQ encoding — Auto-detect sorted mappings to skip the sort pass; unsafe VLQ encoding for pre-allocated buffers
  • Remapping composition — Flat index tables with pre-built source/name remap vectors eliminate per-mapping HashMap lookups

Cross-Validation

New compat.test.mjs suites validate exact output match against:

  • @jridgewell/trace-mapping (26 tests)
  • @jridgewell/remapping (11 tests)

Full Changelog: v0.2.2...v0.2.3