Webpack founder: I hope to have more time to write more code

  

Tobias Koppers is a free software developer based in Nuremberg, Germany. He is best known for writing Webpack, an open source software used by millions of developers. He currently focuses on JavaScript and open source projects. The following is my personal interview with him, I hope to inspire you.

Gregor: Hi Tobias, the JavaScript community is talking about Webpack, and even Google has integrated it into their Angular CLI project. Glad that Webpack was born in Nuremberg, not far from my hometown of Ingolstadt (Germany). Share with us, how did you think of writing Webpack, and how did it become popular so quickly?

Tobias: Hello, Gregor. In fact, Google is also involved in the development of Webpack, only indirectly. I also wrote Java before I got hooked on JavaScript. Google once launched a tool called GWT (Google Web Toolkit), which allows Java programmers to write client-side applications in Java. GWT is actually a Java application to JavaScript SPA compiler, and also uses some Google applications.

One feature of GWT that I've been working on for a long time is code splitting. This feature allows lazy loading of code that is not commonly used. This feature is very important for large applications that want to maintain the initial loading speed. But I didn't find any open source tool for JavaScript (2012) with this function, so I wanted to write one such tool, which is Webpack.

In other words, when Webpack was born, it mainly wanted to solve the problem of code splitting. And in my opinion, that's why Webpack is so popular today. As Web applications get bigger and bigger, and mobile devices become more common (but the Internet environment is relatively poor), the need for code splitting increases. It is difficult to achieve the desired performance without splitting the code.

Gregor: A lot of people compare Webpack to NPM scripts, Grunt and Gulp, etc. Someone does implement the functionality of those tools through Webpack. I will also use NPM scripts and Webpack in the future. What do you think about this, do you use other task tools besides Webpack?

Tobias:  NPM scripts are enough for me. Actually, it's not entirely accurate to say that Webpack is a replacement for Grunt/Gulp. Grunt and Gulp and NPM scripts are all task executors.

Webpack is a module bundler. The goals of the two types of programs are different. But it's also true that Webpack simplifies web development tasks that have to be "overused" with Grunt and Gulp and NPM scripts. NPM scripts are an alternative to Grunt and Gulp.

However, task runners also have raison d'être other than pure builds, such as deployments, code inspections, version management, and so on.

Gregor: In my JavaScript training class, a lot of students said how hard it is to get started with Webpack. Has anyone else said that to me? If so, have you thought about how to improve it?

Tobias: Yes  , there is such feedback. However, there are also many users who say so after using it. In fact, Webpack is very simple to use. As long as you can write web pages, you will find it easier to use than the previous tools.

I think this feedback is mainly because the concept of Webpack is significantly different from that of other tools, especially when migrating Grunt/Gulp to Webpack. The configuration of the task runner is imperative, describing what task is to be performed at each step. The configuration of Webpack is declarative, that is to say, it does not describe the steps to be executed by Webpack, but only describes how to execute these steps or what the result of execution is.

Gregor: How is your development schedule organized? What features are planned for the next Webpack release?

Tobias:  It's hard to say right now. A lot of things are possible, let’s pick a few important ones:

  • Scope boosting: a small but powerful way to connect modules

  • WebAssembly: Supporting Binary Code in Web Apps

  • Persistent Cache: Faster Initial Compilation

  • CSS (and HTML) as a first-class citizen: more support for style sheets (and HTML)

  • other

Users and sponsors decide the priorities for implementing these features. I have created a voting page where you can vote. Everyone can express their ideas, but sponsors and volunteers carry more weight. Because they need something in return. Users certainly want the more the better.

Gregor: Can you recommend a few Webpack best practices?

Tobias:  Use on-demand loading. Very simple and works very well.

Gregor: Do you have any personal goals? Will we soon see in the media that you go to Google to Mountain View?

Tobias:  I don't think so. I will be a freelancer soon. I will devote more time to open source and achieve financial balance through donations. Since donations are usually not enough, I'll take some work or consulting to make up the shortfall. I would love to know if this will work. Maybe someone will be my sponsor for a few extra weeks (hear, Google).

Maintaining an open source project requires more effort than most people imagine. Now, code reviews and issuses are 80% of my time. I have neither enough time to write code nor time to refactor. Even some merge requests took me a while to process. I need to take the time to take a closer look. Of course, volunteers don't want that. I think this will change, as long as I write Webpack full time. Wish I had more time to write more code.

Gregor: Thank you so much for the interview! Thanks also to Webpack for its great support for JavaScript developers. I really like your tool!

Tobias:  You're welcome. I want to thank the community. Webpack isn't "my" tool, it's the work of over 500 volunteers. The success of Webpack also stems from this great ecology.

Original: www.cross-platform-blog.com

Translation: https://zcfy.cc/article/interview-with-webpack-founder-tobias-koppers

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325340216&siteId=291194637