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
3 changes: 3 additions & 0 deletions .changeset/spotty-experts-smoke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---

---
40 changes: 20 additions & 20 deletions packages/react/runtime/__test__/list.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ describe(`list "update-list-info"`, () => {

expect(__pendingListUpdates.values).toMatchInlineSnapshot(`
{
"-2": [
"-6": [
{
"insertAction": [
{
Expand Down Expand Up @@ -269,7 +269,7 @@ describe(`list "update-list-info"`, () => {
b.removeChild(d2);
expect(__pendingListUpdates.values).toMatchInlineSnapshot(`
{
"-2": [
"-6": [
{
"insertAction": [
{
Expand Down Expand Up @@ -304,7 +304,7 @@ describe(`list "update-list-info"`, () => {
b.insertBefore(d3); // move
expect(__pendingListUpdates.values).toMatchInlineSnapshot(`
{
"-2": [
"-6": [
{
"insertAction": [
{
Expand Down Expand Up @@ -352,7 +352,7 @@ describe(`list "update-list-info"`, () => {
d3.setAttribute(0, { 'item-key': 3 });
expect(__pendingListUpdates.values).toMatchInlineSnapshot(`
{
"-1": [
"-2": [
{
"insertAction": [],
"removeAction": [],
Expand Down Expand Up @@ -572,7 +572,7 @@ describe(`list componentAtIndex`, () => {
<text
event={
{
"bindEvent:tap": "-6:1:",
"bindEvent:tap": "-7:1:",
}
}
>
Expand All @@ -587,7 +587,7 @@ describe(`list componentAtIndex`, () => {
<text
event={
{
"bindEvent:tap": "-7:1:",
"bindEvent:tap": "-8:1:",
}
}
>
Expand All @@ -602,7 +602,7 @@ describe(`list componentAtIndex`, () => {
<text
event={
{
"bindEvent:tap": "-4:1:",
"bindEvent:tap": "-5:1:",
}
}
>
Expand All @@ -617,7 +617,7 @@ describe(`list componentAtIndex`, () => {
<text
event={
{
"bindEvent:tap": "-5:1:",
"bindEvent:tap": "-6:1:",
}
}
>
Expand Down Expand Up @@ -2033,7 +2033,7 @@ describe('list bug', () => {

expect(__pendingListUpdates.values).toMatchInlineSnapshot(`
{
"-2": [
"-5": [
{
"insertAction": [
{
Expand Down Expand Up @@ -2080,7 +2080,7 @@ describe('list bug', () => {
b.insertBefore(d3); // move
expect(__pendingListUpdates.values).toMatchInlineSnapshot(`
{
"-2": [
"-5": [
{
"insertAction": [
{
Expand Down Expand Up @@ -2122,7 +2122,7 @@ describe('list bug', () => {
b.removeChild(d3); // move
expect(__pendingListUpdates.values).toMatchInlineSnapshot(`
{
"-2": [
"-5": [
{
"insertAction": [],
"removeAction": [
Expand Down Expand Up @@ -3565,7 +3565,7 @@ describe('list-item with "defer" attribute', () => {
"rLynxPublishEvent",
{
"data": {},
"handlerName": "-6:__extraProps:onComponentAtIndex",
"handlerName": "-7:__extraProps:onComponentAtIndex",
},
],
],
Expand All @@ -3574,7 +3574,7 @@ describe('list-item with "defer" attribute', () => {
"rLynxPublishEvent",
{
"data": {},
"handlerName": "-4:__extraProps:onRecycleComponent",
"handlerName": "-5:__extraProps:onRecycleComponent",
},
],
],
Expand Down Expand Up @@ -3663,7 +3663,7 @@ describe('nested list', () => {

expect(__pendingListUpdates.values).toMatchInlineSnapshot(`
{
"-2": [
"-5": [
{
"insertAction": [
{
Expand All @@ -3683,7 +3683,7 @@ describe('nested list', () => {
"updateAction": [],
},
],
"-3": [
"-6": [
{
"insertAction": [
{
Expand All @@ -3695,7 +3695,7 @@ describe('nested list', () => {
"updateAction": [],
},
],
"-4": [
"-7": [
{
"insertAction": [
{
Expand All @@ -3707,7 +3707,7 @@ describe('nested list', () => {
"updateAction": [],
},
],
"-5": [
"-8": [
{
"insertAction": [
{
Expand All @@ -3727,7 +3727,7 @@ describe('nested list', () => {
// children list should not be cleared
expect(__pendingListUpdates.values).toMatchInlineSnapshot(`
{
"-3": [
"-6": [
{
"insertAction": [
{
Expand All @@ -3739,7 +3739,7 @@ describe('nested list', () => {
"updateAction": [],
},
],
"-4": [
"-7": [
{
"insertAction": [
{
Expand All @@ -3751,7 +3751,7 @@ describe('nested list', () => {
"updateAction": [],
},
],
"-5": [
"-8": [
{
"insertAction": [
{
Expand Down
4 changes: 4 additions & 0 deletions packages/react/runtime/__test__/utils/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ function injectGlobals() {
globalThis.requestAnimationFrame = setTimeout;
globalThis.cancelAnimationFrame = clearTimeout;

globalThis.__SNAPSHOT__ = (snapshot) => {
return snapshot.type;
};

console.profile = vi.fn();
console.profileEnd = vi.fn();
console.alog = vi.fn();
Expand Down
1 change: 0 additions & 1 deletion packages/react/transform/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,6 @@ fn transform_react_lynx_inner(
JSXTransformer::new(
snapshot_plugin_config,
Some(&comments),
unresolved_mark,
options.mode.unwrap_or(TransformMode::Production),
)
.with_content_hash(content_hash.clone()),
Expand Down
4 changes: 1 addition & 3 deletions packages/react/transform/src/swc_plugin_list/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ where
#[cfg(test)]
mod tests {
use swc_core::{
common::{comments::SingleThreadedComments, Mark},
common::comments::SingleThreadedComments,
ecma::{
parser::{EsSyntax, Syntax},
transforms::testing::test,
Expand Down Expand Up @@ -304,7 +304,6 @@ mod tests {
..Default::default()
}),
|t| {
let unresolved_mark = Mark::new();
(
visit_mut_pass(ListVisitor::new(Some(t.comments.clone()))),
visit_mut_pass(JSXTransformer::<&SingleThreadedComments>::new(
Expand All @@ -314,7 +313,6 @@ mod tests {
..Default::default()
},
None,
unresolved_mark,
TransformMode::Development,
)),
)
Expand Down
Loading
Loading