-
Notifications
You must be signed in to change notification settings - Fork 57
feat: add lynx frame examples #155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pilipala195
wants to merge
1
commit into
lynx-family:main
Choose a base branch
from
pilipala195:p/pilipala195/lynx_frame
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@lynx-example/frame": minor | ||
| --- | ||
|
|
||
| Feature: Add lynx frame example. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| ## Rspeedy project | ||
|
|
||
| This is a ReactLynx project bootstrapped with `create-rspeedy`. | ||
|
|
||
| ## Getting Started | ||
|
|
||
| First, install the dependencies: | ||
|
|
||
| ```bash | ||
| pnpm install | ||
| ``` | ||
|
|
||
| Then, run the development server: | ||
|
|
||
| ```bash | ||
| pnpm run dev | ||
| ``` | ||
|
|
||
| Scan the QRCode in the terminal with your LynxExplorer App to see the result. | ||
|
|
||
| You can start editing the page by modifying `src/App.tsx`. The page auto-updates as you edit the file. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import { defineConfig } from "@lynx-js/rspeedy"; | ||
|
|
||
| import { pluginQRCode } from "@lynx-js/qrcode-rsbuild-plugin"; | ||
| import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin"; | ||
| import { pluginTypeCheck } from "@rsbuild/plugin-type-check"; | ||
|
|
||
| export default defineConfig({ | ||
| source: { | ||
| entry: { | ||
| frame: "./src/frame/index.tsx", | ||
| in_frame: "./src/in_frame/index.tsx", | ||
| }, | ||
| }, | ||
| plugins: [ | ||
| pluginQRCode(), | ||
| pluginReactLynx(), | ||
| pluginTypeCheck(), | ||
| ], | ||
| output: { | ||
| assetPrefix: "https://lynxjs.org/lynx-examples/frame/dist", | ||
| }, | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| { | ||
| "name": "@lynx-example/frame", | ||
| "version": "0.1.0", | ||
| "type": "module", | ||
| "scripts": { | ||
| "build": "rspeedy build", | ||
| "dev": "rspeedy dev", | ||
| "preview": "rspeedy preview" | ||
| }, | ||
| "dependencies": { | ||
| "@lynx-js/react": "^0.112.5" | ||
| }, | ||
| "devDependencies": { | ||
| "@lynx-js/preact-devtools": "^5.0.1-6664329", | ||
| "@lynx-js/qrcode-rsbuild-plugin": "^0.4.1", | ||
| "@lynx-js/react-rsbuild-plugin": "^0.10.13", | ||
| "@lynx-js/rspeedy": "^0.11.0", | ||
| "@lynx-js/types": "3.4.11", | ||
| "@rsbuild/plugin-type-check": "1.2.4", | ||
| "@types/react": "^18.3.23", | ||
| "typescript": "~5.9.2" | ||
| }, | ||
| "engines": { | ||
| "node": ">=18" | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| // Copyright 2025 The Lynx Authors. All rights reserved. | ||
| // Licensed under the Apache License Version 2.0 that can be found in the | ||
| // LICENSE file in the root directory of this source tree. | ||
|
|
||
| import "@lynx-js/preact-devtools"; | ||
| import "@lynx-js/react/debug"; | ||
| import { root } from "@lynx-js/react"; | ||
|
|
||
| const App = () => { | ||
| return ( | ||
| <view> | ||
| <text style={{ fontSize: "20px", color: "black", padding: "10px" }}> | ||
| Below is the inline text example in frame page. | ||
| </text> | ||
| {/* @ts-ignore */} | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of |
||
| <frame | ||
| style={{ width: "100%", height: "300px", border: "3px solid red" }} | ||
| src="https://lynxjs.org/lynx-examples/text/dist/inline_text.lynx.bundle" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why |
||
| > | ||
| {/* @ts-ignore */} | ||
| </frame> | ||
| </view> | ||
| ); | ||
| }; | ||
|
|
||
| root.render(<App />); | ||
|
|
||
| if (import.meta.webpackHot) { | ||
| import.meta.webpackHot.accept(); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| // Copyright 2025 The Lynx Authors. All rights reserved. | ||
| // Licensed under the Apache License Version 2.0 that can be found in the | ||
| // LICENSE file in the root directory of this source tree. | ||
|
|
||
| import "@lynx-js/preact-devtools"; | ||
| import "@lynx-js/react/debug"; | ||
| import { root } from "@lynx-js/react"; | ||
|
|
||
| const App = () => { | ||
| return ( | ||
| <view> | ||
| <text | ||
| style={{ | ||
| fontSize: "20px", | ||
| color: "black", | ||
| padding: "10px", | ||
| border: "3px solid red", | ||
| }} | ||
| > | ||
| Hello I'm in frame page! | ||
| </text> | ||
| </view> | ||
| ); | ||
| }; | ||
|
|
||
| root.render(<App />); | ||
|
|
||
| if (import.meta.webpackHot) { | ||
| import.meta.webpackHot.accept(); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| /// <reference types="@lynx-js/rspeedy/client" /> | ||
|
|
||
| declare module "@lynx-js/types" { | ||
| // eslint-disable-next-line @typescript-eslint/no-empty-object-type | ||
| interface GlobalProps { | ||
| /** | ||
| * Define your global properties in this interface. | ||
| * These types will be accessible through `lynx.__globalProps`. | ||
| */ | ||
| } | ||
| } | ||
|
|
||
| // This export makes the file a module | ||
| export {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "extends": "../tsconfig.json", | ||
| "compilerOptions": { | ||
| "composite": true, | ||
|
|
||
| "jsx": "react-jsx", | ||
| "jsxImportSource": "@lynx-js/react", | ||
|
|
||
| "module": "ESNext", | ||
| "moduleResolution": "Bundler", | ||
|
|
||
| "noEmit": true, | ||
| }, | ||
| "include": ["./**/*.ts", "./**/*.tsx"], | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "strict": true, | ||
| "isolatedModules": true, | ||
| "verbatimModuleSyntax": true, | ||
|
|
||
| "esModuleInterop": true, | ||
| "skipLibCheck": true, | ||
| }, | ||
| "references": [ | ||
| { "path": "./tsconfig.node.json" }, | ||
| { "path": "./src" }, | ||
| ], | ||
| "files": [], | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| { | ||
| "extends": "./tsconfig.json", | ||
| "compilerOptions": { | ||
| "composite": true, | ||
|
|
||
| // Rspeedy uses Node.js's module resolution | ||
| "module": "node16", | ||
| "moduleResolution": "node16", | ||
| "erasableSyntaxOnly": true, | ||
|
|
||
| // Node.js 18+ | ||
| "lib": ["es2023"], | ||
| "target": "es2022", | ||
|
|
||
| "noEmit": true | ||
| }, | ||
| "include": ["./lynx.config.ts"] | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please catalogs just like other examples do.