Repository navigation
Add Rust compiler - #2008
Draft
mellyeliu wants to merge 79 commits into
Draft
Add Rust compiler#2008mellyeliu wants to merge 79 commits into
mellyeliu wants to merge 79 commits into
Conversation
Compare code frames uncoloured, give the Babel acceptance oracle a fixed stack, run the native suite against the JS compiler test for test on Windows, and cover the native API and bundler plugin on Node 18.
Match Babel's resolved filename prefix in the evaluated-arrow error test and keep running the remaining suites after a failure.
Generated JSX attribute values (such as Windows debug paths in data-style-src) are escaped exactly as @babel/generator prints them, and the source-preservation check verifies that spelling for generated attributes only. Values containing a double quote keep a valid single-quoted attribute, since Babel emits invalid JSX there.
workflow: benchmarks/perfComparison of performance test results, measured in operations per second. Larger is better.
|
workflow: benchmarks/sizeComparison of minified (terser) and compressed (brotli) size results, measured in bytes. Smaller is better.
|
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Verbatim copy of the crates of github.com/Dwlad90/stylex-swc-plugin 0.19.2 (6e7d3983), MIT licensed; see crates/LICENSE and crates/PROVENANCE.md for attribution and the changes made since.
…hecks Exclude the vendored StyleX SWC crates and the verbatim third-party license texts from the typos check, as the vendored parser already is, and allow the generated variable hash used in two test fixtures. Ignore the vendored crates' JavaScript test fixtures in ESLint. Reword one host.js comment the spell checker misread, and apply Prettier's line wrap to index.js. No behavior changes.
stylex-transform depended on swc_compiler_base with its node feature, which adds SWC's napi bindings. That linked napi (and its module- registration constructors) into every build of the crate and into the compiler's cdylib, even without --features node; on macOS the cdylib then failed to link with undefined napi_* symbols, which only the addon's napi-build link flags (-undefined dynamic_lookup) allow. swc_compiler_base is used only by a test, so it is now a dev-dependency without the feature, as stylex-diagnostics already uses it.
…l path as Babel does
…atform
About 40 vendored stylex-path-resolver tests failed on Windows only. They
built expected paths by joining with `/` and comparing display strings,
trimmed a root directory with `.replace("/apps/web", "")` (a no-op on a
`\`-separated path), and expected the unit-test "must be a file" message to
name its path with `/`. Results are now compared as paths, which compares
components and holds either separator; the root is trimmed by component;
and the unit-test-only message names its path with `/` on every platform,
as resolved paths already are. Linux behaviour is unchanged.
…pecifiers
Two path-resolver steps parsed a file-system path as text split on `/`. On
Windows the path is written with `\`, so:
- a package's import specifier was built as `pkg\file.js`, which misses the
package's `exports`, and resolution of a local or workspace package
failed ("Path resolution failed: node_modules/<pkg>/colors.stylex.js");
- the pnpm reading of a resolved path never found `node_modules/`, so a
package was never mapped to its `.pnpm` store path.
Both now read the path through the module's existing `to_forward_slashes`,
which is the identity off Windows, so Linux resolution is byte-for-byte
unchanged. The parsing is split into small helpers, and unit tests read a
`\`-separated path the Windows way on every platform, so Linux CI covers it.
The Babel plugin labels a namespace with the compiled file and the line it is written on in the input: its addSourceMapData reads hub.file.codeMap, which @babel/core 7 does not define, so an input source map never moves the label. The vendored core instead mapped the key through a source map handed to StateManager::set_input_source_map, naming the map's source file and line. No public entry point ever set that map (the addon and the Babel adapter compose inputSourceMap into the emitted map only), so the path was unreachable, and public output already equals Babel's, which the new native_api differential pins for the facade and the direct API. Removed: the label path (original_position_from_input_source_map and its OriginalSourcePosition), StateManager::input_source_map and its setter, the evaluation-scope copy of it, and the now-unused swc_sourcemap dependency of stylex-state and stylex-transform (lock edges only; the package stays in the graph through the root crate). The vendored unit tests of that path are removed with it: the eleven original_position_from_input_source_map rows (their positions, UTF-16 columns, sparse maps, scheme sources and fallbacks have no counterpart once the label never reads a map) and the two map rows of over_the_authored_text; the source-text rows that remain cover the label. The state test that kept the map now checks the source file only.
…er PR The unplugin `compiler: 'rust'` option is not needed for the port, so it is taken out of this PR: packages/@stylexjs/unplugin/src/core.js and core.d.ts are restored byte-identical to main (2d42d72), and the Rust compiler's unplugin test (tests/unplugin_current.cjs) is removed with its entries in scripts/test.cjs and the workflow, the workflow's unplugin path filter and build step, and the README line that pointed to it. The work is kept on curate/unplugin-rust-option for a separate PR.
The release build remaps the checkout and Cargo's home in embedded paths so the published addon carries no build-machine paths. A new script reads the built addon and fails, listing the strings, if it contains the workspace (GITHUB_WORKSPACE, with either separator or escaped on Windows), CARGO_HOME or the runner's home directory; rustc's own /rustc/<hash>/ paths are allowed. The native job runs it right after the build on every platform.
ld64 sets a dylib's install name (LC_ID_DYLIB) to its output path, so the macOS addon embedded the runner's target directory, which --remap-path-prefix cannot rewrite; the CI path check caught it. On macOS the build now links the addon with -install_name @rpath/<addon file name>. Node loads addons by path, so the install name is never used.
Keep the existing length-refusal boundary and folding decisions. For a hole reached before a spread, report the absent-element fault as unchanged Babel does: SyntaxError, BABEL_TRANSFORM_ERROR, the exact PATH_WITHOUT_NODE message with its trailing newline, and no code frame. Spread-first diagnostics and ordinary dummy-span callers keep their existing behavior. Reuse the existing span-recording scope; no new error-kind channel or TLS field. Expectation port to executed unchanged Babel: array_hole_tests.rs now expects PATH_WITHOUT_NODE for `[, ...[1, 2]].length` instead of SpreadElement. The input still refuses; this is a diagnostic expectation reconciliation, not a new fold or a production value fix. The spread-first assertion remains SpreadElement. Direct/facade differential tests pin full error bytes, kind and no frame; controls pin the existing spread-first frames and other dummy-fault error kinds.
The unchanged Babel hole-first absent-element diagnostic ends with one newline. PATH_WITHOUT_NODE itself has none, so append the byte only when constructing this hole-first refusal; leave the shared constant, root formatter, and all other error messages unchanged. Extend the root dummy-fault control to verify newline preservation and reconcile the same array_hole_tests.rs expectation port with the exact executed Babel bytes.
Cover literal length, parenthesized length, a bound hole-containing initializer and index access through both direct and facade APIs. Compare complete SyntaxError/BABEL_TRANSFORM_ERROR messages, including the trailing newline. Spread-first hole-containing literals compare the actual Babel spread frame; host-provided sparse-array controls retain their values. This replaces the prior length-only review contract per the parent decision.
…holes Pin the revised parent contract: direct hole value/length/index forms and direct source-hole member calls match unchanged Babel byte-for-byte, including caret ranges; approved spread support reaching an operand hole continues to refuse, and host sparse arrays stay modeled. These are executed Babel oracle cases, not an instruction to disable hole-free spread support.
Replace the lenient hole-length shortcut with the existing unlocated hole fault at source-array evaluation. Literal, wrapped, bound and indexed hole-first values refuse with exact Babel SyntaxError bytes instead of manufacturing a count. Preserve approved hole-free spread handling and all host/native sparse carriers. Direct spread-first source-hole member reads retain SpreadElement and report the actual spread span. Member-call evaluation that returns our own hole fault reuses the existing CallExpression refusal at the call span; non-hole faults and argument failures are untouched. No new classifier, error-kind channel, TLS field, value carrier or folding capability.
Parent-approved expectation ports to executed unchanged Babel: array_hole_tests::{a_length_written_on_a_holey_literal_counts_the_slots,a_holey_literals_length_is_counted_however_it_is_spelled,a_holey_literals_length_composes_as_a_number,two_counts_off_holey_literals_add} now assert refusal over every original source and are renamed accordingly. array_hole_tests hole-refusal helpers and spread-neighbor rows retain source inputs but expect the exact unlocated fault including its newline. member_length_tests::a_hole_is_a_slot_and_counts and the hole rows of a_parenthesised_receiver_is_counted_as_the_bare_one_is now refuse; member_lookup_tests::a_hole_occupies_a_slot_it_carries_no_value_for likewise refuses and is renamed. object_statics::{an_array_holding_a_hole_refuses,a_hole_beside_a_value_that_resolved_to_nothing_refuses_for_the_hole} and object_shape_tests::a_spread_of_an_array_with_a_hole_refuses reconcile only the hole-fault trailing newline. These are explicit expectation ports, not test weakening or new supported folds. All hole-free/host controls remain. PROVENANCE records source-hole refusal and the approved spread/call operand-hole diagnostic difference.
Executed unchanged Babel for an argument hole in a successful array-member receiver: the diagnostic remains the unlocated hole SyntaxError, not the wrapping CallExpression refusal. Compare full bytes through direct and facade APIs. This is a guard for the scoped receiver-only reframe, with no production changes.
Pin executed base full message bytes for a named holey spread, nested literal spread, spread arguments to Math.max/Math.min, and an arrow call spreading a named holey array. These C cases must keep the base frame without an inserted blank line. Direct and facade assertions preserve error name/code, full message and caret. No production changes in this test checkpoint.
Preserve the original framed group-C diagnostic: remove the hole fault terminal newline only when a real code-frame span is attached. The frameless hole-first message and all other diagnostic messages, kinds and spans are unchanged. This is message-separator formatting, not error classification. When an evaluated spread argument fails with the actual unlocated-hole marker, restore its argument span or the initializer span of its full-Id named binding, preserving the base diagnostic for Math spread arguments and retained source bindings. Every non-spread or non-hole failure stays on the existing path; no new fold, kind field, TLS field, ledger API or counter change. Pin full base bytes through direct/facade tests and verify framed non-hole trailing whitespace remains unchanged.
Apache-2.0 section 4(b) asks that modified files carry a prominent notice that they were changed. Each of the three patched files in vendor/swc_ecma_parser now opens with a one-line "Modified for StyleX" comment naming its patch. The provenance test strips exactly that line before reversing the patch and checking the published hash, so the "published archive plus three patches" check is unchanged.
Shorten module, item and inline comments to what a caller or reader needs: one-line item docs, module docs of a few sentences, and inline notes only where the code is not self-explanatory. Licenses, attribution, SAFETY notes, deliberate Babel/Node/upstream quirks and real TODOs stay. Comments only; the token streams are unchanged. Comment lines removed, by area: - src: 285 (28 files) - index.js, babel.js, host.js: 240 - scripts: 16 (6 files) - tests (Node suites): 117 (8 files) - crates/stylex-utils: 953 (17 files) - crates/stylex-diagnostics: 445 (9 files) - crates/stylex-macros: 275 (8 files) - crates/stylex-path-resolver: 177 (7 files)
Same rules as the previous commit, for tests/*.rs (except vendor_parser_provenance.rs): 65 comment lines removed in 16 files. Comments only; the token streams are unchanged.
Comment lines removed (net): - postcss-value-parser: 453 - stylex-ast: 629 - stylex-styleq: 223 - stylex-types: 85 - stylex-atoms: 72 - stylex-enums: 62 - stylex-nested-config: 5 Comments only; the token stream with comments stripped is unchanged.
…tures Comment lines removed (net): - stylex-constants: 608 - stylex-structures: 621 Comments only; the token stream with comments stripped is unchanged.
Comment lines removed (net): - stylex-transform: 2982 (production 1875, tests 1107) Comments only; the token stream with comments stripped is unchanged.
Comment lines removed (net): - stylex-css: 2796 (production 1088, tests 1708) Comments only; the token stream with comments stripped is unchanged.
Comment lines removed (net): - stylex-css-parser: 5233 (production 1508, tests 3725) Comments only; the token stream with comments stripped is unchanged.
Trim module, item and inline commentary to purpose statements and non-obvious caller contracts. Remove history, design defenses and test narration; retain license/copyright/attribution verbatim, SAFETY/TODO notes and concise deliberate Babel/Node/upstream quirks. No non-comment Rust token changes; only whitespace required by comment removal is adjusted. Retain concise import-span deduplication and formatting contracts that keep lint/format behavior unchanged. Net lines removed per crate: stylex-state 3741; stylex-evaluator 7234; stylex-js 820; stylex-state-index 457. Production reviewed before tests. BC B paths, Markdown and the published SWC vendor directory are untouched. The combined comment-token check and protected attribution audit pass; final compile/format/lint gate is separate.
…notes README: purpose, usage, the differences from the Babel plugin one line each, and development commands. PROVENANCE: the upstream source and hashes, then one line per vendoring step, behaviour change and performance-only change, grouped by area, plus a line recording that the vendored crates' comments were condensed with code unchanged. NOTICE: the attribution entries kept verbatim, the prose around them condensed. vendor/README: the three patches, the archive hash and the source. License texts are unchanged.
RUST_DEPENDENCY_LICENSES.md now shows each distinct license text once, followed by the packages it covers and each package's copyright lines verbatim; texts that differ only in whitespace, URL scheme, a license title or the Apache-2.0 appendix template count as one. NOTICE and other texts stay verbatim. LICENSE_PROVENANCE.json lists one entry per package: name, version, declared license, and each source file with its sha256. scripts/licenses.cjs generates both from `cargo tree -p stylex_rust_compiler --features node -e normal --target all` and the packages' own license files; scripts/licenses-supplement.json holds the texts some packages publish only in their repositories. The Linux leg of the rust-compiler workflow runs it with --check after its cargo build. Line counts: RUST_DEPENDENCY_LICENSES.md 12,237 -> 2,329; LICENSE_PROVENANCE.json 7,022 -> 363 (new: generator 361, supplement 57). All 358 packages are listed, and every paragraph of every previous text and of every license file in the package sources is present.
… setting CI sets CARGO_TERM_COLOR=always, so `cargo tree` colored its "(*)" repeat markers; the escape codes defeated the suffix stripping, entries such as "proc-macro2 v1.0.107 \e[33m..." no longer matched cargo metadata, and the check failed. Both cargo calls now run with --color never, and the error lists the unmatched package ids.
Postflight normalized copies of both the compiled and the re-parsed module items before comparing them; on the 7 MB fixture the two copies were a quarter of peak heap. The re-parsed module is owned, so its parentheses are now removed in place, and hygiene contexts are ignored in the comparison instead of being cleared on copies. The comparison accepts and rejects the same trees.
Coverage-guided pruning of the test files copied unchanged from the upstream import (byte-identical to 7ea888a before the comment trims). Production-line coverage (-C instrument-coverage, LLVM 21 tools) was measured for the contract set -- every Rust test we wrote or changed, the 13 Node suites and the Babel suite through the facade -- and for each upstream test file separately. The upstream files that add production lines nobody else covers were kept, greedily, largest gain first; the files below add none and are removed, with their `mod` declarations, the helpers they alone used, and the test modules left empty. Covered production lines: 42,579 before and 42,579 after (the identical line set; 49,602 instrumentable). The full workspace suite at 2 MiB passes: 6,346 / 0 / 0. Removed files (89 files, 18559 lines): - crates/stylex-ast/src/ast/tests/convertors_concat_edge_cases_test.rs (185) - crates/stylex-ast/src/ast/tests/convertors_var_decl_test.rs (252) - crates/stylex-ast/src/ast/tests/imports_test.rs (155) - crates/stylex-constants/src/constants/tests/time_units_test.rs (16) - crates/stylex-css-parser/src/tests/at_queries/messages_tests.rs (19) - crates/stylex-css-parser/src/tests/at_queries/validation_media_query_test.rs (178) - crates/stylex-css-parser/src/tests/base_types_tests.rs (77) - crates/stylex-css-parser/src/tests/css_types/alpha_value_test.rs (138) - crates/stylex-css-parser/src/tests/css_types/alpha_value_tests.rs (34) - crates/stylex-css-parser/src/tests/css_types/angle_percentage_test.rs (93) - crates/stylex-css-parser/src/tests/css_types/angle_test.rs (65) - crates/stylex-css-parser/src/tests/css_types/basic_shape_tests.rs (72) - crates/stylex-css-parser/src/tests/css_types/calc_constant_test.rs (34) - crates/stylex-css-parser/src/tests/css_types/color_double_precision_test.rs (748) - crates/stylex-css-parser/src/tests/css_types/double_precision_test.rs (317) - crates/stylex-css-parser/src/tests/css_types/easing_function_precision_test.rs (250) - crates/stylex-css-parser/src/tests/css_types/flex_test.rs (29) - crates/stylex-css-parser/src/tests/css_types/frequency_test.rs (46) - crates/stylex-css-parser/src/tests/css_types/length_percentage_test.rs (129) - crates/stylex-css-parser/src/tests/css_types/length_test.rs (131) - crates/stylex-css-parser/src/tests/css_types/length_tests.rs (69) - crates/stylex-css-parser/src/tests/css_types/number_tests.rs (14) - crates/stylex-css-parser/src/tests/css_types/percentage_tests.rs (14) - crates/stylex-css-parser/src/tests/css_types/resolution_test.rs (38) - crates/stylex-css-parser/src/tests/css_types/time_test.rs (46) - crates/stylex-css-parser/src/tests/css_types/transform_function_precision_test.rs (249) - crates/stylex-css-parser/src/tests/properties/border_radius_tests.rs (193) - crates/stylex-css-parser/src/tests/properties/box_shadow_tests.rs (238) - crates/stylex-css-parser/src/tests/properties/transform_test.rs (280) - crates/stylex-css-parser/src/tests/token_parser_tests.rs (99) - crates/stylex-css-parser/src/tests/token_types_precision_test.rs (222) - crates/stylex-css/src/css/tests/corpus_normalization_test.rs (325) - crates/stylex-css/src/css/tests/generate_ltr_test.rs (230) - crates/stylex-css/src/css/tests/generate_rtl_test.rs (590) - crates/stylex-css/src/css/tests/spacing_repair_parity_test.rs (687) - crates/stylex-css/src/css/tests/unprefixed_custom_properties_test.rs (294) - crates/stylex-css/src/css/tests/value_normalization_parity_test.rs (794) - crates/stylex-css/src/order/tests/application_order_constants_test.rs (1254) - crates/stylex-css/src/order/tests/application_order_structures_test.rs (104) - crates/stylex-css/src/order/tests/legacy_expand_shorthands_structures_test.rs (92) - crates/stylex-css/src/order/tests/property_specificity_constants_test.rs (514) - crates/stylex-css/src/order/tests/property_specificity_structures_test.rs (117) - crates/stylex-css/src/tests/unprefixed_custom_properties_predicate_tests.rs (168) - crates/stylex-css/src/utils/tests/condition_test.rs (28) - crates/stylex-css/src/utils/tests/pseudo_test.rs (90) - crates/stylex-css/src/values/tests/common_test.rs (144) - crates/stylex-css/src/values/tests/mod.rs (1) - crates/stylex-diagnostics/src/tests/memo_test.rs (162) - crates/stylex-enums/src/tests/misc_test.rs (25) - crates/stylex-enums/src/tests/value_with_default_test.rs (31) - crates/stylex-evaluator/src/evaluate/tests/parameter_binding_tests.rs (108) - crates/stylex-evaluator/src/evaluate/tests/used_before_declaration.rs (118) - crates/stylex-evaluator/src/tests/check_declaration_test.rs (124) - crates/stylex-evaluator/src/tests/evaluate_result_test.rs (56) - crates/stylex-macros/src/tests/evaluation_macros_test.rs (122) - crates/stylex-path-resolver/src/file_system/tests.rs (50) - crates/stylex-state/src/tests/binding_queries_test.rs (171) - crates/stylex-state/src/tests/diagnostic_state_test.rs (291) - crates/stylex-state/src/tests/file_caches_test.rs (140) - crates/stylex-state/src/tests/get_canonical_file_path_test.rs (127) - crates/stylex-state/src/tests/get_package_name_and_path_test.rs (35) - crates/stylex-structures/src/tests/pre_rule_value_test.rs (194) - crates/stylex-structures/src/tests/stylex_state_options_builders_test.rs (57) - crates/stylex-transform/src/shared/structures/tests/flatten_raw_style_objects_test.rs (1031) - crates/stylex-transform/src/shared/transformers/tests/named_rule_test.rs (179) - crates/stylex-transform/src/shared/transformers/tests/stylex_create_theme_by_group_test.rs (539) - crates/stylex-transform/src/shared/transformers/tests/stylex_define_consts_nested_test.rs (291) - crates/stylex-transform/src/shared/transformers/tests/stylex_define_consts_test.rs (357) - crates/stylex-transform/src/shared/transformers/tests/stylex_define_vars_nested_test.rs (277) - crates/stylex-transform/src/shared/transformers/tests/stylex_define_vars_test.rs (956) - crates/stylex-transform/src/shared/transformers/tests/stylex_keyframes_test.rs (128) - crates/stylex-transform/src/shared/transformers/tests/stylex_view_transition_class_test.rs (87) - crates/stylex-transform/src/shared/utils/core/tests/evaluate_stylex_create_arg_tests.rs (49) - crates/stylex-transform/src/shared/utils/core/tests/member_expression_tests.rs (263) - crates/stylex-transform/src/shared/utils/core/tests/stylex_tests.rs (690) - crates/stylex-transform/src/shared/utils/css/tests/css_custom_properties_validation_test.rs (504) - crates/stylex-transform/src/shared/utils/css/tests/css_tests.rs (35) - crates/stylex-transform/src/shared/utils/css/tests/mod.rs (4) - crates/stylex-transform/src/shared/utils/css/tests/split_value_test.rs (90) - crates/stylex-transform/src/shared/utils/css/tests/transform_value_test.rs (228) - crates/stylex-transform/src/shared/utils/tests/live_declarations_tests.rs (335) - crates/stylex-transform/src/shared/utils/tests/mod.rs (1) - crates/stylex-transform/src/tests/stylex_default_marker_tests.rs (52) - crates/stylex-transform/src/transform/stylex/tests/rule_call_eval_config_test.rs (132) - crates/stylex-transform/src/transform/stylex/transform_stylex_create_call/tests/dynamic_style_paths_tests.rs (72) - crates/stylex-transform/src/transform/tests/module_entry_test.rs (29) - crates/stylex-types/src/structures/tests/meta_data_test.rs (103) - crates/stylex-utils/src/tests/math_test.rs (113) - crates/stylex-utils/src/tests/number_test.rs (341) In total, 147 files changed, 2 insertions(+), 18886 deletions(-).
…dy covered Second, finer pass over the 162 upstream test files the previous commit kept because each adds production lines nothing else covers. Every test function in them (3,613) was measured in its own process; on top of the contract set (our tests, the 13 Node suites, the Babel suite through the facade) the functions that add unique production lines were kept greedily, largest gain first. The other 2,674 functions add none and are removed, together with the helpers, imports, constants, enum variants and case-table entries only they used. Tests we wrote are untouched. Covered production lines: 42,579 before and 42,579 after (the identical line set; 49,602 instrumentable). The full workspace suite at 2 MiB passes: 3,672 / 0 / 0. Per file: - crates/postcss-value-parser/src/tests/cases.rs: unreferenced helpers removed, -757/+0 - crates/postcss-value-parser/src/tests/parity.rs: 7 test functions removed, -106/+2 - crates/postcss-value-parser/src/tests/properties.rs: 25 test functions removed, -551/+1 - crates/stylex-ast/src/ast/tests/convertors_invalid_utf8_test.rs: 2 test functions removed, -20/+0 - crates/stylex-ast/src/ast/tests/convertors_key_value_test.rs: 11 test functions removed, -118/+2 - crates/stylex-ast/src/ast/tests/convertors_test.rs: 49 test functions removed, -618/+0 - crates/stylex-ast/src/ast/tests/factories_test.rs: 36 test functions removed, -319/+1 - crates/stylex-ast/src/ast/tests/keys_test.rs: 32 test functions removed, -412/+6 - crates/stylex-ast/src/ast/tests/objects_test.rs: 55 test functions removed, -758/+5 - crates/stylex-ast/src/ast/tests/source_file_test.rs: 23 test functions removed, -195/+4 - crates/stylex-atoms/src/tests/transform_test.rs: 34 test functions removed, -558/+6 - crates/stylex-constants/src/constants/tests/common_constants_test.rs: 6 test functions removed, -101/+2 - crates/stylex-constants/src/constants/tests/evaluation_errors_test.rs: 16 test functions removed, -175/+0 - crates/stylex-constants/src/constants/tests/messages_test.rs: 12 test functions removed, -103/+0 - crates/stylex-css-parser/src/tests/at_queries/media_query_transform_coverage_test.rs: 12 test functions removed, -279/+4 - crates/stylex-css-parser/src/tests/base_types_test.rs: 5 test functions removed, -45/+0 - crates/stylex-css-parser/src/tests/css_types/alpha_value_coverage_test.rs: 5 test functions removed, -69/+1 - crates/stylex-css-parser/src/tests/css_types/angle_coverage_test.rs: 5 test functions removed, -41/+0 - crates/stylex-css-parser/src/tests/css_types/angle_percentage_tests.rs: 5 test functions removed, -77/+0 - crates/stylex-css-parser/src/tests/css_types/angle_tests.rs: 6 test functions removed, -63/+0 - crates/stylex-css-parser/src/tests/css_types/basic_shape_coverage_test.rs: 61 test functions removed, -962/+7 - crates/stylex-css-parser/src/tests/css_types/basic_shape_test.rs: 18 test functions removed, -425/+2 - crates/stylex-css-parser/src/tests/css_types/blend_mode_coverage_test.rs: 1 test function removed, -6/+0 - crates/stylex-css-parser/src/tests/css_types/blend_mode_test.rs: 1 test function removed, -7/+0 - crates/stylex-css-parser/src/tests/css_types/blend_mode_tests.rs: 9 test functions removed, -120/+0 - crates/stylex-css-parser/src/tests/css_types/calc_constant_tests.rs: 5 test functions removed, -59/+0 - crates/stylex-css-parser/src/tests/css_types/calc_coverage_test.rs: 58 test functions removed, -527/+0 - crates/stylex-css-parser/src/tests/css_types/calc_test.rs: 18 test functions removed, -313/+1 - crates/stylex-css-parser/src/tests/css_types/color_coverage_test.rs: 232 test functions removed, -2454/+216 - crates/stylex-css-parser/src/tests/css_types/color_test.rs: 28 test functions removed, -657/+0 - crates/stylex-css-parser/src/tests/css_types/color_tests.rs: 10 test functions removed, -88/+0 - crates/stylex-css-parser/src/tests/css_types/common_types_coverage_test.rs: 8 test functions removed, -73/+0 - crates/stylex-css-parser/src/tests/css_types/common_types_tests.rs: 14 test functions removed, -83/+0 - crates/stylex-css-parser/src/tests/css_types/custom_ident_coverage_test.rs: 1 test function removed, -6/+0 - crates/stylex-css-parser/src/tests/css_types/custom_ident_test.rs: 2 test functions removed, -34/+0 - crates/stylex-css-parser/src/tests/css_types/custom_ident_tests.rs: 6 test functions removed, -71/+0 - crates/stylex-css-parser/src/tests/css_types/dashed_ident_coverage_test.rs: 1 test function removed, -9/+0 - crates/stylex-css-parser/src/tests/css_types/dashed_ident_test.rs: 1 test function removed, -16/+0 - crates/stylex-css-parser/src/tests/css_types/dashed_ident_tests.rs: 7 test functions removed, -84/+0 - crates/stylex-css-parser/src/tests/css_types/dimension_coverage_test.rs: 2 test functions removed, -24/+0 - crates/stylex-css-parser/src/tests/css_types/dimension_test.rs: 4 test functions removed, -93/+0 - crates/stylex-css-parser/src/tests/css_types/dimension_tests.rs: 3 test functions removed, -30/+0 - crates/stylex-css-parser/src/tests/css_types/easing_function_coverage_test.rs: 80 test functions removed, -702/+0 - crates/stylex-css-parser/src/tests/css_types/easing_function_test.rs: 5 test functions removed, -53/+0 - crates/stylex-css-parser/src/tests/css_types/filter_function_coverage_test.rs: 88 test functions removed, -790/+7 - crates/stylex-css-parser/src/tests/css_types/filter_function_test.rs: 17 test functions removed, -167/+0 - crates/stylex-css-parser/src/tests/css_types/flex_coverage_test.rs: 4 test functions removed, -37/+0 - crates/stylex-css-parser/src/tests/css_types/flex_tests.rs: 10 test functions removed, -97/+0 - crates/stylex-css-parser/src/tests/css_types/frequency_coverage_test.rs: 2 test functions removed, -26/+0 - crates/stylex-css-parser/src/tests/css_types/frequency_tests.rs: 4 test functions removed, -40/+0 - crates/stylex-css-parser/src/tests/css_types/js_number_spelling_test.rs: 22 test functions removed, -209/+4 - crates/stylex-css-parser/src/tests/css_types/length_coverage_test.rs: 5 test functions removed, -37/+0 - crates/stylex-css-parser/src/tests/css_types/length_percentage_coverage_test.rs: 3 test functions removed, -20/+0 - crates/stylex-css-parser/src/tests/css_types/length_percentage_tests.rs: 4 test functions removed, -48/+0 - crates/stylex-css-parser/src/tests/css_types/position_coverage_test.rs: 11 test functions removed, -134/+0 - crates/stylex-css-parser/src/tests/css_types/position_test.rs: 11 test functions removed, -152/+0 - crates/stylex-css-parser/src/tests/css_types/position_tests.rs: 5 test functions removed, -52/+0 - crates/stylex-css-parser/src/tests/css_types/resolution_coverage_test.rs: 5 test functions removed, -47/+0 - crates/stylex-css-parser/src/tests/css_types/resolution_tests.rs: 4 test functions removed, -36/+0 - crates/stylex-css-parser/src/tests/css_types/time_coverage_test.rs: 2 test functions removed, -26/+0 - crates/stylex-css-parser/src/tests/css_types/time_tests.rs: 4 test functions removed, -40/+0 - crates/stylex-css-parser/src/tests/css_types/transform_function_coverage_test.rs: 66 test functions removed, -866/+15 - crates/stylex-css-parser/src/tests/css_types/transform_function_test.rs: 15 test functions removed, -225/+7 - crates/stylex-css-parser/src/tests/css_value_coverage_test.rs: 25 test functions removed, -163/+0 - crates/stylex-css-parser/src/tests/css_value_tests.rs: 4 test functions removed, -29/+0 - crates/stylex-css-parser/src/tests/properties/border_radius_coverage_test.rs: 5 test functions removed, -73/+0 - crates/stylex-css-parser/src/tests/properties/border_radius_test.rs: 10 test functions removed, -321/+0 - crates/stylex-css-parser/src/tests/properties/box_shadow_coverage_test.rs: 5 test functions removed, -40/+0 - crates/stylex-css-parser/src/tests/properties/box_shadow_test.rs: 20 test functions removed, -424/+2 - crates/stylex-css-parser/src/tests/properties/transform_tests.rs: 9 test functions removed, -137/+0 - crates/stylex-css-parser/src/tests/token_parser_coverage_test.rs: 96 test functions removed, -1272/+1 - crates/stylex-css-parser/src/tests/token_parser_test.rs: 42 test functions removed, -910/+27 - crates/stylex-css-parser/src/tests/token_types_coverage_test.rs: 14 test functions removed, -176/+0 - crates/stylex-css-parser/src/tests/token_types_test.rs: 14 test functions removed, -174/+0 - crates/stylex-css-parser/src/tests/token_types_tests.rs: 1 test function removed, -11/+0 - crates/stylex-css/src/css/tests/totality_test.rs: 9 test functions removed, -277/+0 - crates/stylex-css/src/order/tests/legacy_expand_shorthands_constants_test.rs: 115 test functions removed, -1024/+1 - crates/stylex-css/src/tests/values_parser_tests.rs: 48 test functions removed, -467/+0 - crates/stylex-css/src/tests/when_tests.rs: 70 test functions removed, -501/+0 - crates/stylex-css/src/utils/tests/pre_rule_test.rs: 64 test functions removed, -805/+1 - crates/stylex-css/src/utils/tests/vector_test.rs: 9 test functions removed, -72/+0 - crates/stylex-css/src/values/tests/content_test.rs: 9 test functions removed, -78/+0 - crates/stylex-enums/src/tests/css_syntax_test.rs: 2 test functions removed, -47/+0 - crates/stylex-enums/src/tests/theme_ref_test.rs: 4 test functions removed, -28/+0 - crates/stylex-evaluator/src/evaluate/nodes/logical_expression.rs: unreferenced helpers removed, -8/+0 - crates/stylex-evaluator/src/evaluate/nodes/tests/empty_conversion_tests.rs: 1 test function removed, -13/+0 - crates/stylex-evaluator/src/evaluate/nodes/tests/logical_expression_tests.rs: 14 test functions removed, -263/+0 - crates/stylex-evaluator/src/evaluate/nodes/tests/object_key_tests.rs: 11 test functions removed, -144/+2 - crates/stylex-evaluator/src/evaluate/nodes/tests/type_of_tests.rs: 3 test functions removed, -31/+2 - crates/stylex-evaluator/src/evaluate/tests/concatenation_chain_tests.rs: 4 test functions removed, -36/+0 - crates/stylex-evaluator/src/evaluate/tests/folded_member_read_tests.rs: 8 test functions removed, -114/+1 - crates/stylex-evaluator/src/evaluate/tests/function_fold_object_tests.rs: 6 test functions removed, -129/+1 - crates/stylex-evaluator/src/evaluate/tests/injected_function_map_tests.rs: 5 test functions removed, -90/+4 - crates/stylex-evaluator/src/evaluate/tests/reported_message_tests.rs: 4 test functions removed, -63/+0 - crates/stylex-evaluator/src/evaluate/tests/source_evaluation.rs: unreferenced helpers removed, -19/+0 - crates/stylex-evaluator/src/evaluate/tests/typescript_expression_tests.rs: 5 test functions removed, -31/+1 - crates/stylex-evaluator/src/tests/convertors_tests.rs: 44 test functions removed, -937/+25 - crates/stylex-evaluator/src/tests/stylex_first_that_works_test.rs: 19 test functions removed, -273/+2 - crates/stylex-js/src/tests/coercions_tests.rs: 74 test functions removed, -1214/+2 - crates/stylex-js/src/tests/helpers_tests.rs: 7 test functions removed, -157/+1 - crates/stylex-js/src/tests/operators_tests.rs: 32 test functions removed, -238/+0 - crates/stylex-macros/src/tests/panic_macros_test.rs: 3 test functions removed, -25/+1 - crates/stylex-nested-config/src/tests/nested_test.rs: 25 test functions removed, -266/+3 - crates/stylex-path-resolver/src/package_json/tests.rs: 2 test functions removed, -47/+1 - crates/stylex-path-resolver/src/utils/tests/utils_test.rs: 6 test functions removed, -63/+2 - crates/stylex-regex/src/tests/regex_patterns_test.rs: 1 test function removed, -8/+1 - crates/stylex-regex/src/tests/regex_static_coverage_test.rs: 3 test functions removed, -53/+2 - crates/stylex-state-index/src/tests/candidate_index_test.rs: 25 test functions removed, -328/+0 - crates/stylex-state-index/src/tests/key_span_index_test.rs: 27 test functions removed, -621/+3 - crates/stylex-state/src/tests/evaluate_result_value_test.rs: 18 test functions removed, -200/+2 - crates/stylex-state/src/tests/flat_compiled_styles_value_test.rs: 20 test functions removed, -295/+0 - crates/stylex-state/src/tests/folded_value_test.rs: 17 test functions removed, -197/+2 - crates/stylex-state/src/tests/functions_test.rs: 3 test functions removed, -41/+1 - crates/stylex-state/src/tests/import_kind_test.rs: 2 test functions removed, -50/+0 - crates/stylex-state/src/tests/import_queries_test.rs: 9 test functions removed, -125/+1 - crates/stylex-state/src/tests/resolution_convertors_test.rs: 20 test functions removed, -334/+2 - crates/stylex-state/src/tests/resolution_lookup_test.rs: 8 test functions removed, -158/+5 - crates/stylex-state/src/tests/theme_ref_test.rs: 18 test functions removed, -181/+1 - crates/stylex-structures/src/tests/base_css_type_test.rs: 31 test functions removed, -509/+3 - crates/stylex-structures/src/tests/ceiling_test.rs: 14 test functions removed, -170/+0 - crates/stylex-structures/src/tests/core_stylex_options_test.rs: 2 test functions removed, -109/+0 - crates/stylex-structures/src/tests/named_import_source_test.rs: 1 test function removed, -6/+0 - crates/stylex-structures/src/tests/nested_test.rs: 6 test functions removed, -49/+1 - crates/stylex-structures/src/tests/order_pair_test.rs: 1 test function removed, -17/+1 - crates/stylex-structures/src/tests/pair_test.rs: 3 test functions removed, -43/+0 - crates/stylex-structures/src/tests/plugin_pass_test.rs: 3 test functions removed, -24/+0 - crates/stylex-structures/src/tests/raw_value_test.rs: 7 test functions removed, -63/+0 - crates/stylex-structures/src/tests/stylex_options_builders_test.rs: 5 test functions removed, -67/+3 - crates/stylex-structures/src/tests/stylex_options_test.rs: 9 test functions removed, -128/+1 - crates/stylex-structures/src/tests/stylex_state_options_test.rs: 8 test functions removed, -96/+2 - crates/stylex-structures/src/tests/uid_generator_test.rs: 5 test functions removed, -69/+1 - crates/stylex-styleq/src/tests/capturing_logger.rs: unreferenced helpers removed, -64/+1 - crates/stylex-styleq/src/tests/styleq_tests.rs: 13 test functions removed, -191/+0 - crates/stylex-transform/src/shared/structures/tests/pre_rule_accessors_test.rs: 16 test functions removed, -159/+1 - crates/stylex-transform/src/shared/structures/tests/pre_rule_equality_test.rs: 17 test functions removed, -161/+1 - crates/stylex-transform/src/shared/transformers/tests/stylex_create_theme_nested_test.rs: 6 test functions removed, -299/+2 - crates/stylex-transform/src/shared/transformers/tests/stylex_create_theme_test.rs: 9 test functions removed, -642/+3 - crates/stylex-transform/src/shared/transformers/tests/stylex_types_test_test.rs: 9 test functions removed, -126/+5 - crates/stylex-transform/src/shared/utils/ast/tests/helpers_tests.rs: 9 test functions removed, -92/+1 - crates/stylex-transform/src/shared/utils/core/tests/convert_to_class_name_test.rs: 25 test functions removed, -302/+2 - crates/stylex-transform/src/shared/utils/core/tests/define_vars_utils_tests.rs: 7 test functions removed, -83/+1 - crates/stylex-transform/src/shared/utils/core/tests/flat_map_expanded_shorthands_tests.rs: 13 test functions removed, -190/+1 - crates/stylex-transform/src/shared/utils/core/tests/flatten_raw_style_object_tests.rs: 19 test functions removed, -152/+0 - crates/stylex-transform/src/shared/utils/core/tests/js_to_ast_tests.rs: 11 test functions removed, -349/+2 - crates/stylex-transform/src/shared/utils/core/tests/props_tests.rs: 15 test functions removed, -222/+2 - crates/stylex-transform/src/shared/utils/core/tests/style_args.rs: unreferenced helpers removed, -9/+0 - crates/stylex-transform/src/shared/utils/core/tests/styleq_tests.rs: 9 test functions removed, -101/+1 - crates/stylex-transform/src/shared/utils/core/tests/stylex_nested_utils_test.rs: 42 test functions removed, -879/+4 - crates/stylex-transform/src/shared/utils/tests/object_tests.rs: 13 test functions removed, -149/+2 - crates/stylex-transform/src/transform/stylex/transform_stylex_create_call/tests/resolve_when_marker_tests.rs: 3 test functions removed, -47/+0 - crates/stylex-transform/src/transform/stylex/transform_stylex_define_vars_call/tests/dependency_visitor_test.rs: 3 test functions removed, -49/+1 - crates/stylex-transform/src/transform/tests/transform_construction_test.rs: 2 test functions removed, -74/+3 - crates/stylex-transform/src/transform/visit_mut/tests/sx_runtime_binding_test.rs: 2 test functions removed, -54/+0 - crates/stylex-types/src/enums/data_structures/tests/injectable_style_test.rs: 3 test functions removed, -83/+1 - crates/stylex-types/src/structures/tests/injectable_style_test.rs: 2 test functions removed, -21/+0 - crates/stylex-types/src/structures/tests/style_key_test.rs: 2 test functions removed, -26/+0 - crates/stylex-types/src/tests/traits_test.rs: 2 test functions removed, -18/+0 - crates/stylex-utils/src/tests/collection_test.rs: 11 test functions removed, -90/+1 - crates/stylex-utils/src/tests/hash_test.rs: 47 test functions removed, -803/+21 - crates/stylex-utils/src/tests/identifier_test.rs: 7 test functions removed, -46/+0 - crates/stylex-utils/src/tests/string_test.rs: 40 test functions removed, -310/+4 In total, 161 files changed, 465 insertions(+), 36232 deletions(-).
…p can't see The coverage-guided pruning measured coverage on Linux only, so it could not see tests whose value is on Windows or macOS. Restore the removed tests that: - carry a platform gate: relative_path_basic and relative_path_with_parent (stylex-path-resolver utils), whose #[cfg(windows)] halves are the only checks of relative_path on drive-letter paths; - test stylex-path-resolver, whose production code has platform-gated branches (resolvers/mod.rs) and path handling that differs by OS: file_system/tests.rs, two package_json tests, and the remaining four utils tests; - exercise path handling in the platform-gated production files: stylex-state get_canonical_file_path_test.rs (state_manager.rs, including a backslash path) and get_package_name_and_path_test.rs, and the 23 stylex-ast source_file tests (file names, stems, relative and invalid paths read through std::path). No removed test exercises add_source_map_data.rs's or growable_stack.rs's platform branches. Also restore the removed stack-safety tests. Stack exhaustion is platform- specific in a way Linux coverage cannot show (Windows runs on a 1 MiB main stack with different frame sizes; this week's CI failures included macOS stack overflows): every removed test that builds deeply nested or depth-bounded input, or whose name says deep, stack or a nesting bound. Matches of those words in an unrelated sense stay removed: the CSS `overflow` property, the *Nested APIs and selector-nesting order, numeric overflow, configuration limit clamps, and long-but-flat inputs. Tests from whole files the first pruning commit removed come back in those files with only the restored tests, their `mod` declarations and the helpers they use. Restoring only adds tests, so Linux production-line coverage stays at least 42,579. The full workspace suite at 2 MiB passes: 3,747 / 0 / 0 (75 tests restored). Restored platform and path tests: - crates/stylex-path-resolver/src/file_system/tests.rs (whole file, with its mod) - crates/stylex-path-resolver/src/package_json/tests.rs (2 tests) - crates/stylex-path-resolver/src/utils/tests/utils_test.rs (6 tests) - crates/stylex-state/src/tests/get_canonical_file_path_test.rs (whole file, with its mod) - crates/stylex-state/src/tests/get_package_name_and_path_test.rs (whole file, with its mod) - crates/stylex-ast/src/ast/tests/source_file_test.rs (23 tests) Restored stack-safety tests (33): - crates/postcss-value-parser/src/tests/properties.rs: deeply_nested_functions_parse_serialize_and_walk, deeply_nested_unclosed_functions_are_all_flagged - crates/stylex-ast/src/ast/tests/convertors_test.rs: normalize_expr_handles_deeply_nested_parens_without_recursion - crates/stylex-constants/src/constants/tests/evaluation_errors_test.rs: test_expression_too_deep - crates/stylex-css-parser/src/tests/css_types/color_double_precision_test.rs: a_deeply_nested_colour_function_terminates, a_deeply_nested_modern_colour_function_terminates - crates/stylex-css-parser/src/tests/css_types/double_precision_test.rs: a_deeply_nested_unterminated_calc_terminates_with_its_operand, a_very_deeply_nested_calc_terminates, deeply_nested_calc_keeps_every_operand - crates/stylex-css-parser/src/tests/css_types/js_number_spelling_test.rs: a_deeply_nested_calc_prints_without_exhausting_the_stack - crates/stylex-css-parser/src/tests/token_types_coverage_test.rs: a_block_nested_past_the_cssparser_default_limit_is_tokenized - crates/stylex-css/src/css/tests/spacing_repair_parity_test.rs: counts_nesting_inside_a_url_body_as_the_parser_does - crates/stylex-css/src/css/tests/totality_test.rs: no_longer_arrangement_of_the_nesting_characters_can_crash_it, only_nesting_is_bounded_and_it_rejects_rather_than_aborting - crates/stylex-css/src/css/tests/unprefixed_custom_properties_test.rs: a_value_nested_too_deeply_is_reported_before_this_rule - crates/stylex-css/src/css/tests/value_normalization_parity_test.rs: rejects_deep_nesting_on_a_colour_function, rejects_function_nesting_past_the_limit, survives_function_nesting_up_to_the_limit - crates/stylex-css/src/tests/values_parser_tests.rs: a_value_nested_far_past_the_budget_still_returns_rather_than_aborting, a_value_nested_up_to_the_budget_is_still_split - crates/stylex-css/src/values/tests/content_test.rs: reads_a_deeply_nested_function_as_one_component - crates/stylex-state/src/tests/folded_value_test.rs: reads_an_object_as_deep_as_it_goes - crates/stylex-structures/src/tests/base_css_type_test.rs: from_object_lit_panics_when_deeply_nested_value_is_non_lit_non_object - crates/stylex-structures/src/tests/nested_test.rs: flatten_nested_string_config_handles_deep_nesting - crates/stylex-transform/src/shared/structures/tests/flatten_raw_style_objects_test.rs: extra_deep_pseudo_within_a_media_query_modern_syntax - crates/stylex-transform/src/shared/transformers/tests/stylex_define_consts_nested_test.rs: handles_deeply_nested_constants - crates/stylex-transform/src/shared/transformers/tests/stylex_define_vars_nested_test.rs: handles_deeply_nested_tokens_3_levels - crates/stylex-transform/src/shared/utils/core/tests/stylex_nested_utils_test.rs: flattens_4_levels_deep, flattens_a_deeply_nested_object_3_levels, handles_deeply_nested_keys_4_levels, stops_at_deeply_nested_conditional_at_rule_values - crates/stylex-utils/src/tests/hash_test.rs: a_deep_expression_hashes_the_whole_depth_without_running_out_of_stack, an_over_limit_collection_nested_pays_the_fallback_at_every_level In total, 34 files changed, 1581 insertions(+), 39 deletions(-).
This branch has not been deployed
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.
No description provided.