Skip to content

Conversation

@partholon
Copy link

add LazyBundleEntry and ReloadBundleEntry demo

remove useless tti demo

@changeset-bot
Copy link

changeset-bot bot commented Jul 10, 2025

⚠️ No Changeset found

Latest commit: 3c7b4e8

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

@colinaaa
Copy link
Collaborator

bugbot run

1 similar comment
@colinaaa
Copy link
Collaborator

bugbot run

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: Hook Misuse: `useMemo` for Side Effects

The useLynxPerformanceObserver hook incorrectly uses useMemo for side effects, such as creating and managing PerformanceObserver instances. This violates React's rules of hooks, as useMemo is for memoization and its execution for side effects is unpredictable. This logic should be moved to useEffect. Additionally, the directive string "background only" should be "background-only".

examples/performance-api/src/common/utils.tsx#L4-L17

export function useLynxPerformanceObserver(eventTypes: string[], callback: PerformanceCallback): void {
"background only";
const previousArgsRef = useRef<[PerformanceObserver]>();
useMemo(() => {
if (previousArgsRef.current) {
const [observer] = previousArgsRef.current;
observer.disconnect();
}
const newObserver = lynx.performance.createObserver(callback);
newObserver.observe(eventTypes);
previousArgsRef.current = [newObserver];
}, [eventTypes, callback]);

Fix in CursorFix in Web


BugBot free trial expires on July 22, 2025
You have used $0.00 of your $0.00 spend limit so far. Manage your spend limit in the Cursor dashboard.

Was this report helpful? Give feedback by reacting with 👍 or 👎

@partholon partholon force-pushed the p/zhangkaijie.9/performance-update branch 2 times, most recently from 4cda3a8 to f4b2711 Compare July 16, 2025 10:08
@partholon partholon force-pushed the p/zhangkaijie.9/performance-update branch from f4b2711 to 3c7b4e8 Compare July 16, 2025 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants