Skip to content
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

chore: fieldPath not support arrayIndex like a[1]/a.1 #2744

Open
wants to merge 6 commits into
base: release
Choose a base branch
from

Conversation

pointhalo
Copy link
Collaborator

@pointhalo pointhalo commented Mar 4, 2025

中文模板 / Chinese Template

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Test Case
  • TypeScript definition update
  • Document improve
  • CI/CD improve
  • Branch sync
  • Other, please describe:

PR description

  • 原先的写法,对于 array[0]、array.1 这种写法无法正确推断类型。只要FormApi的泛型中带上了 array类型,类型提示就会丢失。。
  • 改了写法,兼容上述场景。并保持其他场景不变
    在 ts 5.7.2 中自测通过
    image
    image

Changelog

🇨🇳 Chinese

  • Chore: 对 Form 、FormApi 泛型嵌套路径推断做优化,支持数组类型下标推断。解决原写法 array 类型回导致类型提示丢失的问题

🇺🇸 English

    • Chore: Optimize generic nested path inference for Form and FormApi, support subscript inference for array types. Solve the problem that the original writing style of array types leads to the loss of type hints.

Checklist

  • Test or no need
  • Document or no need
  • Changelog or no need

Other

  • Skip Changelog

Additional information

Copy link

codesandbox-ci bot commented Mar 4, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 3d4a73b:

Sandbox Source
pr-story Configuration

Copy link

cypress bot commented Mar 4, 2025

semi-design    Run #3113

Run Properties:  status check failed Failed #3113  •  git commit cdbc60768b ℹ️: Merge 58c4f54c22659dcc65b3edcb877cdbac1b09ce55 into 674612e3d1ba69fae8c26c693b30...
Project semi-design
Branch Review fix-fieldPath
Run status status check failed Failed #3113
Run duration 08m 02s
Commit git commit cdbc60768b ℹ️: Merge 58c4f54c22659dcc65b3edcb877cdbac1b09ce55 into 674612e3d1ba69fae8c26c693b30...
Committer pointhalo
View all properties for this run ↗︎

Test results
Tests that failed  Failures 2
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 12
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 278
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.
View all changes introduced in this branch ↗︎

Tests for review

@pointhalo pointhalo changed the base branch from main to release March 5, 2025 03:23
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.

1 participant