Skip to content

Releases: fallow-rs/srcmap

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

v0.2.2 — Performance, Hermes & React Native support

13 Mar 12:58
v0.2.2
54da77c

Choose a tag to compare

New crates

  • srcmap-hermes — Hermes/React Native source map extensions: function map parsing, profile section handling, and source map composition for the Hermes bytecode compiler pipeline
  • srcmap-ram-bundle — React Native RAM bundle parser: supports both indexed and file-based RAM bundle formats, module extraction, and source map association

Features

  • LazySourceMap fast-scan mode (from_json_fast) — defers all VLQ decoding at construction time, only scanning for semicolons. VLQ state is computed progressively on demand, giving the fastest possible parse for random-access lookup patterns
  • No-content parsing (from_json_no_content, from_vlq) — skip sourcesContent allocation entirely for WASM bindings where content is kept on the JS side, reducing memory copies across the WASM boundary
  • SourceView — line-indexed source text viewer with O(1) line access, smart name extraction around positions, and JS identifier validation
  • Source map utilitiesresolve_source_map_url, to_data_url, from_data_url, make_relative_path for common source map manipulation tasks
  • Generator assume_sorted mode — skip the O(n log n) sort when mappings are already in order (common for bundlers), avoiding both the sort and the Vec<&Mapping> allocation
  • CJS/ESM dual exports for @srcmap/trace-mapping — proper exports field with import/require conditions

Performance

  • Unchecked VLQ encode with pre-allocated buffers — unsafe fast path (~30% faster encode) with cache-line-aligned base64 lookup table
  • FxHashMap in generator for source/name dedup (faster than std HashMap for string keys)
  • Better buffer capacity estimates across codec and generator to avoid reallocations
  • Generator to_json rewritten to use std::io::Write with pre-sized buffers

Bug fixes

  • Copy-constructor double-freenew TraceMap(existingTraceMap) now deep-copies instead of sharing the WASM pointer
  • generatedPositionFor bias convention — fixed to match spec: 0 = GREATEST_LOWER_BOUND (default), -1 = LEAST_UPPER_BOUND
  • normalizePath for source resolution — removes . and .. segments, matching @jridgewell/resolve-uri behavior
  • URI scheme passthroughdata:, webpack://, and other absolute URIs preserved in resolvedSources
  • Decoded mappings stride — fixed 6→7 to account for is_range_mapping field
  • VLQ overflow threshold — tightened from shift≥64 to shift≥60, rejecting malformed inputs earlier
  • Range mapping cross-line bounds — range marking now correctly bounded to current line's mappings
  • MappingsIter field validation — rejects 2-field and 3-field segments (only 1, 4, or 5 are valid per ECMA-426)
  • decode_mappings_range OOM — caps end_line against actual line count to prevent allocation on pathological input
  • range_mapping_fallback underflow — uses saturating_sub when query column precedes range mapping column
  • WASM source()/name() — now return Option with bounds checking instead of panicking on invalid indices

Infrastructure

  • GitHub Actions bumped to v5 (checkout, setup-node, upload/download-artifact)
  • Release drafter with auto-labeling by conventional commit prefix
  • Community health files: CODE_OF_CONDUCT, CONTRIBUTING, SECURITY, issue/PR templates
  • Pre-commit hook for cargo fmt check

Full Changelog: v0.2.1...v0.2.2

Full Changelog: v0.2.1...v0.2.2

v0.2.1 — CLI tests, SourceMapBuilder, ECMA-426 conformance

12 Mar 23:06
v0.2.1
5c0a22a

Choose a tag to compare

Features

  • srcmap scopes CLI command — Decode and inspect ECMA-426 scopes data from source maps directly on the command line, with both human-readable and JSON output formats.

  • SourceMapBuilder — A new high-level builder API on SourceMap that mirrors SourceMapGenerator but produces a SourceMap directly, avoiding a JSON serialization roundtrip. Supports all mapping types including range mappings, source content, ignore lists, and debug IDs.

  • Usage examples for every crate — Each crate now ships with comprehensive examples (cargo run --example <name>), covering common workflows: VLQ encoding/decoding, source map consumption, lazy parsing, streaming generation, bundler-style concatenation, composition, scopes debugging, and error symbolication. CI verifies these compile on every push.

