The background,

In the development work, we have cited a large number of excellent open source projects in the community, but how to better understand these open source projects, the answer is Join it.

Participating in open source projects can help us broaden our knowledge of r&d projects, better understand the principles of open source projects, and improve our personal influence and competitiveness.

Second, choose the project

People always feel unfathomable about things they are not familiar with. If they have no experience in open source projects, they don’t know where to start.

In fact, we can participate in open source projects when developing daily requirements, and the technology stack used in development is the most valuable open source projects for us to start.

For example, I have daily cross-platform needs to develop wechat mini programs and JINGdong mini programs. The main technology stack for such needs is Taro. Taro is an excellent open source project of github Star of nearly 30 K, so I can start from Taro and participate in the construction of open source projects.

Start fast

First of all, understand and abide by the contribution specifications of open source projects. You can usually find contribution specifications documents on the official website, such as the Taro Contribution Guide.

1. Determine the form of contribution

Contributions can take many forms, but I’ll quickly start the process with a “Submit code” type.

2. Find an issue of interest

All of the Issues marked “Help Wanted” will be listed in the Taro website. They will be divided into Easy, Medium, and Hard difficulty levels.

Select an issue you are interested in by using the “issue” TAB:

In issue Assignees to yourself:

3. fork & clone

Fork Taro source code to own repository:

Clone personal repository Taro source to local:

git clone https://github.com/jiaozitang/taro
Copy the code

4. Local development environment

Install and compile dependencies in the Taro source project:

Build $YARN buildCopy the code

Check which packages are involved in the issue, set YARN Link for these packages, and compile locally so that debugging projects can link to the source code in development:

The Taro Package is described in the documentation: Overview of the Taro Warehouse

# yarn Link $CD packages/ taro-Components $YARN LinkCopy the code

Create an Taro project to debug the Taro

$taro init myApp # yarn link $yarn link "@tarojs/components"Copy the code

5. Start development

5.1 Function Development

Resolve the above issue of “Invalid Textarea component onLineChange time call” by following these steps:

Source path: packages/taro – components/SRC/components/textarea textarea. TSX

OnLineChange events:

  • Added onLineChange event
  • Listens for input events, counting the number of lines by line height as input
  • OnLineChange is triggered when the number of rows changes

Auto – height attribute:

  • Added the auto-height attribute
  • New auto-height style

Specific code: github.com/NervJS/taro…

5.2 Updating test Cases

Add tests for the onLineChange event, aoTUheight property in the test case.

Source path: packages/taro-components/__tests__/textarea.spec.js

5.3 Updating documents

Update descriptions of onLineChange and auto-height in README.

Source address: packages/taro – components/SRC/components/textarea/index. The md

5.4 self-test

In the local test project myApp, test whether the onLineChange event and auto-height attribute function is normal. After passing the test, run the automatic test in the Taro source project.

$NPM run testCopy the code

6. Submit the Pull Request

After the test passes, commit pull Requrst on Github.

7. Code Review process

After submitting the Pull Request, wait for the community code review, and timely follow up the feedback of the code review for modification.

Four,

This article describes the process of participating in the large-scale open source project -Taro. From the perspective of Taro to solve an issue, it introduces the complete process of claiming an issue, solving an issue and contributing code.

In this process, we can learn how to participate in the open source project and help the open source project to solve problems. When we meet the problems of the open source project in the development work, we can happily participate in the project and do not have to delay the progress of the project because of a small problem.

With the participation of more and more developers, the development of the open source community can be expected in the future.

The resources

  • How to participate in a top open source project