Skip to content

ci(benchmark/react): enable list in benchmark#1635

Merged
colinaaa merged 1 commit intolynx-family:mainfrom
hzy:p/hzy/bench_4
Sep 3, 2025
Merged

ci(benchmark/react): enable list in benchmark#1635
colinaaa merged 1 commit intolynx-family:mainfrom
hzy:p/hzy/bench_4

Conversation

@hzy
Copy link
Copy Markdown
Collaborator

@hzy hzy commented Sep 1, 2025

Summary by CodeRabbit

  • New Features

    • Added a recursive text renderer used in the hello demo.
    • Introduced a new benchmark showcasing a styled, scrollable list that auto-scrolls and stops when complete.
    • Enabled performance instrumentation for list creation/update during benchmarks.
  • Chores

    • Added a new build target and scripts to run and trace the list benchmark; included a required dependency.
    • Updated the benchmark CLI build to cherry-pick a newer commit.
    • Improved CLI prepare step to avoid overwriting an existing binary.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).
  • Changeset added, and when a BREAKING CHANGE occurs, it needs to be clearly marked (or not required).

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Sep 1, 2025

⚠️ No Changeset found

Latest commit: 3ec2001

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Sep 1, 2025

📝 Walkthrough

Walkthrough

Adds a new RecursiveText component and refactors case 002 to use it. Introduces a new benchmark case 003 (hello-list), associated instrumentation (patchUpdateListCallbacks), config entries, and scripts. Centralizes PREFIX in hook.ts and updates patchProfile.ts to import it. Updates benchx_cli build commit and adds an idempotent prepare guard.

Changes

Cohort / File(s) Summary of edits
Case 002 refactor to reusable component
benchmark/react/cases/002-hello-reactLynx/RecursiveText.tsx, benchmark/react/cases/002-hello-reactLynx/index.tsx
Added RecursiveText component rendering text via recursion; index now imports and renders it, removing the inline component.
New benchmark: 003 hello-list
benchmark/react/cases/003-hello-list/index.tsx, benchmark/react/lynx.config.js, benchmark/react/package.json, benchmark/react/src/patchUpdateListCallbacks.ts
Added list benchmark component with programmatic scrolling and stop flag; registered new entry in lynx.config; added run/perfetto scripts and dependency; introduced instrumentation to wrap list callbacks with Codspeed on main thread.
PREFIX centralization
benchmark/react/src/hook.ts, benchmark/react/src/patchProfile.ts
Exported PREFIX from hook.ts; patchProfile.ts now imports PREFIX instead of computing it locally.
benchx_cli maintenance
packages/lynx/benchx_cli/scripts/build.mjs, packages/lynx/benchx_cli/scripts/prepare.mjs
Updated PICK_COMMIT to a new SHA; prepare script now exits early if dist/bin/benchx_cli already exists to avoid overwrites.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

Possibly related PRs

Suggested reviewers

  • upupming
  • colinaaa

Poem

I nibble bytes and hop through lists so neat,
Nesting letters, every char a treat.
New trails marked PREFIX in the breeze,
Bench drums roll with Codspeed’s tease.
Commit seeds planted, tools prepare—
Hello, ReactLynx! I’m already there. 🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@relativeci
Copy link
Copy Markdown

relativeci Bot commented Sep 1, 2025

React Example

#4820 Bundle Size — 237.5KiB (0%).

3ec2001(current) vs af2d59b main#4814(baseline)

Bundle metrics  no changes
                 Current
#4820
     Baseline
#4814
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
No change  Cache Invalidation 0% 0%
No change  Chunks 0 0
No change  Assets 4 4
No change  Modules 160 160
No change  Duplicate Modules 65 65
No change  Duplicate Code 45.83% 45.83%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#4820
     Baseline
#4814
No change  IMG 145.76KiB 145.76KiB
No change  Other 91.74KiB 91.74KiB

