Skip to content

feat(web): builtinTagTransformMap add input for x-input#1907

Merged
Sherry-hue merged 1 commit intolynx-family:mainfrom
Sherry-hue:feat/web-builtin-input
Oct 30, 2025
Merged

feat(web): builtinTagTransformMap add input for x-input#1907
Sherry-hue merged 1 commit intolynx-family:mainfrom
Sherry-hue:feat/web-builtin-input

Conversation

@Sherry-hue
Copy link
Copy Markdown
Collaborator

@Sherry-hue Sherry-hue commented Oct 30, 2025

Summary by CodeRabbit

Release Notes

  • New Features

    • Added support for input element transformation to the x-input component.
  • Tests

    • Added test coverage for input element binding behavior.
  • Chores

    • Updated patch versions for core packages.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).
  • Changeset added, and when a BREAKING CHANGE occurs, it needs to be clearly marked (or not required).

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Oct 30, 2025

🦋 Changeset detected

Latest commit: b8d73e6

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

This PR includes changesets to release 9 packages
Name Type
@lynx-js/web-core-server Patch
@lynx-js/web-core Patch
@lynx-js/web-explorer Patch
@lynx-js/web-rsbuild-server-middleware Patch
@lynx-js/web-constants Patch
@lynx-js/web-mainthread-apis Patch
@lynx-js/web-worker-rpc Patch
@lynx-js/web-worker-runtime Patch
@lynx-js/web-style-transformer 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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Oct 30, 2025

📝 Walkthrough

Walkthrough

This pull request introduces HTML input element support by mapping the 'input' tag to 'x-input' in the tag transformation system across web-core-server and web-core packages, with corresponding test coverage for input binding behavior.

Changes

Cohort / File(s) Summary
Changeset and version management
.changeset/seven-coats-appear.md
Introduces patch version increments for three packages: @lynx-js/web-core-server, @lynx-js/web-core, and @lynx-js/web-explorer.
Tag transformation mapping implementation
packages/web-platform/web-core-server/src/createLynxView.ts, packages/web-platform/web-core/src/apis/LynxView.ts
Adds 'input' -> 'x-input' mapping to builtinTagTransformMap and internal tag map to enable input element transformation to x-input.
Test coverage
packages/web-platform/web-tests/tests/react.spec.ts, packages/web-platform/web-tests/tests/react/basic-element-input-bindinput/index.jsx
Adds new test case basic-element-input-bindinput with React component that validates input binding behavior including value, cursor position, and text length assertions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10–15 minutes

  • Changes follow a consistent pattern (same mapping applied to multiple files)
  • Test duplication logic is straightforward and mirrors existing test patterns
  • No complex logic or structural modifications involved

Suggested reviewers

  • HuJean

Poem

🐰 A little bunny hops with glee,
Input tags now transform so free,
To 'x-input' they swiftly leap,
Through tests that validation keep,
Patch versions climb, the feature's deep! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "feat(web): builtinTagTransformMap add input for x-input" accurately and specifically describes the main change across the entire changeset. The title directly captures the primary objective of adding a mapping from 'input' to 'x-input' in the builtinTagTransformMap, which is reflected in changes to createLynxView.ts, LynxView.ts, along with corresponding test additions and a changeset file. The title is concise, clear, and follows conventional commit format, making it easy for reviewers scanning the history to understand the core contribution at a glance.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/web-platform/web-tests/tests/react/basic-element-input-bindinput/index.jsx (1)

25-25: Consider: selectionStart used twice in result string.

Line 25 uses selectionStart twice instead of using both selectionStart and selectionEnd. This matches the existing x-input test behavior (as shown in the relevant code snippets), so it's consistent with the current test suite. However, if the intent is to display both selection boundaries, consider using ${value}-${selectionStart}-${selectionEnd} instead.

Note: This would require updating both this test and the corresponding x-input test for consistency.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b736b6e and b8d73e6.

