mirror of
https://github.com/oxc-project/oxc.git
synced 2026-09-14 19:36:11 +08:00
48e917fcba
Preserve tagged-template call, aliasing, and mutation effects instead of assuming no-substitution tags are primitive or pure. Execute opaque or effectful tags unconditionally while retaining memoization only when a configured signature proves a read-only pure call and safe return. AI-assisted investigation and implementation; reviewed and understood by the contributor.
27 lines
575 B
Plaintext
27 lines
575 B
Plaintext
---
|
|
source: crates/oxc_react_compiler/tests/snapshot.rs
|
|
input_file: crates/oxc_react_compiler/fixtures/optional-call-logical.js
|
|
---
|
|
import { c as _c } from "react/compiler-runtime";
|
|
import { useFragment } from "shared-runtime";
|
|
function Component(props) {
|
|
const $ = _c(2);
|
|
const item = useFragment(graphql`
|
|
fragment F on T {
|
|
id
|
|
}
|
|
`, props.item);
|
|
let t0;
|
|
if ($[0] !== item.items) {
|
|
t0 = item.items?.map(_temp) ?? [];
|
|
$[0] = item.items;
|
|
$[1] = t0;
|
|
} else {
|
|
t0 = $[1];
|
|
}
|
|
return t0;
|
|
}
|
|
function _temp(item_0) {
|
|
return renderItem(item_0);
|
|
}
|