Bundle analysis reportBranch hzy:p/hzy/bench_4Project dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented Sep 1, 2025

Web Explorer

#4811 Bundle Size — 367.43KiB (0%).

3ec2001(current) vs af2d59b main#4805(baseline)

Bundle metrics  Change 2 changes
                 Current
#4811
     Baseline
#4805
No change  Initial JS 144.23KiB 144.23KiB
No change  Initial CSS 31.84KiB 31.84KiB
No change  Cache Invalidation 0% 0%
No change  Chunks 8 8
No change  Assets 8 8
Change  Modules 219(-0.45%) 220
No change  Duplicate Modules 16 16
Change  Duplicate Code 3.33%(+0.3%) 3.32%
No change  Packages 4 4
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#4811
     Baseline
#4805
No change  JS 235.43KiB 235.43KiB
No change  Other 100.16KiB 100.16KiB
No change  CSS 31.84KiB 31.84KiB

Bundle analysis reportBranch hzy:p/hzy/bench_4Project dashboard


Generated by RelativeCIDocumentationReport issue

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Sep 1, 2025

CodSpeed Performance Report

Merging #1635 will improve performances by 10.88%

Comparing hzy:p/hzy/bench_4 (3ec2001) with main (af2d59b)

🎉 Hooray! codspeed-cpp just leveled up to 1.2.0!

A heads-up, this is a breaking change and it might affect your current performance baseline a bit. But here's the exciting part - it's packed with new, cool features and promises improved result stability 🥳!
Curious about what's new? Visit our releases page to delve into all the awesome details about this new version.

Summary

⚡ 1 improvements
✅ 19 untouched benchmarks
🆕 9 new benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
🆕 003-hello-list-destroyBackground N/A 2.5 ms N/A
🆕 003-hello-list-hydrate N/A 8.3 ms N/A
🆕 003-hello-list-renderBackground N/A 18.5 ms N/A
🆕 003-hello-list__main-thread-componentAtIndex__create N/A 5.2 ms N/A
🆕 003-hello-list__main-thread-componentAtIndex__reuse N/A 3.1 ms N/A
🆕 003-hello-list__main-thread-processData N/A 22.5 µs N/A
🆕 003-hello-list__main-thread-renderMainThread N/A 15.2 ms N/A
🆕 003-hello-list__main-thread-renderOpcodes N/A 2.2 ms N/A
🆕 003-hello-list__main-thread-serializeRoot N/A 3.8 ms N/A
basic-performance-nest-level-100 6.7 ms 6 ms +10.88%

@hzy hzy force-pushed the p/hzy/bench_4 branch 6 times, most recently from 3fbb09b to 415f2ea Compare September 2, 2025 13:13
@hzy hzy marked this pull request as ready for review September 2, 2025 13:13
Copilot AI review requested due to automatic review settings September 2, 2025 13:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enables list benchmarking in the React benchmark suite by adding a new "hello-list" benchmark test case that measures list component performance with scrolling operations.

Key changes:

  • Creates a new list benchmark case with scroll operations and component reuse tracking
  • Extracts and shares the RecursiveText component between benchmark cases
  • Adds Codspeed integration for list-specific performance measurements

Reviewed Changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/lynx/benchx_cli/scripts/build.mjs Updates commit hash for build script
benchmark/react/src/patchUpdateListCallbacks.ts Adds Codspeed integration for list component benchmarking
benchmark/react/src/patchProfile.ts Refactors to use shared PREFIX constant
benchmark/react/src/hook.ts Exports shared PREFIX constant for benchmark naming
benchmark/react/package.json Adds scripts for list benchmark and perfetto tracing
benchmark/react/lynx.config.js Configures build entry for hello-list benchmark
benchmark/react/cases/003-hello-list/index.tsx Implements new list benchmark with scroll operations
benchmark/react/cases/002-hello-reactLynx/index.tsx Refactors to use extracted RecursiveText component
benchmark/react/cases/002-hello-reactLynx/RecursiveText.tsx Extracts RecursiveText component for reuse

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (9)
benchmark/react/src/hook.ts (1)

18-18: Normalize PREFIX splitting for cross-platform paths

Verified __REPO_FILEPATH__ is declared in benchmark/react/rspeedy-env.d.ts:59. Apply:

-export const PREFIX = __REPO_FILEPATH__.split('/').slice(0, -2).join('/');
+export const PREFIX = __REPO_FILEPATH__.split(/[/\\]/).slice(0, -2).join('/');
benchmark/react/cases/002-hello-reactLynx/RecursiveText.tsx (2)

10-17: Return null explicitly instead of boolean false

Be explicit about the base case to avoid returning a bare boolean.

-  return (
-    sliced.length > 0 && (
-      <text>
-        {first}
-        <RecursiveText text={rest.join('')} />
-      </text>
-    )
-  );
+  if (sliced.length === 0) return null;
+  return (
+    <text>
+      {first}
+      <RecursiveText text={rest.join('')} />
+    </text>
+  );

5-18: Avoid O(n^2) string joins in recursion (optional, benchmark-sensitive)

Joining on every frame makes total work quadratic in input length. If this case ever uses longer strings, consider an index-based approach.

Example alternative:

function RecursiveText(props: { text: string }) {
  const arr = [...props.text];
  function NodeAt(i: number): JSX.Element | null {
    if (i >= arr.length) return null;
    return <text>{arr[i]}<NodeAt i={i + 1} /></text>;
  }
  return NodeAt(0);
}
benchmark/react/package.json (1)

17-17: Consider a minimal smoke test instead of disabling tests

Echoing “No tests specified” can mask regressions in CI. A tiny render smoke test would give basic guardrails without adding overhead.

Example:

{
  "scripts": {
    "test": "node -e \"console.log('benchmark-react smoke: OK')\""
  }
}
benchmark/react/rspeedy-env.d.ts (2)

14-16: Prefer importing official types when available

Once @lynx-js/type-element-api (or equivalent) exports these, replace local aliases to avoid drift.


59-59: Consider declaring webpack_chunkname for type safety

Used elsewhere but not declared here.

 declare const __REPO_FILEPATH__: string;
+declare const __webpack_chunkname__: string;
benchmark/react/src/patchProfile.ts (1)

5-5: Verify .js extension resolution for TS import

If moduleResolution isn’t “Bundler”, this may fail. Prefer extensionless import for TS.

-import { PREFIX, hook } from './hook.js';
+import { PREFIX, hook } from './hook';

Optionally add import '@lynx-js/react'; to ensure lynx.performance exists before hooking across bundlers.

benchmark/react/cases/003-hello-list/index.tsx (2)

16-35: Guard ref usage or assert lifecycle guarantees

Non-null assertion is fine if Lynx guarantees ref readiness before useEffect. If not guaranteed, use optional chaining to avoid crashes.

