Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changepacks/changepack_log_bun_latest_coverage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"changes": {
"packages/eslint-plugin/package.json": "Patch"
},
"note": "Fix sparse trailing-null autofixes to preserve authored values, complete parenthesized syntax and earlier holes using token-based edit boundaries while removing the maximal trailing run of nulls and holes only when the last element is canonical literal null; preserve regular-expression and BigInt literals without validating regex syntax, preserve existing comment and trailing-comma handling, remove an unreachable AST guard and restore complete behavior coverage on the latest Bun without exclusions or new build errors.",
"date": "2026-10-22T00:00:00.000Z"
}
7 changes: 7 additions & 0 deletions .changepacks/changepack_log_factory_call_references.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"changes": {
"bindings/devup-ui-wasm/package.json": "Patch"
},
"note": "Compile imported style utility calls before serializing dynamic JSX factory values, preserving lexical shadows and deterministic CSS-variable output. Existing located css/keyframes errors now also reject unreadable nested factory values instead of emitting missing runtime calls; no new error kind.",
"date": "2026-10-23T00:00:00.000Z"
}
67 changes: 51 additions & 16 deletions libs/extractor/src/extractor/extract_style_from_expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ pub fn extract_style_from_expression<'a>(
level,
selector,
literal_handling,
&mut |_| {},
)
}

