Writing an article is not easy, click a like brother focus on Vue source code sharing, the article is divided into vernacular version and source version, vernacular version to help understand the working principle, source version to help understand internal details, let us study together based on Vue version [2.5.17]

If you think the layout is ugly, please click the link below or pull to the following public account can also be

[Vue principle] Vue source code reading summary congress – the end

Finally, finally, the Vue series of articles are finished, a sense of relief Jio ah, today I am going to summarize the process and harvest of this period of time, this article is pure blowing water, no technical content, the guests as entertainment is meaningless, to collect an expression package is also ok


Time spent learning source code

It took more than 3 months to read the source code, 6 months to write the article, and 9 months to send the article

Take the following

Read the source code from 2018-9-10

Then I will start to write articles from 2018-12-5

Then I will finish all the articles in 2019-6-2

Post all posts from August to 19th 2019 (today)

I don’t just write it and send it right away. After I write an article, I wait for a period of time, then review it and send it again. In this way, I can not only find errors that I missed, but also can gain different insights

Do you think that’s a long time?

In fact, if you only use the time to go back from work at night to write…… The article is estimated to take a year…… I not only pursue simple content, can let us quickly pick up when we forget in the future, I also want to pursue good typesetting (turtle told me ugly good, I spent a lot of thought of ha ha), because I know typesetting ugly articles a second do not want to love to go to….

Then why do I only use half a year, I….. To say… Ha, ha, ha

However, it is also a long time, lasting such a long time, is really very difficult, in the adhere to and give up in the wavering, 57 articles is really not funny ah, almost collapsed

Fortunately, the reward for their own, all the way to support me until now

For example, after writing this series, I plan to buy a pair of shoes for myself…..

Ahem, back to business

Reading the source code is not difficult, but reading the source code in depth is difficult

How to read it deeply, is to think about a bunch of problems in advance, and then go to the source code to find the answer, or a bunch of source code in front of, will be meng force

And when you find that you have to solve a problem, usually you have to solve seven or eight problems first, and you have a lot of blind spots, and that’s the most annoying part

And writing an article is annoying and annoying, I can not be swallowed, involved in the blind area of knowledge to understand all, all additional problems to solve, because you have to understand his process in more detail and understand, there is no way ah

Don’t feel that while looking at the source code and then casually take notes, notes are to deal with their own, how much energy do you think you will spend to do?

Anyway, I feel that when I look at the source code to make notes, have not been able to help me write an article, because lazy not how hard to write

So more firm my belief in writing articles, special, write notes do not want to see, I special time is not wasted, the source code is not white to see it


How do I read the source code

I look at the source test, is directly to see a development version of the Vue file, and I see many people on the web are chosen to see Github Vue function classification folder

I personally don’t like this, although each document is much shorter than the whole document, functional classification, but too many documents, will only increase my sense of fatigue and boredom

I look directly at an entire file, directly script introduction, there is a feeling of climbing a mountain. Direct conquest of more than 10,000 lines of code, cool haven

Like the above kind, is like climbing a lot of hills, personal feeling will be a lot tired, a little boring

And this is convenient for me to debug, relevant content can see

[Vue principle] learn to debug Vue source code


Learning lessons

I don’t know how annoying it is to write an article. It takes more time and energy than reading the source code

Sometimes look at the source code, basically understand a process on the line, not detailed to every detail

Because to write an article, I have to detail every detail and go through the whole process, afraid that my writing is not rigorous enough (although there may be flaws).

Sometimes it is a disgusting process to stick to the goal even though you have already vomited.

Sometimes it really bothers me to think about it, but I believe in one thing

What irritates me the more it makes me strong

Simple things, everyone can do. Why should you be better

Difficult things, people can’t, why should you be better

If I want to be better, I have to start with boredom, because boredom itself has helped me filter out some people

So if I get past him, then I can get ahead of this group

Because he’s not a great guy anyway, just a regular program monkey

All you have to do is move past the annoying stuff

You can’t handle difficult things, and you refuse to handle annoying things. Why do you compete

This kind of irritable mood is particularly serious when compile is written, because compile source code is too much, although it has been read over and made notes, to write the article, still just to very difficult, very difficult

Each article of Compile takes several days to complete, the longest may be a week, and one day is audited to ensure correctness before it is sent. How many articles does Compile have?

Well, there are nine of them. They are really dedicated, and I think they will live up to the people who read them

Why do I share, you ask

1, their own ideas are inevitably limited, there will be mistakes missed, others can find correct you

2. Share your work. A person who keeps getting better can also make others better together


Learning harvest

Read the source code, what are the benefits of personal feeling, simple list a few

1. Know how to deal with many project details, such as object merging and array emptying

2. Become more familiar with the framework so you can solve strange problems (such as computed caching that you encountered earlier) without getting too anxious.

3. Learn a lot of new information (MessageChannel, shadow DOM)

4. It allows you to relearn old knowledge (macro/micro tasks)

5, how to write standard and easy to maintain code

6. Can read other people’s packaged code (laughing and crying)

7, the project has some problems to deal with ideas, such as in the Diff function, learned how to match two arrays, whether there is the same item

At the beginning of the Vue source sharing conference, we also said that you can take a look

【Vue principle 】Vue source code to read summary assembly – sequence


The last

I am very afraid that I will write wrong things, so I always carefully check the article, I will not publish the article immediately, but wait for a period of time to review again, to see if there is anything not smooth, incorrect

I can only say that my ability is limited, or it will be difficult to avoid possible mistakes

Read the article of children’s shoes, I hope to help you

There are mistakes, please have the courage to point out, I very hope someone correct me ha ha, I will have heavy reward!

Vue series after writing, the back may update some Vue outside, such as some small functions in the source code, but now it is estimated that it will be broken for a period of time, and then the back of Tencent front-end advanced course experience