new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Ant Design · all subjects

contributing

25 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Branch organization for pull requests

Bugfix pull requests should be sent against the master branch. Feature pull requests should be sent against the feature branch. This follows the release schedule maintenance of two branches: master and feature.

Contributing to react-component repositories

Ant Design components are based on react-component libraries. For bugfix pull requests to react-component, after merging the core team will release a patch release, then reinstall antd to get the latest patch. For feature pull requests to react-component, after merging the core team will release a minor release, then you need to raise another pull request to Ant Design to update dependencies, documentation, and TypeScript interfaces if needed.

Development commands for Ant Design

npm start or yarn start runs the Ant Design website locally. npm run lint or yarn lint checks code style. npm test or yarn test runs the complete test suite (ensure NODE_ENV is unset). npm run compile or yarn compile compiles TypeScript code to lib and es directories. npm run dist or yarn dist creates a UMD build of antd.

Issue resolution for duplicate efforts

If somebody claims an issue but doesn't follow up for more than two weeks, it is fine to take over the issue, but you should still leave a comment indicating you are taking it over.

Reporting bugs in Ant Design

Use GitHub Issues for bug tracking. The best way to get a bug fixed is by using the issue helper at http://new-issue.ant.design and providing reproduction steps with the template at https://u.ant.design/reproduce. Before reporting a bug, search existing issues and read the FAQ.

Proposing changes and new features

To propose changes to the public API or introduce new features, use the issue helper at http://new-issue.ant.design to create a feature request issue. When naming new APIs, reference the API Naming Rules from the Ant Design wiki.

Branch management for bug fixes and features

Ant Design maintains two long-term branches: master and feature. Bug fixes should be submitted as pull requests to the master branch, which releases a patch version weekly. New feature pull requests should be based on the feature branch, which is merged to master at the end of each month and releases a minor version with new features.

Pull request checklist before submission

Before sending a pull request, verify the following: (1) Changes are based on the correct branch per branch management rules; (2) npm install has been run in the project root directory; (3) Tests are written for bug fixes or new features; (4) All tests pass via npm run test; (5) Jest snapshots are updated with npm test -- -u and changes are committed; (6) UI changes pass npm run test:image (UI testing requires Docker, update with npm run test:image -- -u if needed); (7) Code passes lint checks with npm run lint; (8) All GitHub CI checks pass.

Pull requests to react-component repositories

Most Ant Design components are based on react-component repositories. When fixing a bug in react-component, the fix will be released as a patch version after merge, then dependencies can be reinstalled to use the new version. For feature additions to react-component, after the PR is merged and released, a follow-up PR must be sent to the Ant Design repository to upgrade dependencies, documentation, and TypeScript type definitions.

Issue reporting process

Use GitHub Issues for bug tracking. The issue helper tool at http://new-issue.ant.design is recommended for reporting bugs. Use the reproduction template at https://u.ant.design/reproduce to provide reproduction steps. Before reporting a bug, search existing issues and review the FAQ at /docs/react/faq.

New feature proposal process

Use the issue helper tool at http://new-issue.ant.design to create a new feature request issue. For API development help, refer to the API specification and naming rules at https://github.com/ant-design/ant-design/wiki/API-Naming-rules.

First contribution guidelines

Issues labeled 'good first issue' at https://github.com/ant-design/ant-design/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22 are marked as easier bug fixes and small features suitable for first-time contributors. Before starting work on an issue, check comments to ensure no one else is working on it. Leave a comment to notify others you will handle the issue. If a previous assignee has not made progress in one or two weeks, you may take over the issue after commenting.

Lint checking automation with Git Hooks

Lint checking runs automatically when running git commit through Git Hooks, so developers can catch style issues before committing.

Internal API compatibility not guaranteed

Internal API is not guaranteed to be compatible with future versions and may be removed or changed. It is not recommended to use undocumented internal APIs. If you must use internal APIs, verify they are still valid when upgrading to a new version or lock the version.

Hidden undocumented APIs not recommended

Undocumented internal APIs are not recommended for use as they do not guarantee compatibility. They may be removed or refactored in future versions. If you must use them, you are responsible for ensuring they remain available during version upgrades, or you should lock your version.

New API requests require strict discussion

New APIs in Ant Design are added with careful consideration because inadequate abstraction can become technical debt. When interaction patterns change, poor abstractions may cause breaking changes. To avoid such issues, new features are recommended to be implemented via HOC first.

Extending antd components with HOC

To add functionality not included in Ant Design, use Higher Order Components (HOC) to extend components. Ant Design prefers providing atomic capabilities over adding new components to prevent API decay.

Adding a new language to Ant Design

To add a new language to Ant Design, create a locale package based on the en_US language pack and submit a pull request. The process involves: (1) forking and creating a feature branch, (2) adding language support for @rc-component/picker, (3) adding language support for @rc-component/pagination, (4) waiting for those packages to release the new version, (5) updating the versions in antd and adding remaining content, (6) adding a test case in index.test.tsx, (7) updating snapshots with 'npm run test -- components/locale -u', (8) adding the language to i18n documentation files, and (9) ensuring CI passes before review.

Contributing locale packages for picker and pagination

When adding a new language, you must add language support for two upstream packages: @rc-component/picker and @rc-component/pagination. Examples can be found in their respective repositories at the locale/en_US.ts files. After these packages release new versions with the language support, you then update antd to use those new versions.

Adding a new language locale to Ant Design

To add a new language to Ant Design, follow these steps: 1) Fork the antd repository, clone it locally, switch to the feature branch and create a new branch for your work. 2) Add the language to @rc-component/picker following the English locale template at https://github.com/react-component/picker/blob/master/src/locale/en_US.ts. 3) Add the language to @rc-component/pagination following https://github.com/react-component/pagination/blob/master/src/locale/en_US.ts. 4) Wait for @rc-component/picker and @rc-component/pagination to publish their new versions with your language. 5) Create a PR to antd referencing the Azerbaijani language PR (https://github.com/ant-design/ant-design/pull/21387) as an example, completing any remaining language content and updating the versions of @rc-component/picker and @rc-component/pagination. 6) Add test cases for the new language in components/locale/__tests__/index.test.tsx. 7) Update snapshots by running 'npm run test -- components/locale -u' (you may need to delete node_modules and lock files first and reinstall). 8) Update docs/react/i18n.zh-CN.md and docs/react/i18n.md to add the language to the documentation list. 9) Monitor CI to ensure it passes. 10) Wait for review.

Git commands for creating a language locale branch

Use these commands to set up a local branch for adding a language to Ant Design: git clone git@github.com:<your organization>/ant-design.git; cd ant-design/; git remote add upstream git@github.com:ant-design/ant-design.git; git checkout -b <your new branch name> upstream/feature.

Reference example for new language contributions

The Azerbaijani language PR (https://github.com/ant-design/ant-design/pull/21387) serves as a reference example for how to properly contribute a new language locale to Ant Design.

How to contribute to Ant Design

Contributions to Ant Design are welcome. Suggestions and feedback can be submitted via GitHub discussions at github.com/ant-design/ant-design/discussions.

Exploration channel feedback and iteration

User feedback on Exploration channel content helps optimize and iterate faster, and promotes components to enter the development state as soon as possible. Feedback can be provided through the main feedback channel or the Alibaba Internal Feedback channel.

Research Overview feedback channels

Users can provide feedback on Research Overview content through two feedback addresses: https://www.yuque.com/antdesign/topics for public feedback, and https://yuque.antfin-inc.com/ui-assets/topics for Aliyun internal network feedback.

Give your agent this brain