Expand All @@ -247,6 +248,7 @@ pub(crate) fn extract_with_policy<'a, const LOCATE: bool>(
level: u8,
selector: &Option<StyleSelector>,
literal_handling: LiteralHandling,
prepare: &mut impl FnMut(&mut Expression<'a>),
) -> ExtractResult<'a> {
let mut typo = false;
let expression = unwrap_syntax_only_mut(expression);
Expand Down Expand Up @@ -294,7 +296,8 @@ pub(crate) fn extract_with_policy<'a, const LOCATE: bool>(
{
// The upfront authored walk already checks every root key,
// including the literal spreads flattened above.
for disassembled in disassemble_property(&name) {
let mut properties = disassemble_property(&name);
while let Some(disassembled) = properties.next() {
let disassembled: &str = &disassembled;
if name == "styleOrder" {
style_order = get_number_by_literal_expression(&prop.value)
Expand All @@ -310,15 +313,20 @@ pub(crate) fn extract_with_policy<'a, const LOCATE: bool>(
ast_builder.allocator(),
));
} else {
let mut sibling = (properties.len() != 0).then(|| {
prop.value
.clone_in_with_semantic_ids(ast_builder.allocator())
});
let ExtractResult {
styles, tag: _tag, ..
} = extract_with_policy::<LOCATE>(
ast_builder,
Some(disassembled),
&mut prop.value,
sibling.as_mut().unwrap_or(&mut prop.value),
0,
&None,
LiteralHandling::ExpandResponsiveThemeToken,
prepare,
);
props_styles.extend(styles);
tag = _tag.or(tag);
Expand All @@ -339,6 +347,7 @@ pub(crate) fn extract_with_policy<'a, const LOCATE: bool>(
0,
&None,
LiteralHandling::ExpandResponsiveThemeToken,
prepare,
);
props_styles.extend(styles);
tag = _tag.or(tag);
Expand Down Expand Up @@ -368,6 +377,7 @@ pub(crate) fn extract_with_policy<'a, const LOCATE: bool>(
level,
&None,
literal_handling,
prepare,
)
.styles,
))),
Expand All @@ -379,6 +389,7 @@ pub(crate) fn extract_with_policy<'a, const LOCATE: bool>(
level,
selector,
literal_handling,
prepare,
)
.styles,
))),
Expand Down Expand Up @@ -413,12 +424,12 @@ pub(crate) fn extract_with_policy<'a, const LOCATE: bool>(
for part in split_selector_list(name) {
styles.extend(extract_under_key::<LOCATE>(
ast_builder,
part,
offset,
&mut expression.clone_in(ast_builder.allocator()),
(part, offset),
&mut expression.clone_in_with_semantic_ids(ast_builder.allocator()),
level,
selector,
literal_handling,
prepare,
));
}
return ExtractResult {
Expand Down Expand Up @@ -458,12 +469,12 @@ pub(crate) fn extract_with_policy<'a, const LOCATE: bool>(
for part in split_selector_list(key_name.trim()) {
props.extend(extract_under_key::<LOCATE>(
ast_builder,
part,
offset,
&mut o.value.clone_in(ast_builder.allocator()),
(part, offset),
&mut o.value.clone_in_with_semantic_ids(ast_builder.allocator()),
level,
selector,
literal_handling,
prepare,
));
}
}
Expand All @@ -490,6 +501,7 @@ pub(crate) fn extract_with_policy<'a, const LOCATE: bool>(
level,
selector,
literal_handling,
prepare,
)
.styles;
place_in_layer(&mut styles, &layer);
Expand Down Expand Up @@ -520,6 +532,7 @@ pub(crate) fn extract_with_policy<'a, const LOCATE: bool>(
level,
&Some(at_selector),
literal_handling,
prepare,
)
.styles,
);
Expand All @@ -536,12 +549,12 @@ pub(crate) fn extract_with_policy<'a, const LOCATE: bool>(
return ExtractResult {
styles: extract_under_key::<LOCATE>(
ast_builder,
name,
offset,
(name, offset),
expression,
level,
selector,
literal_handling,
prepare,
),
..ExtractResult::default()
};
Expand Down Expand Up @@ -655,13 +668,14 @@ pub(crate) fn extract_with_policy<'a, const LOCATE: bool>(
expression,
level,
selector,
prepare,
)],
..ExtractResult::default()
},
None => unreadable(expression),
},
Expression::ComputedMemberExpression(mem) => {
extract_member::<LOCATE>(ast_builder, name, mem, level, selector)
extract_member::<LOCATE>(ast_builder, name, mem, level, selector, prepare)
}
Expression::TemplateLiteral(_) => {
let Some(name) = name else {
Expand Down Expand Up @@ -715,6 +729,7 @@ pub(crate) fn extract_with_policy<'a, const LOCATE: bool>(
expression,
level,
selector,
prepare,
)]
},
..ExtractResult::default()
Expand Down Expand Up @@ -794,6 +809,7 @@ pub(crate) fn extract_with_policy<'a, const LOCATE: bool>(
expression,
level,
selector,
prepare,
)],
..ExtractResult::default()
}
Expand Down Expand Up @@ -822,6 +838,7 @@ pub(crate) fn extract_with_policy<'a, const LOCATE: bool>(
level,
selector,
literal_handling,
prepare,
)
}
Expression::ConditionalExpression(conditional)
Expand All @@ -839,6 +856,7 @@ pub(crate) fn extract_with_policy<'a, const LOCATE: bool>(
level,
selector,
literal_handling,
prepare,
)
}
Expression::LogicalExpression(logical) => {
Expand All @@ -850,6 +868,7 @@ pub(crate) fn extract_with_policy<'a, const LOCATE: bool>(
level,
selector,
literal_handling,
prepare,
)
.styles,
)));
Expand Down Expand Up @@ -899,6 +918,7 @@ pub(crate) fn extract_with_policy<'a, const LOCATE: bool>(
level,
selector,
literal_handling,
prepare,
)
.styles,
))),
Expand Down Expand Up @@ -931,6 +951,7 @@ pub(crate) fn extract_with_policy<'a, const LOCATE: bool>(
idx as u8,
selector,
LiteralHandling::KeepSingleClass,
prepare,
)
.styles,
);
Expand All @@ -953,6 +974,7 @@ pub(crate) fn extract_with_policy<'a, const LOCATE: bool>(
level,
selector,
literal_handling,
prepare,
)
} else {
ExtractResult {
Expand All @@ -966,6 +988,7 @@ pub(crate) fn extract_with_policy<'a, const LOCATE: bool>(
level,
selector,
literal_handling,
prepare,
)
.styles,
))),
Expand All @@ -977,6 +1000,7 @@ pub(crate) fn extract_with_policy<'a, const LOCATE: bool>(
level,
selector,
literal_handling,
prepare,
)
.styles,
))),
Expand Down Expand Up @@ -1043,6 +1067,7 @@ pub(crate) fn extract_with_policy<'a, const LOCATE: bool>(
level,
&selector,
literal_handling,
prepare,
)
.styles,
);
Expand All @@ -1063,16 +1088,20 @@ pub(crate) fn extract_with_policy<'a, const LOCATE: bool>(
props.push(error);
continue;
}
for name in disassemble_property(&key_name) {
let mut properties = disassemble_property(&key_name);
while let Some(name) = properties.next() {
let name: &str = &name;
let mut sibling = (properties.len() != 0)
.then(|| o.value.clone_in_with_semantic_ids(ast_builder.allocator()));
props.extend(
extract_with_policy::<LOCATE>(
ast_builder,
Some(name),
&mut o.value,
sibling.as_mut().unwrap_or(&mut o.value),
level,
&selector,
literal_handling,
prepare,
)
.styles,
);
Expand All @@ -1099,6 +1128,7 @@ pub(crate) fn extract_with_policy<'a, const LOCATE: bool>(
// A sequence keeps its parentheses, as its code is written into
// the element's style object, where a comma ends the property
Some(name) if matches!(expression, Expression::SequenceExpression(_)) => {
prepare(expression);
let code = expression_to_code(expression);
ExtractResult {
styles: vec![ExtractStyleProp::Static(ExtractStyleValue::Dynamic(
Expand All @@ -1121,6 +1151,7 @@ pub(crate) fn extract_with_policy<'a, const LOCATE: bool>(
expression,
level,
selector,
prepare,
)],
..ExtractResult::default()
},
Expand Down Expand Up @@ -1340,13 +1371,14 @@ impl From<Option<StyleSelector>> for Nested {

fn extract_under_key<'a, const LOCATE: bool>(
ast_builder: &AstBuilder<'a>,
key: &str,
offset: u32,
located_key: (&str, u32),
expression: &mut Expression<'a>,
level: u8,
selector: &Option<StyleSelector>,
literal_handling: LiteralHandling,
prepare: &mut impl FnMut(&mut Expression<'a>),
) -> Vec<ExtractStyleProp<'a>> {
let (key, offset) = located_key;
match nest_selectors_key(selector.as_ref(), key) {
Nested::Under(nested) => {
extract_with_policy::<LOCATE>(
Expand All @@ -1356,6 +1388,7 @@ fn extract_under_key<'a, const LOCATE: bool>(
level,
&Some(nested),
literal_handling,
prepare,
)
.styles
}
Expand Down Expand Up @@ -1470,9 +1503,10 @@ fn conditional_typography<'a>(
pub fn dynamic_style<'a>(
ast_builder: &AstBuilder<'a>,
name: &str,
expression: &Expression<'a>,
expression: &mut Expression<'a>,
level: u8,
selector: &Option<StyleSelector>,
prepare: &mut impl FnMut(&mut Expression<'a>),
) -> ExtractStyleProp<'a> {
if let Some(map) = get_enum_property_map(name) {
ExtractStyleProp::Enum {
Expand All @@ -1494,6 +1528,7 @@ pub fn dynamic_style<'a>(
.collect(),
}
} else {
prepare(expression);
ExtractStyleProp::Static(ExtractStyleValue::Dynamic(ExtractDynamicStyle::new(
name,
level,
Expand Down
Loading
Loading