📒 Files selected for processing (5)
  • .changeset/seven-coats-appear.md (1 hunks)
  • packages/web-platform/web-core-server/src/createLynxView.ts (1 hunks)
  • packages/web-platform/web-core/src/apis/LynxView.ts (1 hunks)
  • packages/web-platform/web-tests/tests/react.spec.ts (1 hunks)
  • packages/web-platform/web-tests/tests/react/basic-element-input-bindinput/index.jsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
.changeset/*.md

📄 CodeRabbit inference engine (AGENTS.md)

For contributions, generate and commit a Changeset describing your changes

Files:

  • .changeset/seven-coats-appear.md
🧠 Learnings (6)
📚 Learning: 2025-09-12T09:43:04.847Z
Learnt from: gaoachao
PR: lynx-family/lynx-stack#1736
File: .changeset/spotty-experts-smoke.md:1-3
Timestamp: 2025-09-12T09:43:04.847Z
Learning: In the lynx-family/lynx-stack repository, empty changeset files (containing only `---\n\n---`) are used for internal changes that modify src/** files but don't require meaningful release notes, such as private package changes or testing-only modifications. This satisfies CI requirements without generating user-facing release notes.

Applied to files:

  • .changeset/seven-coats-appear.md
  • packages/web-platform/web-core/src/apis/LynxView.ts
📚 Learning: 2025-09-12T09:43:04.847Z
Learnt from: gaoachao
PR: lynx-family/lynx-stack#1736
File: .changeset/spotty-experts-smoke.md:1-3
Timestamp: 2025-09-12T09:43:04.847Z
Learning: In the lynx-family/lynx-stack repository, private packages (marked with "private": true in package.json) like lynx-js/react-transform don't require meaningful changeset entries even when their public APIs change, since they are not published externally and only affect internal development.

Applied to files:

  • .changeset/seven-coats-appear.md
  • packages/web-platform/web-core-server/src/createLynxView.ts
  • packages/web-platform/web-core/src/apis/LynxView.ts
📚 Learning: 2025-07-22T09:23:07.797Z
Learnt from: colinaaa
PR: lynx-family/lynx-stack#1330
File: .changeset/olive-animals-attend.md:1-3
Timestamp: 2025-07-22T09:23:07.797Z
Learning: In the lynx-family/lynx-stack repository, changesets are only required for meaningful changes to end-users such as bugfixes and features. Internal/development changes like chores, refactoring, or removing debug info do not need changeset entries.

Applied to files:

  • .changeset/seven-coats-appear.md
📚 Learning: 2025-07-22T09:26:16.722Z
Learnt from: colinaaa
PR: lynx-family/lynx-stack#1330
File: .changeset/olive-animals-attend.md:1-3
Timestamp: 2025-07-22T09:26:16.722Z
Learning: In the lynx-family/lynx-stack repository, CI checks require changesets when files matching the pattern "src/**" are modified (as configured in .changeset/config.json). For internal changes that don't need meaningful changesets, an empty changeset file is used to satisfy the CI requirement while not generating any release notes.

Applied to files:

  • .changeset/seven-coats-appear.md
📚 Learning: 2025-08-19T11:25:36.127Z
Learnt from: colinaaa
PR: lynx-family/lynx-stack#1558
File: .changeset/solid-squids-fall.md:2-2
Timestamp: 2025-08-19T11:25:36.127Z
Learning: In the lynx-family/lynx-stack repository, changesets should use the exact package name from package.json#name, not generic or unscoped names. Each package has its own specific scoped name (e.g., "lynx-js/react-transform" for packages/react/transform).

Applied to files:

  • .changeset/seven-coats-appear.md
📚 Learning: 2025-10-11T06:16:12.517Z
Learnt from: Sherry-hue
PR: lynx-family/lynx-stack#1820
File: packages/web-platform/web-tests/tests/react.spec.ts:834-856
Timestamp: 2025-10-11T06:16:12.517Z
Learning: In packages/web-platform/web-tests/tests/react.spec.ts, the tests `basic-bindmouse` and `basic-mts-bindtouchstart` are NOT duplicates despite having similar test structures. They test different event types: `basic-bindmouse` validates mouse events (mousedown, mouseup, mousemove) with mouse-specific properties (button, buttons, x, y, pageX, pageY, clientX, clientY), while `basic-mts-bindtouchstart` validates touch events (touchstart) with touch arrays (touches, targetTouches, changedTouches). The similar test structure is coincidental and follows testing conventions.

Applied to files:

  • packages/web-platform/web-tests/tests/react.spec.ts
  • packages/web-platform/web-tests/tests/react/basic-element-input-bindinput/index.jsx
🧬 Code graph analysis (2)
packages/web-platform/web-tests/tests/react.spec.ts (1)
packages/web-platform/web-tests/tests/react/basic-element-input-bindinput/index.jsx (1)
  • result (8-8)
packages/web-platform/web-tests/tests/react/basic-element-input-bindinput/index.jsx (1)
packages/web-platform/web-tests/tests/react/basic-element-x-input-bindinput/index.jsx (1)
  • App (6-40)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: build / Build (Windows)
  • GitHub Check: build / Build (Ubuntu)
  • GitHub Check: test-rust / Test (Ubuntu)
🔇 Additional comments (5)
packages/web-platform/web-core-server/src/createLynxView.ts (1)

84-84: LGTM! Consistent mapping addition.

The 'input': 'x-input' mapping follows the established pattern for tag transformations and enables proper server-side rendering of input elements.

packages/web-platform/web-core/src/apis/LynxView.ts (1)

423-423: LGTM! Client-side mapping completes the feature.

The 'input': 'x-input' mapping in the client-side tagMap mirrors the server-side change, ensuring consistent input element rendering across both contexts.

.changeset/seven-coats-appear.md (1)

1-7: LGTM! Changeset properly documents the feature.

The changeset appropriately bumps patch versions for the affected packages and clearly describes the input-to-x-input transformation feature.

packages/web-platform/web-tests/tests/react.spec.ts (1)

3006-3015: LGTM! Test validates input-to-x-input transformation.

The new test appropriately verifies that plain input elements now behave identically to x-input elements through the tag transformation mapping. The test structure correctly mirrors the existing x-input test to ensure feature parity.

packages/web-platform/web-tests/tests/react/basic-element-input-bindinput/index.jsx (1)

30-34: LGTM! Input element properly configured for bindinput test.

The plain input element correctly uses the bindinput handler and initial value, validating that the input-to-x-input transformation enables the expected behavior.

@codecov
Copy link
Copy Markdown

codecov bot commented Oct 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Oct 30, 2025

CodSpeed Performance Report

Merging #1907 will degrade performances by 8.76%

Comparing Sherry-hue:feat/web-builtin-input (b8d73e6) with main (b736b6e)

Summary

❌ 2 regressions
✅ 60 untouched
⏩ 3 skipped1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
basic-performance-nest-level-100 6.5 ms 7.1 ms -8.76%
basic-performance-small-css 6.9 ms 7.4 ms -5.94%

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@relativeci
Copy link
Copy Markdown

relativeci bot commented Oct 30, 2025

React Example

#6039 Bundle Size — 237.5KiB (0%).

b8d73e6(current) vs b736b6e main#6035(baseline)

Bundle metrics  no changes
                 Current
#6039
     Baseline
#6035
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
No change  Cache Invalidation 0% 0%
No change  Chunks 0 0
No change  Assets 4 4
No change  Modules 165 165
No change  Duplicate Modules 67 67
No change  Duplicate Code 46.77% 46.77%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#6039
     Baseline
#6035
No change  IMG 145.76KiB 145.76KiB
No change  Other 91.74KiB 91.74KiB

Bundle analysis reportBranch Sherry-hue:feat/web-builtin-inpu...Project dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci bot commented Oct 30, 2025

Web Explorer

#6035 Bundle Size — 365.24KiB (~+0.01%).

b8d73e6(current) vs b736b6e main#6031(baseline)

Bundle metrics  Change 3 changes Regression 1 regression
                 Current
#6035
     Baseline
#6031
Regression  Initial JS 144.85KiB(+0.01%) 144.83KiB
No change  Initial CSS 32.13KiB 32.13KiB
Change  Cache Invalidation 39.66% 65.74%
No change  Chunks 8 8
No change  Assets 8 8
Change  Modules 219(-0.45%) 220
No change  Duplicate Modules 16 16
No change  Duplicate Code 3.23% 3.23%
No change  Packages 4 4
No change  Duplicate Packages 0 0
Bundle size by type  Change 1 change Regression 1 regression
                 Current
#6035
     Baseline
#6031
Regression  JS 239.3KiB (~+0.01%) 239.29KiB
No change  Other 93.8KiB 93.8KiB
No change  CSS 32.13KiB 32.13KiB

Bundle analysis reportBranch Sherry-hue:feat/web-builtin-inpu...Project dashboard


Generated by RelativeCIDocumentationReport issue

@Sherry-hue Sherry-hue merged commit 53eed0a into lynx-family:main Oct 30, 2025
50 of 51 checks passed
colinaaa pushed a commit that referenced this pull request Nov 3, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @lynx-js/rspeedy@0.11.8

### Patch Changes

- feat: support web preview in rspeedy dev
([#1891](#1891))

    -   print URLs with labels

-   Updated dependencies \[]:
    -   @lynx-js/web-rsbuild-server-middleware@0.18.2

## @lynx-js/react-rsbuild-plugin@0.11.3

### Patch Changes

- Updated dependencies
\[[`96545dd`](96545dd)]:
    -   @lynx-js/template-webpack-plugin@0.9.1
    -   @lynx-js/css-extract-webpack-plugin@0.6.4
    -   @lynx-js/react-webpack-plugin@0.7.1
    -   @lynx-js/react-alias-rsbuild-plugin@0.11.3

## @lynx-js/web-constants@0.18.2

### Patch Changes

-   Updated dependencies \[]:
    -   @lynx-js/web-worker-rpc@0.18.2

## @lynx-js/web-core@0.18.2

### Patch Changes

- feat: builtinTagTransformMap add `'input': 'x-input'`
([#1907](#1907))

-   Updated dependencies \[]:
    -   @lynx-js/web-constants@0.18.2
    -   @lynx-js/web-mainthread-apis@0.18.2
    -   @lynx-js/web-worker-rpc@0.18.2
    -   @lynx-js/web-worker-runtime@0.18.2

## @lynx-js/web-core-server@0.18.2

### Patch Changes

- feat: builtinTagTransformMap add `'input': 'x-input'`
([#1907](#1907))

## @lynx-js/web-explorer@0.0.11

### Patch Changes

- feat: builtinTagTransformMap add `'input': 'x-input'`
([#1907](#1907))

## @lynx-js/web-mainthread-apis@0.18.2

### Patch Changes

-   Updated dependencies \[]:
    -   @lynx-js/web-constants@0.18.2
    -   @lynx-js/web-style-transformer@0.18.2

## @lynx-js/web-worker-runtime@0.18.2

### Patch Changes

-   Updated dependencies \[]:
    -   @lynx-js/web-constants@0.18.2
    -   @lynx-js/web-mainthread-apis@0.18.2
    -   @lynx-js/web-worker-rpc@0.18.2

## @lynx-js/template-webpack-plugin@0.9.1

### Patch Changes

- Remove `compiler.hooks.initialize` as [it's not called in child
compilers](https://github.com/web-infra-dev/rspack/blob/aa4ad886b900770787ecddd625d3e24a51b6b99c/packages/rspack/src/rspack.ts#L78).
([#1898](#1898))

## create-rspeedy@0.11.8



## @lynx-js/react-alias-rsbuild-plugin@0.11.3



## upgrade-rspeedy@0.11.8



## @lynx-js/web-rsbuild-server-middleware@0.18.2



## @lynx-js/web-style-transformer@0.18.2



## @lynx-js/web-worker-rpc@0.18.2

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants