feat(performance-api): add new entry components#133
feat(performance-api): add new entry components#133colinaaa merged 8 commits intolynx-family:mainfrom
Conversation
🦋 Changeset detectedLatest commit: f69068f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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.
f6da444 to
6d03e90
Compare
| "@lynx-js/react-rsbuild-plugin": "catalog:", | ||
| "@lynx-js/rspeedy": "catalog:", | ||
| "@lynx-js/types": "^3.3.0", | ||
| "@lynx-js/types": "^3.3.2", |
There was a problem hiding this comment.
We will upgrade @lynx-js/types in the repo together. As you can see in #132
There was a problem hiding this comment.
OK, after the version is upgraded, I will rebase.
| const [lazyBundleEntry, setLazyBundleEntry] = useState<string>(""); | ||
| const [entryName, setEntryName] = useState<string>("Waiting..."); | ||
|
|
||
| useMemo(() => { |
There was a problem hiding this comment.
I don't think we need to use useMemo now. Use useEffect instead.
- It doesn't match the React semantic. The
lynx.performance.createObservershould be an effect useEffectwill be executed before hydrate, which should be early enough.
There was a problem hiding this comment.
You are right, I'll edit it.
| const [pipelineEntry, setPipelineEntry] = useState<string>(""); | ||
| const [hostPlatformTiming, setHostPlatformTiming] = useState<string>(""); | ||
|
|
||
| useMemo(() => { |
| import { ScrollItem } from "../common/ScrollItem/index.jsx"; | ||
| import "./index.scss"; | ||
|
|
||
| export default function PipelineEntryExample(this: any) { |
There was a problem hiding this comment.
What does the this and any for?
| const [pipelineEntry, setPipelineEntry] = useState<string>(""); | ||
| const [entryName, setEntryName] = useState<string>("pending"); | ||
|
|
||
| useMemo(() => { |
| @@ -0,0 +1,48 @@ | |||
| import * as React from "@lynx-js/react"; | |||
There was a problem hiding this comment.
What does this React use for?
| import * as React from "@lynx-js/react"; |
| import { ScrollItem } from "../common/ScrollItem/index.jsx"; | ||
| import "./index.scss"; | ||
|
|
||
| export default function LazyBundleEntryExample(this: any) { |
| @@ -0,0 +1,41 @@ | |||
| const MyLazyBundle = lazy(() => import("./MyLazyBundle.jsx")); | |||
There was a problem hiding this comment.
Please put any statements after imports.
| @@ -0,0 +1,50 @@ | |||
| import * as React from "@lynx-js/react"; | |||
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
…platform_timing_t
…platform_timing_t
… 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", |
There was a problem hiding this comment.
Can we use the same naming convention with other entry?
Signed-off-by: Qingyu Wang <40660121+colinaaa@users.noreply.github.com>
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.