Skip to content

feat(performance-api): add new entry components#133

Merged
colinaaa merged 8 commits intolynx-family:mainfrom
Tamerlx:p/limeng.amer/host_platform_timing_t
Aug 28, 2025
Merged

feat(performance-api): add new entry components#133
colinaaa merged 8 commits intolynx-family:mainfrom
Tamerlx:p/limeng.amer/host_platform_timing_t

Conversation

@Tamerlx
Copy link
Copy Markdown
Contributor

@Tamerlx Tamerlx commented Aug 21, 2025

  • Add new entry components for HostPlatformTiming, LazyBundleEntry, PipelineEntry, and ReloadBundleEntry with their corresponding styles and functionality.
  • Remove deprecated tti_entry and pipeline_entry components.
  • Update @lynx-js/types dependency to version 3.3.2 and modify lynx.config.mjs to reflect new entry points.

The changes introduce new performance monitoring capabilities and improve the structure of the performance API examples. The removed components were outdated and replaced with more comprehensive implementations.

@Tamerlx Tamerlx requested a review from colinaaa as a code owner August 21, 2025 05:24
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Aug 21, 2025

🦋 Changeset detected

Latest commit: f69068f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@lynx-example/performance-api Patch

Not sure what this means? Click here to learn what changesets are.

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

- Add new entry components for HostPlatformTiming, LazyBundleEntry, PipelineEntry, and ReloadBundleEntry with their corresponding styles and functionality.
- Remove deprecated tti_entry and pipeline_entry components.
- Update @lynx-js/types dependency to version 3.3.2 and modify lynx.config.mjs to reflect new entry points.

The changes introduce new performance monitoring capabilities and improve the structure of the performance API examples. The removed components were outdated and replaced with more comprehensive implementations.
@Tamerlx Tamerlx force-pushed the p/limeng.amer/host_platform_timing_t branch from f6da444 to 6d03e90 Compare August 21, 2025 05:28
Comment thread examples/performance-api/package.json Outdated
"@lynx-js/react-rsbuild-plugin": "catalog:",
"@lynx-js/rspeedy": "catalog:",
"@lynx-js/types": "^3.3.0",
"@lynx-js/types": "^3.3.2",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We will upgrade @lynx-js/types in the repo together. As you can see in #132

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ok

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

OK, after the version is upgraded, I will rebase.

const [lazyBundleEntry, setLazyBundleEntry] = useState<string>("");
const [entryName, setEntryName] = useState<string>("Waiting...");

useMemo(() => {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think we need to use useMemo now. Use useEffect instead.

  1. It doesn't match the React semantic. The lynx.performance.createObserver should be an effect
  2. useEffect will be executed before hydrate, which should be early enough.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You are right, I'll edit it.

const [pipelineEntry, setPipelineEntry] = useState<string>("");
const [hostPlatformTiming, setHostPlatformTiming] = useState<string>("");

useMemo(() => {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ditto.

import { ScrollItem } from "../common/ScrollItem/index.jsx";
import "./index.scss";

export default function PipelineEntryExample(this: any) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What does the this and any for?

Comment thread examples/performance-api/src/HostPlatformTiming/index.tsx
const [pipelineEntry, setPipelineEntry] = useState<string>("");
const [entryName, setEntryName] = useState<string>("pending");

useMemo(() => {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ditto.

@@ -0,0 +1,48 @@
import * as React from "@lynx-js/react";
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What does this React use for?

Suggested change
import * as React from "@lynx-js/react";

import { ScrollItem } from "../common/ScrollItem/index.jsx";
import "./index.scss";

export default function LazyBundleEntryExample(this: any) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ditto.

@@ -0,0 +1,41 @@
const MyLazyBundle = lazy(() => import("./MyLazyBundle.jsx"));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please put any statements after imports.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

DONE

@@ -0,0 +1,50 @@
import * as React from "@lynx-js/react";
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ditto.

The change replaces useMemo with useEffect for side effects in performance observer setup since useEffect is more appropriate for this use case. Also removes unnecessary React imports and 'this' parameter from function components.
Improve code organization by grouping imports together and moving lazy component declaration after imports
… name

remove unused useCallback and useMemo imports from LazyBundleEntry
rename LoadBundleEntryExample to ReloadBundleEntryExample for consistency
clean up unused types dependency in pnpm-lock.yaml
PipelineEntry: "./src/PipelineEntry/index.tsx",
HostPlatformTiming: "./src/HostPlatformTiming/index.tsx",
ReloadBundleEntry: "./src/ReloadBundleEntry/index.tsx",
LazyBundleEntry: "./src/LazyBundleEntry/index.tsx",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we use the same naming convention with other entry?

Signed-off-by: Qingyu Wang <40660121+colinaaa@users.noreply.github.com>
@colinaaa colinaaa changed the title feat(performance-api): add new entry components and update dependencies feat(performance-api): add new entry components Aug 28, 2025
@colinaaa colinaaa merged commit c952442 into lynx-family:main Aug 28, 2025
2 checks passed
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