Publish 0.86.0#1766
Open
robhogan wants to merge 4 commits into
Open
Conversation
…ults to `true` Differential Revision: D110759649
Summary: The whole-bundle source map served by Metro (the `.map` endpoint, inline source maps, and RAM bundle info) can be emitted either as a flat map or as an indexed/sectioned map. The indexed form passes each module's stored VLQ `mappings` through verbatim instead of decoding and re-encoding them into one flat map, so it is much cheaper to serialize; the flat form was only kept for consumers that predate index-map support. This was gated behind `serializer.unstable_allowIndexMap` (default off) and additionally only took effect when at least one module actually stored a compact VLQ map (`shouldEmitIndexedMap` checked `some(isVlqMap)`). Index maps are now safe to emit unconditionally, so this removes the choice: - Deletes the `serializer.unstable_allowIndexMap` option (default, Flow type, and generated TS type). - Removes `shouldEmitIndexedMap` and the `some(isVlqMap)` guard from `sourceMapGenerator`; both `sourceMapGenerator` and `sourceMapGeneratorNonBlocking` now always call `fromRawMappingsIndexed`. `fromRawMappingsIndexed`/`toIndexMapSection` already handle every input shape (VLQ maps pass through verbatim; tuple maps are re-encoded per section), so no change is needed there. - Drops the now-dead `allowIndexMap` plumbing from `Server.js` and the `unstable_allowIndexMap` wiring in the fb-metro CLI (the `--experimental-compact-source-maps` flag still controls `transformer.unstable_compactSourceMaps`, which is what determines VLQ storage). Behavioral change: the bundle `.map` (and inline/RAM-bundle maps) is now always a sectioned index map, whereas previously it defaulted to a flat map. This is the intended graduation of the index-map path; consumers on this toolchain already understand index maps. Scope note — this does NOT make the flat serialization functions dead: `fromRawMappings` is still called directly by `metro-transform-worker` and `metro-buck-transform-worker` for single-module maps, and `fromRawMappings`/`fromRawMappingsNonBlocking`/`isVlqMap`/`toBabelSegments` remain public exports of `metro-source-map`. Only the serializer's flat-vs-indexed *choice* is removed. `fromRawMappingsNonBlocking` is now internally unused but retained as public API; removing it would be a separate, deliberate API break. Differential Revision: D110757150
…maps
Summary:
`unstable_compactSourceMaps` gated whether the transform worker stored each module's source map as a compact VLQ `VlqMap` (`{mappings, names}`) or as decoded `MetroSourceMapSegmentTuple[]`. Its default was flipped to `true` earlier in this stack; this removes the option entirely and makes compact VLQ storage unconditional.
- Deletes the `transformer.unstable_compactSourceMaps` option (Flow type, metro-config default, and generated TS type).
- Simplifies `transformJS`/`transformJSON` to always encode a `VlqMap`: the Babel decoded-map fast path when not minifying, re-encoding the minifier's tuples otherwise.
- Narrows `JsOutput.data.map` from `Array<MetroSourceMapSegmentTuple> | VlqMap` to `VlqMap` and regenerates the TS defs.
Note: breaking change for external custom serializers/plugins that read `module.output[].data.map` expecting tuple arrays — the map is now always a `VlqMap`. Runtime tuple handling in `metro-source-map`/`symbolicate` is retained because non-JsOutput tuple sources (the minifier and virtual `map: []` scripts) still exist.
Differential Revision: D110762248
Summary: Publish 0.86.0 Changelog: [Internal] Reviewed By: hoxyq, huntie, GijsWeterings Differential Revision: D110690704
Contributor
|
@robhogan has exported this pull request. If you are a Meta employee, you can view the originating Diff in D110690704. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Publish 0.86.0
Changelog: [Internal]
Reviewed By: hoxyq, huntie, GijsWeterings
Differential Revision: D110690704