Bug Fixes

  • ECMA-426 conformance — Fixed several spec compliance issues:
    • Two-field and three-field VLQ segments are now correctly rejected during decoding (spec requires 1, 4, or 5 fields)
    • Added 25 conformance test cases covering version validation, segment rejection, column snapping, source root handling, indexed maps, and scopes roundtrips
    • Codec now returns proper errors for invalid segment lengths instead of silently accepting them

Performance

  • Bundler-scale remap benchmark — Added a realistic benchmark simulating a 50-module bundler concat + remap pipeline, measuring both the streaming and regular remap paths at scale.

Infrastructure

  • 32 CLI integration tests — Full test coverage for all srcmap subcommands (decode, encode, info, lookup, resolve, mappings, validate, concat, remap, scopes, symbolicate, schema), including stdin piping, JSON output, error handling, and dry-run modes.
  • CI example compilation checkcargo build --examples --workspace runs on every push to catch broken examples early.

Full Changelog: v0.2.0...v0.2.1

Full Changelog: v0.2.0...v0.2.1

v0.2.0 — Symbolication, streaming APIs, and ECMA-426 scopes

12 Mar 19:05
v0.2.0
863575a

Choose a tag to compare

New crates & packages

  • srcmap-symbolicate — Stack trace symbolication with V8, SpiderMonkey, and JSC engine support. Batch symbolication, debug ID resolution, and structured JSON output.
  • @srcmap/symbolicate-wasm — WASM bindings for symbolication in the browser and Node.js.
  • @srcmap/scopes-wasm — WASM bindings for ECMA-426 scopes encode/decode.
  • @srcmap/trace-mapping — Drop-in compatibility wrapper for @jridgewell/trace-mapping, backed by srcmap's Rust/WASM core.
  • NAPI bindings for generator and remapping crates.

Features

  • Range mappings — Full encode/decode/lookup support for the ECMA-426 range mappings proposal. Range-aware remapping preserves range metadata through composition.
  • Streaming APIsStreamingGenerator builds source maps without buffering all mappings in memory. remap_streaming composes source maps on the fly.
  • Lazy/incremental parsingLazySourceMap decodes individual lines on demand, useful for large maps where you only need a few lookups.
  • toDecodedMap() — Convert a Generator directly to a decoded source map without serializing to JSON first.
  • Lookup bias — LUB (least upper bound) and GLB (greatest lower bound) lookup modes for both forward and reverse lookups.
  • Extension field passthrough — Unknown fields in source map JSON (e.g., x_facebook_sources) are preserved through parse/serialize roundtrips.
  • x_google_ignoreList fallback — Automatically reads x_google_ignoreList when ignoreList is absent.
  • sourceMappingURL extraction — Parse //# sourceMappingURL= from JS/CSS, with inline base64 data URI decoding.
  • Deep validationvalidate_deep() checks out-of-bounds indices, unreferenced sources, and out-of-order mappings.
  • excludeContent option — Omit sourcesContent from serialized output.
  • Browser WASM targets — All WASM packages now ship browser builds with async initialization.

Performance

  • Inlined Segment struct — Stack-allocated [i64; 5] replaces heap-allocated Vec, eliminating allocation per segment during decode.
  • VLQ single-char fast path — Single-character VLQ values (covers ~90% of real-world segments) decode without looping.
  • Capacity hints — Pre-allocated buffers based on mappings string length reduce reallocations during decode.
  • Zero-allocation WASM lookupsoriginalPositionFlat and originalPositionBuf return results without JS object allocation overhead, matching native JS lookup speed.

Testing

  • ECMA-426 conformance suite — 16 conformance tests covering the source map spec, integrated into CI.
  • Real-world benchmarks — Benchmarks against Preact, Chart.js, and PDF.js source maps for representative performance numbers.

Architecture improvements

  • Comprehensive refactoring across all crates for consistency, error handling, and code quality.
  • Improved documentation with doc-tests and README updates for every crate.

Full Changelog: v0.1.3...v0.2.0

Full Changelog: v0.1.3...v0.2.0

v0.1.3 — WASM bindings, CLI, scopes, and ECMA-426 compliance

10 Mar 13:54
v0.1.3
0d0df7a

Choose a tag to compare

WASM bindings, CLI, scopes, and ECMA-426 compliance

Major feature release bringing the full source map stack to both Rust and Node.js.

New crates

  • srcmap-scopes — First Rust implementation of the ECMA-426 scopes & variables draft proposal. Tag-based VLQ encoding with tree structures for both scopes and ranges.
  • srcmap-symbolicate — Stack trace symbolication with V8, SpiderMonkey, and JavaScriptCore format support.
  • srcmap-cli — Full-featured CLI with structured JSON output and agent introspection via srcmap schema.

New WASM packages

  • @srcmap/sourcemap-wasm — Parser + consumer with batch lookup API
  • @srcmap/generator-wasm — Source map builder
  • @srcmap/remapping-wasm — Concatenation + composition
  • @srcmap/symbolicate-wasm — Stack trace symbolication
  • @srcmap/trace-mapping — Drop-in @jridgewell/trace-mapping compatible API

Features

  • ECMA-426 scopes — Encode/decode scopes and variables with tag-based VLQ, tree structures for scope hierarchies and binding ranges
  • debugId support across all crates for associating generated files with source maps
  • Lookup biasLEAST_UPPER_BOUND and GREATEST_LOWER_BOUND for position lookups
  • Range mapping — Map ranges of generated code to original positions
  • Extension field passthrough — Preserve custom x_ fields in source maps
  • x_google_ignoreList fallback — Automatic fallback to legacy field name
  • sourceMappingURL parsing — Extract source map URLs from generated files
  • Deep validation — Validate source maps beyond structural checks
  • excludeContent — Option to strip sourcesContent during parsing
  • Streaming/lazy decode — Incremental parsing for large source maps
  • Browser WASM targets — Async initialization for browser environments

CLI commands

srcmap info          Inspect metadata and statistics
srcmap validate      Validate a source map
srcmap lookup        Original position lookup (0-based)
srcmap resolve       Reverse lookup
srcmap mappings      List all mappings with pagination
srcmap decode        Decode VLQ mappings string
srcmap encode        Encode decoded mappings back to VLQ
srcmap concat        Concatenate multiple source maps
srcmap remap         Compose through a transform chain
srcmap symbolicate   Symbolicate a stack trace
srcmap schema        All commands as JSON (for agents)

Benchmarks

Added real-world benchmarks using Preact (82 KB), Chart.js (988 KB), and PDF.js (5.0 MB) source maps. WASM batch lookups achieve 12 ns per lookup on large maps — 1.4x faster than @jridgewell/trace-mapping. Rust-native lookups: 3 ns (8x faster than JS).

Infrastructure

  • ECMA-426 conformance test suite with CI integration
  • Coverage workflow with auto-updating badges
  • README files for all crates and npm packages

Full Changelog: v0.1.2...v0.1.3

v0.1.2 — CI and publishing fixes

10 Mar 10:20
v0.1.2
0eb3e91

Choose a tag to compare

CI and publishing fixes

Patch release focused on fixing the release pipeline and npm publishing.

Fixed

  • Correct repository URL casing for npm provenance verification
  • Tolerate already-published packages in npm publish steps
  • Rewrite version sync script using Node for cross-platform JSON editing
  • Remove NODE_AUTH_TOKEN requirement — uses OIDC trusted publishing

Full Changelog: v0.1.1...v0.1.2

v0.1.1 — Initial release

11 Mar 08:36
v0.1.1
44e505d

Choose a tag to compare

Initial release

The first public release of srcmap — a standalone source map SDK for Rust.

Crates

  • srcmap-codec — VLQ encode/decode with proper error handling and safety guards
  • srcmap-sourcemap — Source map parser and consumer with O(log n) binary search lookups
  • srcmap-generator — Incremental source map builder
  • srcmap-remapping — Source map concatenation and composition through transform chains

Node.js bindings

  • @srcmap/sourcemap — NAPI bindings for the parser/consumer
  • @srcmap/codec — NAPI bindings for VLQ encode/decode
  • Multi-platform NAPI packages (Linux x64/arm64, macOS x64/arm64, Windows x64)

Infrastructure

  • Cargo release pipeline with version sync across crates and npm packages
  • npm trusted publishing via OIDC (tokenless CI)

Full Changelog: https://github.com/BartWaardenburg/srcmap/commits/v0.1.1