Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/all-crabs-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@lynx-js/testing-environment': patch
---

Add `__RemoveGestureDetector` PAPI binding
6 changes: 6 additions & 0 deletions .changeset/easy-waves-pump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@lynx-js/react-webpack-plugin": patch
"@lynx-js/react-rsbuild-plugin": patch
---

Support rstest for testing library using a dedicated testing loader.
5 changes: 5 additions & 0 deletions .changeset/fair-horses-worry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@lynx-js/react': patch
---

Remove stale gestures when gestures are removed
11 changes: 11 additions & 0 deletions .changeset/fair-plums-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@lynx-js/testing-environment": minor
---

**BREAKING CHANGE**:

Align the public test-environment API around `LynxEnv`.

`LynxTestingEnv` now expects a `{ window }`-shaped environment instead of relying on a concrete `JSDOM` instance or `global.jsdom`. Callers that construct `LynxTestingEnv` manually or initialize the environment through globals should migrate to `new LynxTestingEnv({ window })` or set `global.lynxEnv`.

This release also adds the `@lynx-js/testing-environment/env/rstest` entry for running the shared testing-environment suite under rstest.
5 changes: 5 additions & 0 deletions .changeset/metal-carrots-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@lynx-js/react": patch
---

refactor: set state of suspense to render fallback
3 changes: 3 additions & 0 deletions .changeset/mighty-buckets-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---

---
5 changes: 5 additions & 0 deletions .changeset/ninety-pants-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-rspeedy": patch
---

Add Rstest ReactLynx Testing Library template.
26 changes: 26 additions & 0 deletions .changeset/red-lamps-arrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
"@lynx-js/react": patch
---

Support rstest for testing library, you can use rstest with RLTL now:

Create a config file `rstest.config.ts` with the following content:

```ts
import { defineConfig } from '@rstest/core';
import { withLynxConfig } from '@lynx-js/react/testing-library/rstest-config';

export default defineConfig({
extends: withLynxConfig(),
});
```

`@lynx-js/react/testing-library/rstest-config` will automatically load your `lynx.config.ts` and apply the same configuration to rstest, so you can keep your test environment consistent with your development environment.

And then use rstest as usual:

```bash
$ rstest
```

For more usage detail, see https://rstest.rs/
5 changes: 5 additions & 0 deletions .changeset/refactor-weakref-webcore.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@lynx-js/web-core": patch
---

refactor: with WeakRef in element APIs and WASM bindings to improve memory management.
9 changes: 9 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,15 @@ jobs:
pnpm run build --mode development
pnpm run lint
pnpm run test
cd `mktemp -d`
npx --registry http://localhost:4873 create-rspeedy-canary@latest --template react --dir create-rspeedy-regression-rstest-rltl --tools eslint,rstest-rltl
cd create-rspeedy-regression-rstest-rltl
npx --registry http://localhost:4873 upgrade-rspeedy-canary@latest
pnpm install --registry=http://localhost:4873
pnpm run build
pnpm run build --mode development
pnpm run lint
pnpm run test
test-react:
needs: build
uses: ./.github/workflows/workflow-test.yml
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Thanks to:
- [Preact](https://preactjs.com/) for creating a lightweight and efficient UI library that served as a foundation for the ReactLynx project.
- [React](https://react.dev/) for creating a comprehensive and intuitive library for building user interfaces that inspires the programming model of Lynx.
- [React Native](https://reactnative.dev/) for groundbreaking work in allowing developers to create truly native apps using JavaScript and React.
- [Rspack](https://rspack.dev/) for providing a fast and flexible build tool that has significantly enhanced the build performance of Lynx projects.
- [Rspack](https://rspack.rs/) for providing a fast and flexible build tool that has significantly enhanced the build performance of Lynx projects.
- [React Native for Web](https://necolas.github.io/react-native-web/) project for inspiring the Lynx for Web project, motivating our architectural design with its accessible implementation and interoperability with React DOM.
- [SWC](https://github.com/swc-project/swc) project created by [@kdy1](https://github.com/kdy1), which turbocharges ReactLynx's code transformation with Rust-powered efficiency, achieving sub-second build times and frictionless developer experience.

Expand Down
26 changes: 26 additions & 0 deletions examples/gesture/lynx.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { pluginQRCode } from '@lynx-js/qrcode-rsbuild-plugin';
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin';
import { defineConfig } from '@lynx-js/rspeedy';

const enableBundleAnalysis = !!process.env['RSPEEDY_BUNDLE_ANALYSIS'];

export default defineConfig({
plugins: [
pluginReactLynx({
enableNewGesture: true,
}),
pluginQRCode({
schema(url) {
return `${url}?fullscreen=true`;
},
}),
],
environments: {
web: {},
lynx: {
performance: {
profile: enableBundleAnalysis,
},
},
},
});
23 changes: 23 additions & 0 deletions examples/gesture/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "@lynx-js/example-gesture",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"build": "rspeedy build",
"dev": "rspeedy dev",
"test:type": "tsc --noEmit"
},
"dependencies": {
"@lynx-js/gesture-runtime": "workspace:*",
"@lynx-js/react": "workspace:*"
},
"devDependencies": {
"@lynx-js/preact-devtools": "^5.0.1",
"@lynx-js/qrcode-rsbuild-plugin": "workspace:*",
"@lynx-js/react-rsbuild-plugin": "workspace:*",
"@lynx-js/rspeedy": "workspace:*",
"@lynx-js/types": "3.7.0",
"@types/react": "^18.3.28"
}
}
105 changes: 105 additions & 0 deletions examples/gesture/src/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
:root {
--bg: #0a1022;
--card: #141e3d;
--card-border: #2a3765;
--text: #eaf0ff;
--text-dim: #9fb0de;
--button: #22315f;
--button-active: #3c5df6;
--box-a: #ff8b3d;
--box-b: #28c6a5;
--box-off: #6f7b9f;
}

page {
background-color: var(--bg);
}

.Root {
min-height: 100vh;
padding: 36rpx 24rpx;
box-sizing: border-box;
align-items: center;
justify-content: center;
}

.Card {
width: 100%;
max-width: 680rpx;
padding: 28rpx;
border-radius: 24rpx;
background: var(--card);
border: 2rpx solid var(--card-border);
gap: 20rpx;
}

.Title {
color: var(--text);
font-size: 44rpx;
font-weight: 700;
}

.Description {
color: var(--text-dim);
font-size: 28rpx;
line-height: 38rpx;
}

.Controls {
flex-direction: column;
gap: 14rpx;
}

.Button {
border-radius: 16rpx;
background: var(--button);
padding: 16rpx 20rpx;
}

.Button--active {
background: var(--button-active);
}

.ButtonText {
color: #ffffff;
font-size: 28rpx;
font-weight: 600;
}

.ModeText {
color: var(--text);
font-size: 27rpx;
}

.Stage {
margin-top: 8rpx;
height: 560rpx;
border-radius: 18rpx;
border: 2rpx dashed #4e5e97;
align-items: center;
justify-content: center;
overflow: hidden;
}

.DragBox {
width: 160rpx;
height: 160rpx;
border-radius: 24rpx;
background: var(--box-a);
align-items: center;
justify-content: center;
}

.DragBox--diff {
background: var(--box-b);
}

.DragBox--removed {
background: var(--box-off);
}

.DragBoxText {
color: #111827;
font-size: 34rpx;
font-weight: 800;
}
Loading
Loading