-    listRef.current!.invoke({
+    listRef.current?.invoke?.({

51-58: Add React key on list items

Even with item-key for Lynx, React reconciliation benefits from a key.

-          <list-item
+          <list-item
+            key={index}
             item-key={`${index}`}
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between b41d3b8 and 415f2ea.

📒 Files selected for processing (10)
  • benchmark/react/cases/002-hello-reactLynx/RecursiveText.tsx (1 hunks)
  • benchmark/react/cases/002-hello-reactLynx/index.tsx (1 hunks)
  • benchmark/react/cases/003-hello-list/index.tsx (1 hunks)
  • benchmark/react/lynx.config.js (1 hunks)
  • benchmark/react/package.json (1 hunks)
  • benchmark/react/rspeedy-env.d.ts (1 hunks)
  • benchmark/react/src/hook.ts (1 hunks)
  • benchmark/react/src/patchProfile.ts (1 hunks)
  • benchmark/react/src/patchUpdateListCallbacks.ts (1 hunks)
  • packages/lynx/benchx_cli/scripts/build.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-12T16:09:32.413Z
Learnt from: colinaaa
PR: lynx-family/lynx-stack#1497
File: packages/react/transform/tests/__swc_snapshots__/src/swc_plugin_snapshot/mod.rs/basic_full_static.js:9-10
Timestamp: 2025-08-12T16:09:32.413Z
Learning: In the Lynx stack, functions prefixed with `__` that are called in transformed code may be injected globally by the Lynx Engine at runtime rather than exported from the React runtime package. For example, `__CreateFrame` is injected globally by the Lynx Engine, not exported from lynx-js/react.

Applied to files:

  • benchmark/react/src/patchUpdateListCallbacks.ts
🧬 Code graph analysis (2)
benchmark/react/src/patchUpdateListCallbacks.ts (3)
packages/web-platform/web-constants/src/types/Element.ts (1)
  • ComponentAtIndexCallback (22-28)
packages/web-platform/web-mainthread-apis/src/pureElementPAPIs.ts (1)
  • __GetChildren (73-75)
benchmark/react/src/hook.ts (2)
  • PREFIX (18-18)
  • hook (5-16)
benchmark/react/rspeedy-env.d.ts (2)
packages/web-platform/web-constants/src/types/Element.ts (2)
  • ComponentAtIndexCallback (22-28)
  • EnqueueComponentCallback (30-34)
packages/web-platform/web-mainthread-apis/src/pureElementPAPIs.ts (1)
  • __GetChildren (73-75)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: build / Build (Ubuntu)
  • GitHub Check: build / Build (Windows)
  • GitHub Check: test-rust / Test (Ubuntu)
  • GitHub Check: CodeQL Analyze (javascript-typescript)
  • GitHub Check: CodeQL Analyze (actions)
🔇 Additional comments (8)
packages/lynx/benchx_cli/scripts/build.mjs (1)

33-33: Verified PICK_COMMIT exists upstream – commit 78493ae8581046275f6333ce16004666560ce058 is present and fetchable by CI.

benchmark/react/cases/002-hello-reactLynx/index.tsx (2)

12-12: LGTM: component extraction improves readability and reuse

Switching to clarifies intent and keeps the case file lean.


7-7: No changes needed: Node16 resolution supports explicit .js imports
Root tsconfig extends @tsconfig/node20, which sets "moduleResolution": "node16", and in TS’s Node16/NodeNext modes explicit .js specifiers are fully supported (npmjs.com, typescriptlang.org).

benchmark/react/package.json (1)

10-16: 003-hello-list target wiring verified
Entry “003-hello-list” is defined in benchmark/react/lynx.config.js and both dist/003-hello-list.lynx.bundle and .ptrace are produced as expected.

benchmark/react/rspeedy-env.d.ts (2)

25-30: Update list parameter to FiberElement in __UpdateListCallbacks
In benchmark/react/rspeedy-env.d.ts, change the list parameter from an array to a single FiberElement to match the runtime signature:

-declare function __UpdateListCallbacks(
-  list: FiberElement[],
+declare function __UpdateListCallbacks(
+  list: FiberElement,
   componentAtIndex: ComponentAtIndexCallback,
   enqueueComponent: EnqueueComponentCallback,
   componentAtIndexes: ComponentAtIndexesCallback,
 ): void;

32-39: Confirm ComponentAtIndexCallback return type

Upstream Element.ts may define this callback as returning void. Verify the engine ABI and, if it doesn’t actually return a number, update the signature in benchmark/react/rspeedy-env.d.ts (lines 32–39) to => number | undefined.

benchmark/react/lynx.config.js (1)

35-39: New 003-hello-list entry looks good

Order places patches before the case; aligns with intended instrumentation.

benchmark/react/src/patchUpdateListCallbacks.ts (1)

39-77: Guard hook registrations on target existence
Wrap the hook calls in existence checks to prevent calling an undefined old when the engine hasn’t injected these methods:

if (typeof (globalThis as any).__UpdateListCallbacks === 'function') {
  hook(
    globalThis as any,
    '__UpdateListCallbacks' as any,
    (old, list, componentAtIndex, enqueueComponent, componentAtIndexes) => {
      old!(
        list,
        withCodspeed(componentAtIndex),
        enqueueComponent,
        componentAtIndexes,
      );
    },
  );
}

if (typeof (globalThis as any).__CreateList === 'function') {
  hook(
    globalThis as any,
    '__CreateList' as any,
    (old, id, componentAtIndex, enqueueComponent, info, componentAtIndexes) => {
      return old!(
        id,
        withCodspeed(componentAtIndex),
        enqueueComponent,
        info,
        componentAtIndexes,
      );
    },
  );
}

Comment thread benchmark/react/rspeedy-env.d.ts Outdated
Comment thread benchmark/react/src/patchUpdateListCallbacks.ts
@hzy hzy requested a review from upupming September 2, 2025 14:06
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
benchmark/react/src/hook.ts (1)

18-18: Normalize path separators for cross‑platform robustness

If REPO_FILEPATH ever contains backslashes (Windows), split('/') will misparse. Normalize first.

Apply this diff:

-export const PREFIX = __REPO_FILEPATH__.split('/').slice(0, -2).join('/');
+export const PREFIX = __REPO_FILEPATH__.replace(/\\/g, '/').split('/').slice(0, -2).join('/');
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 415f2ea and dfcbd92.

📒 Files selected for processing (10)
  • benchmark/react/cases/002-hello-reactLynx/RecursiveText.tsx (1 hunks)
  • benchmark/react/cases/002-hello-reactLynx/index.tsx (1 hunks)
  • benchmark/react/cases/003-hello-list/index.tsx (1 hunks)
  • benchmark/react/lynx.config.js (1 hunks)
  • benchmark/react/package.json (1 hunks)
  • benchmark/react/rspeedy-env.d.ts (1 hunks)
  • benchmark/react/src/hook.ts (1 hunks)
  • benchmark/react/src/patchProfile.ts (1 hunks)
  • benchmark/react/src/patchUpdateListCallbacks.ts (1 hunks)
  • packages/lynx/benchx_cli/scripts/build.mjs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (9)
  • benchmark/react/cases/002-hello-reactLynx/index.tsx
  • benchmark/react/cases/002-hello-reactLynx/RecursiveText.tsx
  • benchmark/react/package.json
  • benchmark/react/cases/003-hello-list/index.tsx
  • benchmark/react/src/patchProfile.ts
  • packages/lynx/benchx_cli/scripts/build.mjs
  • benchmark/react/lynx.config.js
  • benchmark/react/rspeedy-env.d.ts
  • benchmark/react/src/patchUpdateListCallbacks.ts
🔇 Additional comments (2)
benchmark/react/src/hook.ts (2)

18-18: Shared PREFIX export looks good

Centralizing PREFIX here reduces drift across modules and simplifies future changes.


18-18: Declaration and imports verified
__REPO_FILEPATH__ is declared in rspeedy-env.d.ts, PREFIX is only exported from hook.ts, and all consumers import it from ./hook.js. No further action needed.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (3)
packages/lynx/benchx_cli/scripts/prepare.mjs (1)

5-13: Portability nit: avoid relying on /usr/bin/true

On some distros, /usr/bin/true may not exist (only /bin/true). Consider emitting a tiny POSIX stub and ensuring it’s executable. Example:

import { chmodSync, writeFileSync } from 'node:fs';

// ...
if (process.platform !== 'win32') {
  writeFileSync('./dist/bin/benchx_cli', '#!/bin/sh\nexit 0\n');
  chmodSync('./dist/bin/benchx_cli', 0o755);
}
benchmark/react/cases/003-hello-list/index.tsx (2)

14-35: Type the ref as nullable and drop the non-null assertion

Prevents potential runtime surprises and cleans up the effect.

-  const listRef = useRef<NodesRef>(null);
+  const listRef = useRef<NodesRef | null>(null);
   useEffect(() => {
-    listRef.current!.invoke({
+    const ref = listRef.current;
+    if (!ref) return;
+    ref.invoke({
       method: 'scrollToPosition',
       params: {
         position: 1,
         smooth: false,
       },
-      success: function() {
-        listRef.current!.invoke({
+      success: function() {
+        ref.invoke({
           method: 'scrollToPosition',
           params: {
             position: 2,
             smooth: false,
           },
           success: function() {
             setStopBenchmark(true);
           },
         }).exec();
       },
     }).exec();
   }, []);

51-58: Add React keys to list items

Prevents reconciliation warnings and keeps identity stable across updates.

-          <list-item
+          <list-item
+            key={index}
             item-key={`${index}`}
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between dfcbd92 and 3ec2001.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (10)
  • benchmark/react/cases/002-hello-reactLynx/RecursiveText.tsx (1 hunks)
  • benchmark/react/cases/002-hello-reactLynx/index.tsx (1 hunks)
  • benchmark/react/cases/003-hello-list/index.tsx (1 hunks)
  • benchmark/react/lynx.config.js (1 hunks)
  • benchmark/react/package.json (2 hunks)
  • benchmark/react/src/hook.ts (1 hunks)
  • benchmark/react/src/patchProfile.ts (1 hunks)
  • benchmark/react/src/patchUpdateListCallbacks.ts (1 hunks)
  • packages/lynx/benchx_cli/scripts/build.mjs (1 hunks)
  • packages/lynx/benchx_cli/scripts/prepare.mjs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (7)
  • benchmark/react/src/hook.ts
  • benchmark/react/cases/002-hello-reactLynx/RecursiveText.tsx
  • benchmark/react/src/patchProfile.ts
  • packages/lynx/benchx_cli/scripts/build.mjs
  • benchmark/react/cases/002-hello-reactLynx/index.tsx
  • benchmark/react/lynx.config.js
  • benchmark/react/src/patchUpdateListCallbacks.ts
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-27T08:10:09.932Z
Learnt from: colinaaa
PR: lynx-family/lynx-stack#1612
File: packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/tsconfig.json:3-13
Timestamp: 2025-08-27T08:10:09.932Z
Learning: In the lynx-family/lynx-stack repository, Rspeedy templates use `lynx-js/rspeedy/client` types via `rspeedy-env.d.ts` instead of `vite/client` types. Rspeedy provides its own client-side environment type definitions and doesn't require direct Vite type references.

Applied to files:

  • benchmark/react/package.json
🔇 Additional comments (5)
packages/lynx/benchx_cli/scripts/prepare.mjs (1)

9-13: Idempotence guard looks good

Skipping when the target already exists prevents needless overwrites and helps cacheable CI steps.

benchmark/react/cases/003-hello-list/index.tsx (1)

15-35: Consider useLayoutEffect for deterministic pre-paint scrolling (bench stability)

If you need scrolls to occur before first paint for consistent traces, switch to useLayoutEffect.

Do you want me to patch this now or keep useEffect for post-paint behavior?

benchmark/react/package.json (3)

10-10: Scripts align with DOM id contract

The wait-for-id matches the component’s id toggle; perfetto entries mirror bench entries. LGTM.

Also applies to: 16-17


10-10: 003-hello-list target is configured in lynx.config.js
lynx.config.js defines a 003-hello-list entry pointing to ./cases/003-hello-list/index.tsx, so dist/003-hello-list.lynx.bundle will be generated.


31-31: No runtime imports detected; keep as devDependency
Search across TS, TSX, JS, and JSX found no non-import type usage of @lynx-js/type-element-api in benchmark/react.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants