<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[webpack - Medium]]></title>
        <description><![CDATA[The official Medium publication for the webpack open source project! - Medium]]></description>
        <link>https://medium.com/webpack?source=rss----b2f039622545---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>webpack - Medium</title>
            <link>https://medium.com/webpack?source=rss----b2f039622545---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 15 Jun 2026 04:00:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/webpack" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Google Summer of Code Mentor Summit 2025]]></title>
            <link>https://medium.com/webpack/google-summer-of-code-mentor-summit-2025-aaf9588eb1a4?source=rss----b2f039622545---4</link>
            <guid isPermaLink="false">https://medium.com/p/aaf9588eb1a4</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[gsoc]]></category>
            <dc:creator><![CDATA[Nitin Kumar]]></dc:creator>
            <pubDate>Mon, 10 Nov 2025 12:04:02 GMT</pubDate>
            <atom:updated>2025-11-10T12:05:24.958Z</atom:updated>
            <content:encoded><![CDATA[<p>Last month, I had the incredible opportunity to fly from <strong>India to Munich, Germany</strong>, to represent <strong>webpack</strong> at the <strong>Google Summer of Code (GSoC) Mentor Summit 2025</strong>. This trip was extra special for me, it wasn’t just my first time attending the Mentor Summit, but also <strong>my very first visit to Europe</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k1GoowoIOa9ASIw1R7JjNA.jpeg" /><figcaption>Representing webpack at the Google Summer of Code Mentor Summit 2025 in Munich</figcaption></figure><p>The event followed an <strong>“unconference”</strong> format, which was a first for me. There wasn’t a fixed schedule or pre-decided talks — anyone could propose a session, and people would just gather if they were interested. Honestly, I loved it. It made the whole experience a lot more spontaneous and interactive. Instead of listening to slides, we were all sharing experiences, asking questions, and learning from each other in real time.</p><p>There were people from all corners of the open-source world — from developer tooling and programming languages to CI/CD, academia, Hardware, Robotics, and AI. It was fascinating to see how differently (and yet, how similarly) communities deal with challenges like funding, governance, and onboarding new contributors.</p><p>A big topic that came up throughout the summit was the rise of <strong>AI-generated GSoC proposals, </strong>something a lot of organizations, including webpack, have noticed recently. The Google Open Source team made it clear that it’s up to each org to decide how to handle it, but it was interesting to hear what others are doing.</p><p>The general direction seems to be: stop overvaluing lengthy proposals and instead look at <strong>real contributions</strong>. Most orgs are now focusing more on:</p><ul><li>Small, meaningful pull requests or “good first issues”</li><li>Short interviews or video calls to discuss those contributions</li><li>Ensuring applicants actually understand the work they’ve done</li></ul><p>This makes total sense to me. GSoC has never been about outsourcing features, it’s about <strong>learning, mentorship, and growth</strong>. We want contributors who care about the community and the craft, not just completing a project for the summer.</p><p>For <strong>webpack</strong>, programs like GSoC have always been about <strong>building people, not just code</strong>. Personally, GSoC holds a very special place in my journey. I was a <strong>GSoC student myself back in 2020</strong>, and you can find my old blog about that experience <a href="https://medium.com/webpack/gsoc-2020-with-webpack-6ad0a30bcaac">here.</a></p><p>That program marked the beginning of my open-source journey, and it shaped how I view collaboration and mentorship today. Fast forward to 2025, I’ve now transitioned from being a student to a maintainer, GSoC mentor, and a member of the webpack Technical Steering Committee. It’s been a rewarding full-circle moment, guiding new contributors along the same path that once shaped my own career.</p><p>There was also a valuable discussion about <strong>diversity and inclusion in open source, </strong>something every community should prioritize more. We discussed how to create safer and more welcoming spaces for people from all backgrounds. I strongly believe that diverse communities make better software. Different perspectives lead to better decisions, and better decisions lead to better projects. It’s not easy work, but it’s absolutely worth doing.</p><p>The summit was just two days long, but it was packed with great conversations and connections. The unconference format made it feel less like a formal event and more like a community get-together, which, to me, is exactly what open source is about. Here are few photos from the event:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z7MSxqsWygPeAvMsRZo35A.jpeg" /><figcaption>Meeting amazing open-source contributors and mentors from around the world 🌎</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*516vmDffeA1gENQlsPcz1A.jpeg" /><figcaption>One of the insightful sessions on open-source sustainability at the Google Summer of Code</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UTzisnFn_D6RWhpzUt3EWw.jpeg" /><figcaption>Lightning session where an org showcased their GSoC projects ⚡</figcaption></figure><p>Big thanks to <strong>Google’s Open Source Program team </strong>for organizing and sponsoring this event, and for giving us the space to come together, learn from each other, and share what we’ve built. It was truly an honor to represent <strong>webpack</strong> at the <strong>GSoC Mentor Summit 2025, </strong>and I’m heading back home with a lot of ideas, inspiration, and gratitude for this amazing community.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aaf9588eb1a4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/webpack/google-summer-of-code-mentor-summit-2025-aaf9588eb1a4">Google Summer of Code Mentor Summit 2025</a> was originally published in <a href="https://medium.com/webpack">webpack</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GSoC Mentor Summit 2024 @Sunnyvale]]></title>
            <link>https://medium.com/webpack/gsoc-mentor-summit-2024-sunnyvale-b0df67befbc3?source=rss----b2f039622545---4</link>
            <guid isPermaLink="false">https://medium.com/p/b0df67befbc3</guid>
            <category><![CDATA[gsoc]]></category>
            <category><![CDATA[google-summer-of-code]]></category>
            <category><![CDATA[bundler]]></category>
            <category><![CDATA[gsoc2024]]></category>
            <category><![CDATA[webpack]]></category>
            <dc:creator><![CDATA[Anshuman Verma]]></dc:creator>
            <pubDate>Mon, 18 Nov 2024 08:28:53 GMT</pubDate>
            <atom:updated>2024-11-18T08:28:53.055Z</atom:updated>
            <content:encoded><![CDATA[<p>W(w)ebpack has been involved in GSoC since the last 6 years and it has been a wonderful experience to mentor students looking to get into Open Source and willing to contribute to the community.</p><p>This year was the 20th anniversary of GSoC and I had the opportunity to represent webpack in the Mentor Summit in Sunnyvale, CA.</p><p>The event hosted ~220 mentors and org admins from a wide variety of amazing open source organisations like PSF, Chromium, Zulip etc. who all came together to provide insights to attendees as hosted sessions. Interacting with such diverse set of organisations really broadened my horizon I had about Open Source.</p><p>The GSoC mentor summit followed the “unconference” structure wherein the mentors come together and decide the agenda as opposed to having all the events planned out. This provided the flexibility to propose session almost about anything and then having a group discussion to talk about a problem and how to fix it or something the org did this year differently and the impact it had.</p><p>I have always been a believer of Open Source but after the event it was clearer how indispensable it is to all the piece of technology we have today. The people do an amazing job in making all the tools, libraries and applications and maintaining them. Open Source sustainability is hard and I really appreciate the effort that Google is putting in to help sustain it with the program.</p><p>We really appreciate all the contributors contributed to webpack this summer and also the who expressed interest in contributing to webpack. The mentor team at webpack has been nothing short of awesome to collaborate with. I would also like to thanks <a href="https://x.com/evenstensberg">Even Stensberg</a> for coordinating the program.</p><p>Here are some moments from the conference —</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Id55CY0MFzqYmZAv0o5JMw.png" /><figcaption>Chocolate table has been a fun tradition at the conference for several years now :)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*CfCv0biuKI7Qfrjy_KqN1Q.png" /><figcaption>Beautiful morning walk to the venue.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eH_o0bTGlfAo12nAmtVxHQ.png" /><figcaption>Photo with Stephanie (Program Admin)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jkY9tWYNAaEWzXWlXxVKAA.png" /><figcaption>All attendees :)</figcaption></figure><p>Lastly, I would like to thank all the program admins and volunteers who made the event such a success. Their energy and the passion they’ve shown throughout the event has been inspiring.</p><p>If you are <a href="https://summerofcode.withgoogle.com/how-it-works/">interested in participating as a student</a> for webpack during Google of Code or you want to contribute to webpack, please do reach out to us, we would love to get you started! ♥</p><p>Thank you!</p><p>Anshu</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0df67befbc3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/webpack/gsoc-mentor-summit-2024-sunnyvale-b0df67befbc3">GSoC Mentor Summit 2024 @Sunnyvale</a> was originally published in <a href="https://medium.com/webpack">webpack</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GSOC 2020 with webpack]]></title>
            <link>https://medium.com/webpack/gsoc-2020-with-webpack-6ad0a30bcaac?source=rss----b2f039622545---4</link>
            <guid isPermaLink="false">https://medium.com/p/6ad0a30bcaac</guid>
            <category><![CDATA[webpack]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[gsoc]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Nitin Kumar]]></dc:creator>
            <pubDate>Sat, 23 May 2020 11:45:34 GMT</pubDate>
            <atom:updated>2020-05-23T11:45:34.255Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5DUZZ6hvP3eJX5BBLT1FxQ.png" /></figure><blockquote>I’m super excited because I’ve been selected to work with <strong>webpack</strong> for Google Summer of Code 2020. It is both a thrill and an honor for me to be able to contribute to such a useful and wideemail you when the publication editor hasly used development tool as a <strong>GSoC </strong>student!</blockquote><blockquote>From knowing little about <strong>webpack</strong> before the organizations were announced, to being selected as one of the students, it has been a great ride. I can’t stress my gratitude towards the <strong>webpack </strong>community for being so helpful and welcoming to new contributors. I’m looking forward to making my mark on <strong>webpack</strong>, and learning a lot along the way.</blockquote><h3>&lt; About Me /&gt;</h3><p>My name is <strong>Nitin Kumar </strong>(I go by <strong><em>@snitin315</em></strong> online), I am currently in the 2nd year of my <strong>Bachelor in Technology Degree </strong>from <strong>Maharaja Agrasen Institute of Technology </strong>(Affiliated to<strong> GGSIPU</strong>)<strong>, Delhi</strong> in <strong><em>Electronics and Communications Engineering</em></strong>. I have been tinkering with code since my first year. I love working on Web Apps, as well as the related tools &amp; technologies which make Web Apps possible and I have spent many of my nights up hacking on such projects.</p><h3>&lt; My Open Source Journey /&gt;</h3><p>I started my open source contributions with <a href="https://fossasia.org/"><strong><em>FOSSASIA</em></strong></a><em> </em>organization as a participant of the <a href="https://codeheat.org/"><strong><em>codeheat</em></strong></a><strong><em> </em></strong>contest organized by FOSSASIA annually. I chose to work on <a href="https://eventyay.com/"><strong><em>eventyay</em></strong></a><strong><em> </em></strong>project. This contest taught me a lot about <strong><em>Teamwork, Problem Solving, Ability to find and fix bugs, Review code of other teammates, etc. </em></strong>I learned how to provide <strong>efficient and high-quality code.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/0*ReSN_zOHn_EkVbEJ" /></figure><p>After seeing my contributions in<strong> </strong>the <strong>FOSSASIA </strong>organization, <strong>Mario Behling (Co-Founder of FOSSASIA)</strong> invited me personally to be a mentor in<strong> Google Code-In 2019–20.</strong></p><p>Hence, I<strong> </strong>spent my winters mentoring pre-university students throughout the development of projects.</p><p>Finally, the result of the contest was announced and I was selected as a <a href="https://codeheat.org/#winners"><strong>FINALIST WINNER</strong></a><strong>.</strong></p><blockquote>I was looking forward to apply for <strong>GSOC</strong> with FOSSASIA but unfortunately FOSSASIA wasn’t selected as a mentor organization this year.</blockquote><h3>webpack- from ZERO to GSoC</h3><p><strong>webpack</strong> has always been the backbone of everything one does in front-end development. I always feared to dive deeper into the webpack or understand how it works internally. I got extremely thrilled and intrigued the day organizations list came out and I discovered <strong>webpack</strong> on the list. I made webpack my target goal and didn’t even bother to look for the rest of the organizations.</p><h4>&lt; Contributing /&gt;</h4><p>After discovering <strong>webpack </strong>on the list and <strong>webpack-cli </strong>as a project in the idealist, I instantly started contributing to webpack CLI. The CLI has introduced with a goal to improve webpack user experience by providing flexibility. Apart from compiling builds and setting up webpack for an existing/new project, it comes handy for migrating webpack configuration for version upgrades and also to add, update, or remove properties from existing configurations.</p><p>When I cloned the project and checked the source code I wasn’t able to understand anything at all. Then I realized I need to dive deeper into webpack and luckily I found some workshop videos by <a href="https://medium.com/u/393110b0b9e4"><strong>Sean T. Larkin</strong></a> ( Founder of the webpack Core Team ) which helped me a lot to understand <strong>webpack</strong> core concepts and their internal working behind the scenes as well.</p><p>Side by side I was continually creating pull requests for improving documentation, fixing minor typos, and correcting grammatical errors. It took me 14 days to get my first major PR merged ( which was the addition of the<strong> — no-mode </strong>flag to CLI ). After this PR I felt very confident and it increased my pace &amp; quality of contributions. I was able to get around <strong>30 PRs</strong> merged prior to<strong> GSOC</strong> ( which seemed impossible when I looked at the source code for the first time ).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/537/1*BV2I1ehMhQJY94Ik5v4Oog.png" /><figcaption>My Contributions to webpack-cli prior to GSoC</figcaption></figure><p>Finally, it was the day when GSoC students and projects were about to be announced. I remember refreshing my inbox every 2 minutes and yes I received an email saying <strong>“ GSoC 2020: Congratulations, your proposal with webpack has been accepted! ”.</strong></p><h3>&lt; Work To Do in Summer /&gt;</h3><p>During this summer, I’m going to kick-off this summer with the most crucial thing on webpack-cli roadmap like —</p><p>&gt; Now webpack 5 provides API for CLI arguments so we will be taking arguments from the core itself.</p><p>&gt; allowing multiple types of same arguments e.g <strong>— stats (means stats: true)</strong> and <strong>— stats verbose (means stats: verbose)</strong>.</p><p>&gt; Allow multiple same arguments, i.e. webpack --entry=./src/one.js --entry=./src/two.js</p><p>&gt; I will add some negated boolean arguments like <strong>— no-hot </strong>and <strong>— no-stats</strong></p><p>&gt; Refactor to TypeScript .</p><p>&gt; Writing unit tests and integration tests and many more general improvements.</p><h3>Last but not least</h3><p>I believe that I will finish the job at the end of happiness. Let’s enjoy it!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ad0a30bcaac" width="1" height="1" alt=""><hr><p><a href="https://medium.com/webpack/gsoc-2020-with-webpack-6ad0a30bcaac">GSOC 2020 with webpack</a> was originally published in <a href="https://medium.com/webpack">webpack</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Google Summer of Code Closing Conference]]></title>
            <link>https://medium.com/webpack/google-summer-of-code-closing-conference-60be2d9bd9a2?source=rss----b2f039622545---4</link>
            <guid isPermaLink="false">https://medium.com/p/60be2d9bd9a2</guid>
            <category><![CDATA[google-summer-of-code]]></category>
            <category><![CDATA[webpack]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[community]]></category>
            <category><![CDATA[sustainable-development]]></category>
            <dc:creator><![CDATA[Even Stensberg]]></dc:creator>
            <pubDate>Tue, 22 Oct 2019 12:43:46 GMT</pubDate>
            <atom:updated>2019-10-22T12:43:45.972Z</atom:updated>
            <content:encoded><![CDATA[<p>W(w)ebpack has now been involved in Google Summer of Code for 2 years, and it has been a fantastic opportunity for the organization to help the community evolve, students to get into the Open Source space and help the ecosystem grow and continue to be sustainable.</p><p>This year, two of our Mentors have participated in the closing conference, Google Summer of Code Mentor Summit in Munich, Germany. During the conference, mentors from all organizations met and spoke about important topics that are relevant for every Open Source organization out there. As an organization, it is important to care about the community, ecosystem and how the organization is helping making the Open Source space better, which we do (!a lot!).</p><p>The summit hosted representatives from <a href="https://git-scm.com/">Git</a>, <a href="https://sugarlabs.org/">Sugarlabs</a>, <a href="http://www.freebsd.no/">FreeBSD</a>, <a href="https://www.un.org/en/">UN</a>, <a href="https://metabrainz.org/">MetaBrainz</a>, governments and many other awesome organizations! These representatives provided insight in various of sessions together with other mentors on how we together could help sustainability, the ecosystem both in software and in the world of climate as well.</p><p>During these sessions, discussions about sustainability in projects, pull request review processes and building a healthy community was one of the core values, which was talked about in great depth and by people that care, which from a maintainers perspective, was amazing to be apart of.</p><p>Discussions of Operating Systems and burnout were also on the agenda. All these topics were really important, and from our perspective: Valuable to how we reason about Open Source governance, helping the world progress and thrive.</p><p>After attending this conference, it’s clear that the hardship of Open Source is everyones problem, not just the problems webpack are facing. The community as a whole does an immense job at making tools, libraries and source more available. Seeing so many passionate, smart and inspiring people communicate, collaborate and work together has been an eye-opener for us, and there is no doubt that the ecosystem is in the best hands, maintained by the most genuine people.</p><p>As mentors this year, we appreciate the work put into from students and other people that continues to make webpack better over time, day by day. This project is driven by the community, which is the way Open Source should be run. Thank you for this years students that made an incredible effort into their projects, <a href="https://summerofcode.withgoogle.com/archive/2019/projects/4895317185527808/">making code cleaner</a> and <a href="https://summerofcode.withgoogle.com/archive/2019/projects/4597762119696384/">reporting better</a>! Finally, thank you to all other contributors that continues to put in the effort to make the web better. A few people I want to thank, is Alexander Krasnoyarov, <a href="https://twitter.com/EugeneHlushko">Eugene Hlushko</a> and <a href="https://twitter.com/ematipico">Emanuele Stoppa</a>.</p><p>Thanks to all new contributors, welcome at any time to contribute to webpack, existing ones that aren’t mentioned, but still do tremendous efforts, thank you!!</p><p>Below is a few pictures we took during the conference.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VDAGngKHlCzGUuKLV6A0sw.png" /><figcaption>[Photo booth] webpack representing at GSOC2019</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KNt2m9pxdoKEJrrQgS7POA.png" /><figcaption>[Photo booth picture ]In Open Source you wear many hats</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1jW0bn54VlCxpbTrwVzFdA.png" /><figcaption>[Group Photo] A group photo with other mentors!</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-tzZc9fczIdkTA35dCHMxA.png" /><figcaption>[Group Photo] webpack and <a href="https://sugarlabs.org/">sugarlabs</a> ❤</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HdiwqtNt7SzikBDE0eK5-w.jpeg" /><figcaption>[Even and Steven pictured during the conference] We’re not actually into this, but it was a good picture! :)</figcaption></figure><p>Thanks to everyone involved, organizers and attendees, it was a great event and we thank everyone for having a safe and inclusive community that genuinely cares about the future of Open Source!</p><p>If you are <a href="https://summerofcode.withgoogle.com/how-it-works/">interested in participating as a student</a> for webpack during Google of Code or you want to contribute to webpack, please do reach out to us, we would love to get you started! ♥</p><p>Our mentors, maintainers and contributors are friendly, we do not bite. You can contact us through twitter at our <a href="https://twitter.com/webpack">individual handles</a>.</p><p>Again, thank you for an eye-opening experience!</p><p>Even Stensberg &amp; Steven Hargrove</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60be2d9bd9a2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/webpack/google-summer-of-code-closing-conference-60be2d9bd9a2">Google Summer of Code Closing Conference</a> was originally published in <a href="https://medium.com/webpack">webpack</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GSoC 2019 Dev Server Refactor: WebSockets, ws, and CLI]]></title>
            <link>https://medium.com/webpack/gsoc-2019-dev-server-refactor-websockets-ws-and-cli-c9a4c727ce21?source=rss----b2f039622545---4</link>
            <guid isPermaLink="false">https://medium.com/p/c9a4c727ce21</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[webpack]]></category>
            <category><![CDATA[google-summer-of-code]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Kirill Nagaitsev]]></dc:creator>
            <pubDate>Wed, 14 Aug 2019 15:52:25 GMT</pubDate>
            <atom:updated>2019-08-14T15:52:25.117Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gjaaBO_CWUiKtwFM7wwmJg.png" /></figure><p>This Google Summer of Code, I worked on a couple of key components in the webpack Dev Server: the client-server WebSocket communications, and the CLI. Most of my work was focused towards <a href="https://github.com/webpack/webpack-dev-server/issues?utf8=%E2%9C%93&amp;q=author%3ALoonride+label%3Agsoc">PRs for webpack-dev-server</a>, with occasional, project-related work in webpack-cli and documentation work in webpack.js.org.</p><p>The Dev Server is a tool that allows users to develop and serve webpack apps with live reloading browser capabilities. I’ll be sharing what I have added and changed, how my efforts will impact this tool, and what lies ahead.</p><p><a href="https://github.com/webpack/webpack-dev-server">GitHub - webpack/webpack-dev-server: Serves a webpack app. Updates the browser on changes. Documentation https://webpack.js.org/configuration/dev-server/.</a></p><h3>Brief Overview of Changes</h3><p>The major goals of my GSoC with the Dev Server were completed. These goals were: adding ws and native WebSockets as a transport option to eventually replace SockJS, refactoring the CLI, and improving tests. Here is the status of these changes, and links to the relevant work:</p><ul><li><strong>transportMode</strong> option, allowing users to specify ‘ws’ in place of ‘sockjs’ (merged and published, <a href="https://github.com/webpack/webpack-dev-server/issues?utf8=%E2%9C%93&amp;q=author%3ALoonride+label%3Agsoc+label%3A%22scope%3A+ws%28s%29%22">relevant PRs</a>)</li><li>CLI Refactor, minimalizing CLI/API inconsistency (some published, others merged and awaiting next major release, <a href="https://github.com/webpack/webpack-dev-server/issues?utf8=%E2%9C%93&amp;q=author%3ALoonride+label%3Agsoc+label%3A%22scope%3A+cli%22">relevant PRs</a>)</li><li>wepack-cli serve refactor (merged and awaiting next major webpack-cli release, <a href="https://github.com/webpack/webpack-cli/pulls?utf8=%E2%9C%93&amp;q=is%3Apr+author%3ALoonride">relevant PRs</a>)</li><li>Test improvements, including end-to-end tests and adding tests for untested features (merged and published, <a href="https://github.com/webpack/webpack-dev-server/issues?utf8=%E2%9C%93&amp;q=author%3ALoonride+label%3Agsoc+label%3A%22type%3A+test%22">relevant PRs</a>)</li><li>Documentation of my features and changes (some published, other docs awaiting major Dev Server release, <a href="https://github.com/webpack/webpack.js.org/pulls?utf8=%E2%9C%93&amp;q=is%3Apr+author%3ALoonride">relevant PRs</a>)</li></ul><p>Luckily, virtually none of my work went to waste or went completely unused. There is still work to be done in refactoring the Dev Server, but everything directly related to my major project goals was completed.</p><h3>Native WebSockets and ws</h3><p>The first goal of my project was to make ws the new default server, a WebSocket server which can communicate with native browser WebSockets. These new defaults are meant to replace the current <a href="https://www.npmjs.com/package/sockjs">SockJS</a> client/server implementation that the Dev Server uses. The motivation behind this change is that SockJS is poorly maintained and slower than ws with WebSockets.</p><p><a href="https://www.npmjs.com/package/ws">ws</a></p><h4>Backwards and Browser Compatibility</h4><p>The difficulty of simply scrapping SockJS is that it offers support for older browser versions that do not support native WebSockets. My solution had to make it easy for users to swap back to SockJS, if they needed to support older browser versions for their projects.</p><p>My new system also had to do everything that the current SockJS server and client were already doing, preventing any breaking changes, aside from the browser compatibility issue. This meant that ws and native WebSockets would have to seamlessly swap with SockJS as the client/server implementation.</p><h4>WebSocket-like Interface</h4><p>In order to accomplish my goals, I first built a WebSocket-like interface for both the Dev Server client and server. To get the most out of this interface, I made it almost completely unassuming of what client/server library is being used.</p><p>The chosen server library simply needs to listen for new connections, produce a connection object for each new connection, and be able to send messages to this connection object, among a few other things. In essence, the server interface looks like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/016ba010f3528af0cca8c9a8185782bf/href">https://medium.com/media/016ba010f3528af0cca8c9a8185782bf/href</a></iframe><p>Then, using ws and slightly simplifying, the onConnection method implementation might look something like:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/95339651dc74773f587899ef137bb2ab/href">https://medium.com/media/95339651dc74773f587899ef137bb2ab/href</a></iframe><p>The client interface is similar, requiring simply that the client library can connect to a server and listen for messages.</p><blockquote>The reason for this design is that ws, SockJS, and native WebSockets could then all be implemented via this unifying interface. This also has the added benefit that other WebSocket client/server libraries can be implemented in place of SockJS or ws.</blockquote><h4>devServer.transportMode option</h4><p>Using this interface, I implemented two modes: ‘sockjs’ and ‘ws’. Then, I added a new <strong>transportMode</strong> option, with which users can, for example, do:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/37ff2e96654720e6b4d529438db5a9eb/href">https://medium.com/media/37ff2e96654720e6b4d529438db5a9eb/href</a></iframe><p>Using this mode makes use of the ws server and native browser WebSockets.</p><h4>Custom, user-implemented Client/Server</h4><p>Beyond the simple ‘sockjs’ and ‘ws’ modes, users can now implement their own <strong>transportMode</strong> using the interface mentioned above. Instead of specifying an already implemented mode as a string, you can provide:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6f5264be2a44da4dcb0d873c9f2eea0d/href">https://medium.com/media/6f5264be2a44da4dcb0d873c9f2eea0d/href</a></iframe><p>These are absolute paths to files exporting classes that implement the interface mentioned above. As I said earlier, this is simply a customizable benefit that came from creating a versatile, unassuming, WebSocket-like interface.</p><p>But what can you actually do with this customizability? The main use case would be to implement a specific server/client library that you desire, rather than using the provided sockjs or ws options. The key is that the client and server must be compatible to communicate. Let’s say, for example, that you do not want to use ws as a Node WebSocket server, but instead want to use <a href="https://www.npmjs.com/package/websocket">websocket</a>, another Node WebSocket server implementation. You still want native browser WebSockets. First, you would use the server implementation interface and plug in the websocket library:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/12581b1d2ee2ed57a536148e3aca2fcf/href">https://medium.com/media/12581b1d2ee2ed57a536148e3aca2fcf/href</a></iframe><p>To make use of this custom server implementation, paired with the native browser WebSocket implementation that is provided, you would simply do:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3e72aba0dc48edb73a34d15346c455c8/href">https://medium.com/media/3e72aba0dc48edb73a34d15346c455c8/href</a></iframe><blockquote>With these tools now available, users will be more capable of customizing the Dev Server to their needs, and the Dev Server will become easier to maintain as standards and transport libraries change.</blockquote><h3>CLI Refactor</h3><p>The next step of my Google Summer of Code was to start refactoring the Dev Server CLI. The motivations behind this refactor were:</p><ol><li>There is inconsistency between the Dev Server API and CLI usage, making some options confusing to use</li><li>Moving the CLI into the <strong>serve</strong> package of webpack-cli will improve the user experience, as webpack-cli is focused on making it easier to create and modify webpack projects</li></ol><h4>Removing CLI config changes</h4><p>Inconsistency between the Dev Server API and CLI stems from the fact that the CLI utilizes the API, but first makes some configuration changes to the user’s provided CLI options. My thought process was that, if these changes are made to make the user experience better, API users should receive the same changes, and therefore the same benefits and consistency.</p><p>Let’s look at a few lines of code directly from the Dev Server to demonstrate what I mean. These <a href="https://github.com/webpack/webpack-dev-server/blob/4766b6769f4502f64752f2e18ff24ffafa1daf83/lib/utils/createConfig.js#L79-L81">lines of code</a> are only executed when the user is using the CLI:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d6b938c6c7fa1ae1048c6d2ad43d58fa/href">https://medium.com/media/d6b938c6c7fa1ae1048c6d2ad43d58fa/href</a></iframe><p><strong>options</strong> is the options object that the user has provided in their webpack config file, and <strong>firstWpOpt</strong> is the webpack options object that will be passed into the compiler, also from the user’s webpack config file. This makes the user experience better because it infers the user’s desired <strong>watchOptions</strong> from the webpack config they provided, meaning the user does not have to include these options twice for both the webpack compiler and the webpack Dev Server.</p><p>API users did not get this feature. This is one of many examples where the API did not make changes to the options consistent with the CLI.</p><p>My solution is simple to explain: I started moving all configuration changes from the CLI to the API. Ultimately, I planned to design the CLI such that it simply parsed the CLI arguments, then passed that parsed argument object directly into the API, with zero configuration changes. In a very boiled down example, the CLI should do the following:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c095e2acfbd7271fda8934e7f8f67fa2/href">https://medium.com/media/c095e2acfbd7271fda8934e7f8f67fa2/href</a></iframe><h4>Breaking Changes</h4><p>Because I wanted to bring the CLI and API inconsistencies to a minimum, there were many minor breaking changes involved. The example earlier of inferring a Dev Server option from the webpack options, for instance, would be a minor breaking change for the API.</p><p>For this reason, all of my changes to the CLI will be coming in the next major Dev Server version. Ultimately, these breaking changes will have a positive impact.</p><h4>webpack-cli serve</h4><p>My work on this command in the <strong>serve</strong> package of webpack-cli is part of the next major version effort for webpack-cli. Previously, the <strong>webpack-cli serve</strong> command simply made use of the Dev Server CLI. My goal was to make this command instead use the Dev Server API directly.</p><p>Since webpack-cli is also undergoing a refactor for the next major version, my work here involved bootstrapping the serve command using the new webpack-cli infrastructure, and parsing the Dev Server arguments using <a href="https://www.npmjs.com/package/command-line-args">command-line-args</a>, rather than the previously used <a href="https://www.npmjs.com/package/yargs">yargs</a>.</p><blockquote>From these CLI improvements, users get many benefits: more consistent and predictable usage between the CLI and the API, as well as a better user experience from webpack-cli.</blockquote><h3>Dev Server Tests</h3><p>While working on my main feature and refactor efforts mentioned above, I also dedicated some time to improving test coverage and stability. My main work here involved:</p><ol><li>Adding end-to-end tests and improving their stability</li><li>Adding tests for previously untested features that I dealt with</li></ol><h3>What’s next for the Dev Server</h3><p>My goals for GSoC 2019 were accomplished. I implemented ws and native WebSockets via the <strong>transportMode</strong> option, and I refactored the Dev Server CLI. Some of these changes have been released, and some have yet to be released as of the writing of this post, as they will arrive in the next major versions of webpack-dev-server and webpack-cli. But there are still things to be done to improve the Dev Server, which I hope I can continue to be a part of!</p><p>Upcoming for the webpack-dev-server will be the version 4 release, as the final version 3 release has already been published. This will have to coincide with the next major version of webpack-cli, as <strong>webpack-cli serve</strong> changes will rely on major changes in webpack-dev-server. Other things to expect for the Dev Server in the future will include a refactor to organize the client directories more thoughtfully, and possibly TypeScript, to name a couple.</p><p>This Google Summer of Code has been a great experience for me, and I’m very thankful that I got to do my work for webpack! I plan to continue contributing to webpack and hopefully expanding beyond the Dev Server.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9a4c727ce21" width="1" height="1" alt=""><hr><p><a href="https://medium.com/webpack/gsoc-2019-dev-server-refactor-websockets-ws-and-cli-c9a4c727ce21">GSoC 2019 Dev Server Refactor: WebSockets, ws, and CLI</a> was originally published in <a href="https://medium.com/webpack">webpack</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[</Summer 2019 with webpack>]]></title>
            <link>https://medium.com/webpack/summer-2019-with-webpack-5cd3ddbc9a05?source=rss----b2f039622545---4</link>
            <guid isPermaLink="false">https://medium.com/p/5cd3ddbc9a05</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[google-summer-of-code]]></category>
            <category><![CDATA[gsoc-2019]]></category>
            <category><![CDATA[gsoc]]></category>
            <category><![CDATA[webpack]]></category>
            <dc:creator><![CDATA[Devid Farinelli]]></dc:creator>
            <pubDate>Wed, 14 Aug 2019 15:51:25 GMT</pubDate>
            <atom:updated>2019-08-14T15:51:25.442Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tygnMbkCLZGryUYRMCyRUQ.jpeg" /></figure><p>Here we are at the end of the <strong>GSOC 2019</strong>, seems yesterday that I wrote the first article before beginning my work for webpack, check it out if you want to have an overview of my project (<a href="https://medium.com/webpack/summer-2019-with-webpack-840c7f7b97c4">link</a>).</p><p><em>Long story shor</em>t, in those 3 months I’ve developed a plugin called <strong>ReporterPlugin</strong> that helps to customize webpack’s output. You can read more on the Github <a href="https://github.com/misterdev/webpack-reporter-plugin">repo</a> and you can find it on <a href="https://www.npmjs.com/package/test-webpack-reporter-plugin">npm</a> as <strong><em>test-webpack-reporter-plugin</em></strong>.</p><p>The purpose of this plugin is to offer a more informative and CI friendly way of outputting information, offering an improvement over what is available at the moment:</p><ul><li>making easier to understand what webpack is doing, for example, you should now know where your compilation broke in a more chronologically accurate and predictable format</li><li>reducing the time required to customize the information displayed, making easy to override webpack’s output, to remove it completely or to define any custom behavior (e.g. dumping log to a file)</li></ul><blockquote>What I’ve not been able to do in 3 months, is finding a different name for this plugin since webpack-reporter-plugin is already taken</blockquote><h3>Fundamental Concepts</h3><p>Those are some fundamental concepts to understand the purpose of this project and how to use it.</p><h4>Hooks</h4><p>You can think of hooks as event listeners, you can use <em>myHook.tap(callback)</em> to add a listener that will be executed when <em>myHook.call(params)</em> will be called.</p><p>Hooks are provided by a library called <a href="https://github.com/webpack/tapable">tapable</a> and are used extensively in webpack’s code to implement the plugin system (e.g. <em>compiler.hooks.done</em> is called every time a compilation has finished).</p><p>This plugin uses hooks in 2 ways:</p><ol><li>Listens to every webpack’s hook in order to be able to log whatever is happening during a compilation</li><li>Provides 4 new hooks (info, warn, error and stats) allowing to easily write a CustomReporter to handle all logs</li></ol><h4>CustomReporter(s)</h4><p>A CustomReporter is the actual piece of code that you will write in case you want to override webpack’s output. A <strong>Reporter</strong> taps into the ReporterPlugin’s hooks (<em>info</em>, <em>warn</em>, <em>error</em> and <em>stats</em>) specifying how to print all those kind of logs. While it’s straightforward to think of a custom reporter as something that formats and prints logs, <strong>it also covers use cases where you are not interested in printing</strong> but instead, you may want to dump all the logs into a file or forward them to a web server. Wrapping it up, a CustomReporter is something that listens to 4 different kinds of logs (<em>info</em>, <em>warn</em>, <em>error</em> and <em>stats</em>) and handles them as needed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XbYs9DY5u37xf0HmqDa4qA.png" /><figcaption>This is what a CustomReporter looks like</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q8x2VkI3jGjYBAOymu03GA.png" /><figcaption>webpack emits logs and the ReporterPlugin forwards them to the CustomReporters (yellow = warning, red = error, blue = info &amp; stats)</figcaption></figure><h4>Configurations</h4><p>Since this plugin is meant to be used by anybody without requiring too much knowledge of webpack’s internals, it has good default settings so that it doesn’t need configurations to work, although, you can harness its power by tweaking the configurations. Through the configurations, you can decide which hooks you want your Reporter to report or to exclude and you can also pass one or more CustomReporters</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RPk5WzCHUXjUFe2lrNpiRQ.png" /><figcaption>That’s right, you can use many reporters at the same time!</figcaption></figure><h3>Throttling</h3><p>Sometimes some hooks are called many times during a webpack run, this plugin allows you to limit those “noisy” hooks. You can set a value to tell this plugin to emit a log for a specific hook only once every N times or every N milliseconds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nEDeRPsZOI_SLpslR1PIIQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*7V5LZkeWoGeGarX13CHWcA.gif" /><figcaption>Yeah this GIF doesn’t make sense here.</figcaption></figure><h3>My work</h3><p>After being selected for this GSOC I talked with my mentors and opened some discussion to gather feedback from the community, receiving great suggestions on the<strong> infrastructure design</strong> (<a href="https://github.com/webpack/webpack/issues/9137">webpack#9137</a>) and the plugin <strong>configuration schema</strong> (<a href="https://github.com/misterdev/webpack-reporter-plugin/issues/2">webpack-reporter-plugin#2</a>)</p><p>I started working on the bare bones of the project implementing the infrastructure that makes this plugin extensible with CustomReporters with the goal of providing a simple and friendly way of defining reporters. The result is that reporters are easy to write and look familiar to everyone that has seen the code of a webpack’s plugins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*roDtUt3WrgCyvwIhSXXSsA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sKFltiDqZuuf_qPic0oQ8w.png" /><figcaption>Code comparison: a webpack plugin (left) and a custom reporter (right)</figcaption></figure><p>After that, I refined the first implementation and made the plugin customizable through settings. After defining the schema, the other important task was to validate it to avoid errors. I used a library called <a href="https://www.npmjs.com/package/schema-utils"><em>schema-utils</em></a> before implementing my own wrapper around a JSON validator called <a href="https://www.npmjs.com/package/ajv"><em>ajv</em></a> to have more control over error messages.</p><p>When everything was in place I started writing documentation and tests. I decided to test if the plugin was able to validate and parse the configurations, listen and report the hooks according to the configurations and lastly I tested the correct behavior of the default reporter. This part has been really <strong>instructive and helped me discover and fix some problems</strong>.</p><p>While working on this project I looked at many <em>webpack-contrib</em> repositories and made mine as similar as possible to those in order to make it easier for people from the community to understand and possibly contribute to it. I’ve set up linting &amp; commit linting to ensure consistency of code and commits and Travis CI and codecov to automate quality checks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*1yGLhsNaVul3KjbABDG9-A.gif" /><figcaption>This is how the new output looks like when using the default settings (colorized)</figcaption></figure><h3>Conclusions</h3><p>This is my second GSOC and it has been very different from my previous one for many reasons:</p><p>In 2015 I was really new to the Javascript world, I had no OSS experience, I was only writing vanilla JS, I had basic knowledge of Git and working on my project has been pretty challenging.</p><p>Now instead, I’m familiar with the Javascript ecosystem and I’ve contributed to webpack-cli for some months before GSOC and working on my project has been quite smooth.</p><p>What hasn’t changed is the amazingness of this experience, something that I would suggest to every student!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5cd3ddbc9a05" width="1" height="1" alt=""><hr><p><a href="https://medium.com/webpack/summer-2019-with-webpack-5cd3ddbc9a05">&lt;/Summer 2019 with webpack&gt;</a> was originally published in <a href="https://medium.com/webpack">webpack</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GSoC 2019: Starting Off the Dev Server Refactor]]></title>
            <link>https://medium.com/webpack/gsoc-2019-starting-off-the-dev-server-refactor-caacf0390fe5?source=rss----b2f039622545---4</link>
            <guid isPermaLink="false">https://medium.com/p/caacf0390fe5</guid>
            <category><![CDATA[webpack]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[gsoc]]></category>
            <dc:creator><![CDATA[Kirill Nagaitsev]]></dc:creator>
            <pubDate>Mon, 03 Jun 2019 11:28:32 GMT</pubDate>
            <atom:updated>2019-06-03T11:28:31.874Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kp9MQyu6wvhXK7sRHmvQUg.png" /></figure><p>I’ve been selected to work with webpack for Google Summer of Code 2019. It is both a thrill and an honor to be able to contribute to such a useful development tool as a GSoC student! I’m looking forward to making my mark on webpack, and learning a lot along the way.</p><h3>About Me</h3><p>I go by <a href="https://github.com/Loonride">Loonride</a> online, but you can also call me Kir. I’m a first year undergraduate student at the University of Chicago, majoring in Computer Science. I’m originally from near Chicago.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*_5wZXqjrfGZ_GfJPmWNFIw.png" /><figcaption>A screenshot of my latest game, <a href="https://cavegame.io">Cavegame.io</a> (Built using webpack, of course!)</figcaption></figure><p>I got my start in JavaScript through browser game development many years ago. Most of my JavaScript and NodeJS experience has come from creating games and other hobby projects. My latest project is an ambitious 2D multiplayer browser game called <a href="https://cavegame.io">Cavegame.io</a>! I often share my projects on GitHub, but beyond that, I had minimal Open Source experience before jumping into GSoC.</p><h3>My webpack Story</h3><p>I learned about webpack around 1 year ago. I was looking for a way to more easily bundle my game assets and source code together. My first experience with it was painful. I was dissatisfied with it, because it took too long to compile. If only someone had told me about the webpack Dev Server! I stopped using webpack for a while, but I later came across a project on GitHub that was using it effectively, so I gave it a second chance.</p><p>Now, I could never live without webpack! I use it in all of my projects, and it makes my workflow easy and efficient. I learned how to use webpack effectively, but how it actually worked still remained a mystery to me.</p><p>When I looked through the list of GSoC organizations and saw webpack, I immediately knew that I wanted to submit a proposal. It excited me that a GSoC project could directly benefit my own personal endeavors, like my game development projects, while also helping thousands, if not millions, of other developers with their own projects. Aside from the impact, it interested me that I could use this opportunity to demystify this tool that I relied so heavily on, while also diving into Open Source.</p><h4>Why I Chose the Dev Server</h4><p>The webpack Dev Server was listed as a GSoC proposal idea, and it seemed like an obvious choice for me from the start. I have experience with WebSockets and WebSocket servers in Node, so I knew I had the skills to work on moving the Dev Server away from SockJS, and towards a native WebSockets client implementation by default.</p><p>I also like the Dev Server as an option because I personally find it to be an essential webpack tool. It has made development extremely easy for me, as it allows for quick recompiling and iteration.</p><h3>Contributing</h3><p>I started contributing by looking through Dev Server issues and seeking out what seemed easiest. My first contribution was an HTTP/2 option, and it taught me how to add new options, how to add tests, and how to go through the PR process. After taking that first step, I felt a lot more confident that I could learn how the Dev Server and the rest of webpack work.</p><p>Next, I decided to tackle a bigger issue, which related to the insertion of entries into the user’s webpack compilation. The issue was that there was inconsistent behavior between the CLI and the API, because the API was not inserting those scripts on its own. While working on the problem, I came across <a href="https://github.com/webpack/webpack-dev-server/issues/616">this</a> issue:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*tlrgmcDR7Wcj-kvUqEq8DQ.png" /></figure><p>It’s the oldest issue on the Dev Server that is still open, and it brings up some lasting problems with uniformity. Reflecting on this issue gave me lots of ideas for my proposal, and made me realize that there really is lots of work to be done when it comes to improving the Dev Server. The major issue of uniformity lies in how the CLI interacts with and alters Dev Server options before passing them on to the API. I will take more steps to solve this during my project.</p><p>While working on my proposal, I also took a careful look at the SockJS client and server implementation in the Dev Server. The other key part of my project will be encapsulating these implementations so that we can create new implementations, like native WebSockets and <a href="https://www.npmjs.com/package/ws">ws</a>, or even let the user provide their own implementation.</p><h3>What’s Next</h3><p>To start off the bulk of my project, I will be refactoring the SockJS implementation in the Dev Server, while maintaining backwards compatibility. The goal is that I can then easily swap in WebSockets and a WebSocket server without breaking anything, so that it can eventually become the new default implementation in place of SockJS. The reasoning behind this is that, while SockJS works at the moment, it is outdated, poorly maintained, and slower than native WebSockets. A proper refactor will allow the user to provide their own implementation, as well as use the client-server implementation to relay their own messages. I will also ensure that using SockJS still remains possible, since it works on some older browsers that don’t support WebSockets.</p><p>When it comes to CLI/API uniformity, I would like to work to move most of the options handling that the CLI does into the API, since the CLI eventually just calls the API. Another potential method for minimizing differences is to move the Dev Server CLI fully into <a href="https://github.com/webpack/webpack-cli">webpack-cli</a>. From a development standpoint, this would emphasize that we need to keep all the functionality inside of the Dev Server API, then do minimal work in the CLI itself. I will start making this transfer to webpack-cli during my project.</p><p>The way that the Dev Server was designed creates some challenges for the uniformity that I want to improve upon. Namely, the CLI creates the webpack Compiler, so it can make changes to its options before passing it on to the API. Consequently, the API can’t easily make changes to the webpack Compiler options, since the Compiler has already been created. With any remaining time I have, I hope that I can add features that make it easier to alter the Compiler configuration after it has been created.</p><h3>Final Remarks</h3><p>My project is ambitious and spans multiple aspects of the webpack Dev Server, but I’m confident that I can make improvements in all of those aspects during my refactor. Above all, I want to have a positive impact (without breaking anything, of course), while also learning and gaining a bunch through Open Source contributions!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=caacf0390fe5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/webpack/gsoc-2019-starting-off-the-dev-server-refactor-caacf0390fe5">GSoC 2019: Starting Off the Dev Server Refactor</a> was originally published in <a href="https://medium.com/webpack">webpack</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Summer 2019 with Webpack]]></title>
            <link>https://medium.com/webpack/summer-2019-with-webpack-840c7f7b97c4?source=rss----b2f039622545---4</link>
            <guid isPermaLink="false">https://medium.com/p/840c7f7b97c4</guid>
            <category><![CDATA[webpack]]></category>
            <category><![CDATA[gsoc]]></category>
            <category><![CDATA[google-summer-of-code]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[gsoc-2019]]></category>
            <dc:creator><![CDATA[Devid Farinelli]]></dc:creator>
            <pubDate>Mon, 03 Jun 2019 09:02:18 GMT</pubDate>
            <atom:updated>2019-06-03T09:02:18.002Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u9DVJC7jTZJ9cbYqr7f1cg.jpeg" /></figure><h3>Summer 2019 with webpack</h3><p>My view this summer will be slightly different from the one in the image above, however, I’m super excited because I’ve been selected to work on improving webpack during this summer!</p><h3>About me</h3><p>My name is Devid, I’m mastering computer science at the University of Bologna (Italy). I’m a Javascript developer and I’m passionate about technological developments in general.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-BL_HFelrlk_NDdQyGORPw.png" /><figcaption>Here’s Bologna</figcaption></figure><p>I made my first open source contribution in 2015 while I was working as a GSoC student for the <a href="http://appinventor.mit.edu/">MIT App Inventor</a>, I still have a great memory of that summer and all the great people I got to know.</p><p>When I don’t code, I organize, attend and speak at technical events, I play video games and exercise at the gym.</p><p>You can find me on Twitter as <a href="https://twitter.com/misterdev_">@misterdev_</a> and on Github as <a href="https://github.com/misterdev">@misterdev</a>.</p><h3>webpack: from zero to GSoC</h3><p>I’ve used webpack many times in my projects since around 2016. I started learning webpack more in depth and wrote my first configuration last year, when I decided to apply for webpack for the GSoC 2018.</p><blockquote><strong>Devid from 2018:</strong> “I’ve already been a GSoC student and I worked 2 years in a local startup as a full-stack developer, this is gonna be easy, let’s pick the most difficult proposal…mmh multithreading in webpack? Yeah! I know nothing about webpack internals and multithreading in Javascript, I can definitely do this! Let me fix a typo in the documentation and send my application”</blockquote><p><strong>SPOILER:</strong> I wasn’t selected</p><p>After the summer, inspired by people I really admire for their work (like <a href="https://github.com/kentcdodds">kentcdodds</a> and<a href="https://github.com/sindresorhus"> sindresorhus</a>), I decided to start contributing to an Open Source project despite not being selected. My top choices were webpack, Node, and Yarn, I chose to go on with webpack.</p><p>I spent the first month solving a problem just to find out it was the intended behavior 😅 but I learned a lot about how webpack works. Since then, I’ve tried and documented every single webpack hook (<a href="https://github.com/webpack/webpack.js.org/pull/2790">parser</a>, <a href="https://github.com/webpack/webpack.js.org/pull/2852">compilation</a>, and <a href="https://github.com/webpack/webpack.js.org/pull/2840">compiler</a>), made an Open Collective prompt for webpack-cli, helped with the scaffolding system and the CI. I published my first <a href="https://www.npmjs.com/package/webpack-scaffold-vue">package</a> on npm and wrote my first medium <a href="https://medium.com/@misterdev/how-to-write-a-webpack-scaffold-ace202775572">article</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tuSDgektPUX5Uxx9_Xh6VA.png" /><figcaption>My contribution to webpack-cli from the beginning of 2019</figcaption></figure><p><em>Fun fact: I’m not able to write “webcam” anymore, my muscle memory writes “webpcam” or directly “webpack”</em></p><h3>My work for the summer</h3><p>This summer I’m going to work on the <strong>“Output Reporter”</strong>, the purpose of this project is simple: to provide a way to override webpack’s output. Currently is hard to customize the default output, therefore it would be great to have a way to make the creation of custom reporters easier. In webpack, the compilation stats is standardized, outputting large pieces of information and it’s hard to get something out from it all.</p><p>What I’m thinking, is that there are currently two ways of overriding webpack’s output: you can use a plugin (e.g. <a href="https://webpack.js.org/plugins/progress-plugin/"><em>ProgressPlugin</em></a>, <a href="https://github.com/nuxt/webpackbar"><em>webpackbar</em></a>, <a href="https://github.com/geowarin/friendly-errors-webpack-plugin"><em>friendly-errors-webpack-plugin</em></a>) or set the <em>“</em><a href="https://webpack.js.org/configuration/stats/#root"><em>stats</em></a><em>”</em> option to configure which bundle information you want to display (picture below). Of course, you could also write your own plugin but it requires a knowledge of how webpack works internally.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WVakxR6Dm47n4JJ8RrUsTA.png" /><figcaption>webpack’s bundle information</figcaption></figure><p>The <em>“stats”</em> option can only be used for a final output after compilation and you may not find a plugin covering your use case, another solution is needed…</p><p>The Output Reporter project is meant to improve the current usefulness of webpack’s output, we want to make it more informative about the current state of the compilation, allowing to comprehend the information given from the compiler, where webpack spends most of the time or where it fails to compile. This is very similar to the <a href="https://webpack.js.org/plugins/progress-plugin/">ProgressPlugin</a> with the intention to be more CI friendly (avoiding buffered output) and allowing the possibility to throttle noisy hooks to limit the frequency of the output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0o7M8mcdYYaVGc9EeYdfuw.png" /><figcaption>From the Google Summer of Code website</figcaption></figure><p>My initial proof of concept was to have an <em>EventEmitter</em> inside webpack emitting a set of events like <em>“warning”, “error”, “log”, </em>and<em> “stats”</em> so that anyone could write a custom reporter that listens to these events, formats, and prints the output.</p><p>After being selected, I’ve received many great suggestions from <a href="https://github.com/hulkish">@hulkish</a> and <a href="https://github.com/sokra">@sokra</a>, the initial idea has slightly changed, but it’s <strong>way</strong> better now!</p><p>I’m going to build off the original proposal, creating a webpack plugin that can be configured with one or more custom reporters. Instead of an <em>EventEmitter,</em> I’ll use the <em>tapable </em>interface to emit a set of events, which is a library created by webpack to implement the plugin system.</p><p>Summing it up, I’m going to create a new plugin system for reporters, so custom reporters are going to be similar to a classic webpack plugin:</p><pre>class CustomReporter {<br>  apply(reporter) {<br>    // Adds a listener for a specific log: &quot;info&quot;<br>    reporter.hooks.info.tap(&quot;CustomReporter&quot;, data =&gt; {<br>      // Formats and prints the output<br>      console.log(&quot;I&#39;M THE REPORTER: &quot;, data);<br>   });<br>  }<br>}</pre><p><a href="https://github.com/webpack/webpack/issues/9137"><em>Here</em></a><em>’s the discussion on this, feel free to give your feedback on the implementation.</em></p><h3>Final Remarks</h3><p>GSoC 2015 has been a key point in my path as a developer, it improved my English <strong>a lot</strong> and gave me solid grounds in web development. Furthermore, seeing my commitment being rewarded and completing what I had been selected for, is a great satisfaction, that kind of confidence boost is good for everyone. I’m sure this year will be another great experience…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hKpEEo0ghrfs4tUpZ-5NlA.jpeg" /><figcaption>Do you see that blank space at the top-left corner?</figcaption></figure><p><strong>Devid from 2019:</strong> <em>“I know a little about video editing, nothing about photography, and my English accent is arguable… let’s make a series of videos covering the summer of a GSoC student for webpack”</em> :)</p><p>I use this space at the end to give a <strong>very big thanks</strong> to <a href="https://twitter.com/evenstensberg"><strong>Even Stensberg</strong></a>, I’m sure I wouldn’t be here without his precious feedback :) 🔥🔥</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=840c7f7b97c4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/webpack/summer-2019-with-webpack-840c7f7b97c4">Summer 2019 with Webpack</a> was originally published in <a href="https://medium.com/webpack">webpack</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[We are changing the interface of webpack-cli — here’s why]]></title>
            <link>https://medium.com/webpack/we-are-changing-the-interface-of-webpack-cli-heres-why-2e8057f2eda1?source=rss----b2f039622545---4</link>
            <guid isPermaLink="false">https://medium.com/p/2e8057f2eda1</guid>
            <category><![CDATA[web]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[webpack]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Even Stensberg]]></dc:creator>
            <pubDate>Fri, 07 Dec 2018 14:15:22 GMT</pubDate>
            <atom:updated>2018-12-07T14:15:21.838Z</atom:updated>
            <content:encoded><![CDATA[<h3>We are changing the interface of webpack-cli — here’s why</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6g60YCnJk7fz9V7ztzpkbg.jpeg" /><figcaption>Let’s make development smooth as waves</figcaption></figure><p>Every now and then we hear people make jokes about configuration being hard. It’s true, and webpack hasn’t been the most trivial tool to use when getting into web development.</p><p><strong>That’s why we are changing</strong> the interface and webpack. When doing this, we are making the CLI of webpack better to look at, simpler to use and easier for users to understand.</p><p><strong>With this goal in mind</strong>, we are confident that users will spend less time setting up the tool itself, to spending more time doing the fun part, actually developing the application. We do not want users to give up on web development once encountering webpack, rather we want to encourage people to have less configuration when starting and then making more advanced builds as they develop a traditional web application.</p><p><strong>One of the best search results </strong>from google had the word “<em>beginners guide</em>” in it, which indicates that we have made a bad job at making the CLI of webpack easy to use.</p><p><strong><em>We are sorry…</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*a_2nOnu-hemLLFuAXhopXw.png" /><figcaption>Norwegian words and some english</figcaption></figure><p><strong>Ives Van Hoorne</strong>, the creator of CodeSandBox made this great illustration of how development feels like. It makes sense, because we want the user to use less time figuring out how things work to have more time developing an application. As webpack itself is a tool that is flexible, we do not need to make a web application perfect at once, but rather over time and by setting good default values for users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/323/1*7RKbG5vMNbkiUG4l4PdUzQ.png" /></figure><p><strong>Webpack-CLI </strong>will try to set the best defaults for you, meaning that we will optimize your build as much as we can, making it easier for you to have a fast application with no configuration. We are also making it easier for users to start different kinds of configurations such as React, SAAS or similar. This will allow you as a user to run webpack-cli without having to specify anything. The good stuff.</p><h3>Removing flags</h3><p><strong>In the newest version of webpack-cli</strong>, we will remove a lot of specific flags that we think is too advanced to be in the CLI. We encourage users to write specific logic for their builds through a webpack configuration rather than writing a one-liner with 1337 characters.</p><p><strong>The result of this is</strong> that the new CLI will be cleaner, provide more clarity to new users, the output will (finally) be more prettier, less rubbish in the output of a compilation and we will set good defaults.</p><p><strong>Good defaults</strong> in this case would be that you will have performance optimizations out of the box, loading styles, files are easier based on your current project structure as well as development and production flags will be improved.</p><h3>Adding Flags</h3><p><strong>We will add a few new flags</strong> to make debugging and developing in watch mode easier,<strong> webpack-ui </strong>is going to be released later in v4, a <strong>merge flag</strong> to merge two configurations together will be added and finally, <strong>node flags</strong> are going to be supported.</p><p><strong>Webpack-UI will be released</strong> along with a command/flag named <em>webpack interactive</em>. These two flags are targeted for helping new users understand webpack in a graphical way, to debug webpack interactively and provider a more convenient platform to run webpack from rather than from the Command Line Interface.</p><p><strong>The changes are coming</strong> in the upcoming webpack-cli version, version 4.0.0 and it will be released in alpha by the end of December. We will release the CLI in a slow matter, to ensure that people reliant on the old CLI flag, will have backwards compatibility. A more detailed post along with proper documentation of how to migrate your application will be published soon as we release the alpha version for you to test and experiment with.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e8057f2eda1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/webpack/we-are-changing-the-interface-of-webpack-cli-heres-why-2e8057f2eda1">We are changing the interface of webpack-cli — here’s why</a> was originally published in <a href="https://medium.com/webpack">webpack</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[It's a wrap: Google  of Code]]></title>
            <link>https://medium.com/webpack/its-a-wrap-google-of-code-545c20d5388d?source=rss----b2f039622545---4</link>
            <guid isPermaLink="false">https://medium.com/p/545c20d5388d</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[webpack]]></category>
            <category><![CDATA[gsoc]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[google-summer-of-code]]></category>
            <dc:creator><![CDATA[Dhruvdutt Jadhav]]></dc:creator>
            <pubDate>Tue, 21 Aug 2018 12:42:20 GMT</pubDate>
            <atom:updated>2024-11-02T18:32:02.488Z</atom:updated>
            <content:encoded><![CDATA[<figure><a href="https://github.com/webpack/webpack-cli/graphs/contributors?from=2018-02-12&amp;to=2018-08-22&amp;type=c"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*COUOIgjnTRurgvVpsLLjWQ.png" /></a><figcaption>Contributors graph for webpack-cli</figcaption></figure><h3>Rebuilding Webpack CLI</h3><p>After more than <a href="https://github.com/webpack/webpack-cli/pulls?q=is%3Apr+author%3Adhruvdutt+sort%3Aupdated-desc+is%3Aclosed">52 merged PRs</a> and <a href="https://github.com/webpack/webpack-cli/graphs/contributors">75 commits</a> in webpack’s CLI, we are at the end of a journey.</p><blockquote>Webpack CLI encapsulates all code related to CLI handling. It captures options and sends them to webpack compiler. You can also find functionality for initializing a project and migrating between versions.</blockquote><h3><strong>Abstract Syntax Tree Optimisations 🌲</strong></h3><p>Abstract Syntax Tree or AST is a hierarchical tree-like representation of the code. It helps us understand and read relationships between different elements of the code. An AST transformation is an action of modifying this tree (i.e. changing an existing AST to a new AST).</p><p>Let’s take a look at how an AST looks for a simple webpack config like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fddd33ef9e2212c896e2d2ce3ff5435a/href">https://medium.com/media/fddd33ef9e2212c896e2d2ce3ff5435a/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7lZt8e7dJTclAT2qGpL9RQ.png" /><figcaption>AST representation of a webpack config with an entry prop</figcaption></figure><p>Each and every part of our code is formed of AST nodes which can be of various types like Object Expression, Member Expression, Literals, Variable Declaration, etc.</p><p>Once we have an AST of the full webpack config, we can manipulate or transform it for implementing useful features like migrating webpack configuration for version upgrades or also to add, update or remove properties from existing configurations.</p><p>For doing all the manipulations and transforms in AST, we use a library called <a href="https://github.com/facebook/jscodeshift/">jscodeshift</a> developed by Facebook. This is the same library which is used by React folks for developing <a href="https://github.com/reactjs/react-codemod">react-codemod</a>. jscodeshift provides a nice interface for playing around with AST paths, node builders and traversals.</p><p>We have a lots of <a href="https://github.com/webpack/webpack-cli/blob/master/packages/utils/ast-utils.ts">utility methods</a> written around the jscodeshift API which we use as wrappers in our commands. Earlier, we started with using a non-recursive approach towards AST transformations for generation of new AST nodes in the init command. As new features and cases came in and the nodes scaled, we realised that this was not an efficient way of handling transforms as each case needed to be handled differently depending on the kind of node we want to generate and attach to the tree. It was hard to maintain deep nesting for nodes as well. This resulted in a lot of code and utils which were hard to scale and maintain.</p><p>To fix this, we took a recursive approach for adding and updating AST nodes which handles all types of nodes and works with deep nesting implicitly. Hundreds of lines of code reduced to 50 lines recursive function. It was a huge maintenance improvement for team and potential to implement new commands like add/update. Kudos to Even Stensberg!</p><p>This enabled implementing add or update command which is one of the newest command we shipped a while ago that enables users to add new webpack properties from the CLI directly. We merged the logic used for creating and updating of AST nodes to support this new command.</p><p>Remove command is another newly released commands which is used for removing existing properties from webpack configuration files. Our end goal for this command was to remove a specific property from the config file without disturbing the rest of the contents and validating it.</p><p>One of the initial thoughts we had were to somehow reuse the recursive function used for adding so we thought of re-generating a new AST without the node selected to remove. This was costly due to regeneration of the entire tree. In fact, we didn’t need any recursive approach for removal of AST nodes as we only have to remove a targeted node leaving rest of the tree unaffected. For instance, in loaders/rules, we don’t need to drill recursively inside each option for each rule. We show a list of rules based on their names (picking up their loader property) and then a prompt to remove only a specific targeted rule object from the rules array. For objects like devServer, we show a list of keys like port, contentBase, filename, etc. It made more sense to follow the non-recursive approach for this use-case.</p><blockquote><strong>Some of the PRs that went into this work: </strong><a href="https://github.com/webpack/webpack-cli/pull/456"><strong>#456</strong></a><strong>, </strong><a href="https://github.com/webpack/webpack-cli/pull/461"><strong>#461</strong></a><strong>, </strong><a href="https://github.com/webpack/webpack-cli/pull/500"><strong>#500</strong></a><strong>.</strong></blockquote><h3>TypeScript migration</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ixc-aMq7jvdTl9uwgZSylw.png" /></figure><p>Migration from JavaScript to TypeScript was one of the most discussed <a href="https://github.com/webpack/webpack-cli/issues/245">open issue</a> for more than 6 months.</p><p>Introducing TypeScript gave a good stability to the codebase and help us trim down documentation at some places. It also unlocked code completion, prediction and reduced the likelihood of runtime errors and help form a good internal code documentation. It’s a big win for all.</p><p>We started with a gradual migration with help of allowJs flag so that we can migrate the codebase in chunks.</p><p><strong>TypeScript with Monorepos 📦</strong></p><p>Recently, we migrated to a monorepo strategy using lerna which allows us to ship small mono packages instead of a big monolith package. To follow the principles of mono packages, we integrated TypeScript build system not just at root level but also at every package level since each package should be independent of each other. We also setup linting using TSLint following our previous ESLint style.</p><p>One of the challenges we found while working with TypeScript is a little initial cost for setting up all the custom interfaces for all the methods and objects we’re using in the code. It’s definitely worthwhile of an exercise. To add typing support for npm modules, we straightaway went with the <a href="http://definitelytyped.org/">DefinitelyTyped</a> type definitions. Also, some of the modules like <a href="https://github.com/chalk/chalk/tree/master/types">chalk</a> come pre-bundled with types. For npm modules that neither come with types nor have DefinitelyTyped support, we created custom module interfaces again. Integrating custom module type definition is easy with help of <a href="https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html">Triple-Slash Directive</a> that uses a reference path but in most cases, the TS compiler is smart enough to pick all the declaration files. Using custom module types made us choose the signature and shape of each method and object exposed by the module. We needed to be cautious enough not to mismatch the underlying JS behaviour used by the libraries.</p><p>We also plan to add the missing modules to DefinitelyTyped by contributing the declaration files we created for the npm modules missing types. We haven’t done that already since we only wrote types for the method we were consuming in our codebase.</p><p><strong>TypeScript compiled code is not always backwards compatible ♻️</strong></p><p>The core entrypoint of the CLI is a bin folder which contains logic for handling of all the flags and command options. We decided to stick with JavaScript for this part of the codebase in order to keep friction low for new contributors who might not be familiar with TypeScript. We’re still evaluating how new contributions are impacting after this big change in language, style of coding and might shift to TypeScript for all files once we’re confident that everyone is comfortable with it.</p><p>In order to stitch TypeScript compiled code with this existing JavaScript code, we had to make some minor with the way we are importing this compiled code. One particular thing we would recommend is <a href="https://basarat.gitbooks.io/typescript/docs/tips/defaultIsBad.html">avoiding default exports</a> in TypeScript if you want to import your compiled JavaScript code into other parts of the codebase using JavaScript.</p><p>To understand one of the pain points of working with TypeScript and JavaScript code together, let’s take a look at how the TypeScript compiles code to JavaScript:</p><figure><a href="https://www.typescriptlang.org/play/index.html#src=export%20default%20function%20%28%29%3A%20void%20%7B%0D%0A%20%20%20%20%0D%0A%7D"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sFX25tiZMfDeeSNPBfgpNQ.png" /></a><figcaption>TypeScript to JavaScript compilation sample code</figcaption></figure><p>Notice how the compiler created a named export with variable default instead of module.exports. Now, in order to import this compiled module in JavaScript, we have to use a <em>require </em>syntax like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_QYqUIWAO2gYo319v7u8BQ.png" /><figcaption>Importing TypeScript compiled code in JavaScript files</figcaption></figure><blockquote><strong>Some of the PRs that went into this work: </strong><a href="https://github.com/webpack/webpack-cli/pull/511/"><strong>#511</strong></a><strong>, </strong><a href="https://github.com/webpack/webpack-cli/pull/550"><strong>#550</strong></a><strong>.</strong></blockquote><h3><strong>Migrate Configs - Webpack 3 to 4 🔢</strong></h3><p>webpack 4 (Legato) was released around 5 months back and is one of the biggest releases webpack has done.</p><p><a href="https://medium.com/webpack/webpack-4-released-today-6cdb994702d4">🎼webpack 4: released today!!✨</a></p><p>Most new use-cases worked out of the box with the new #0CJS support and sensible defaults. A lot of changes were made in the existing API to unlock higher optimisation levels. One of the biggest change in the public API is the transition from CommonChunkPlugin to SplitChunksPlugin.</p><blockquote>Originally, chunks (and modules imported inside them) were connected by a parent-child relationship in the internal webpack graph. The CommonsChunkPlugin was used to avoid duplicated dependencies across them, but further optimizations were not possible</blockquote><blockquote>Since webpack v4, the CommonsChunkPlugin was removed in favour of optimization.splitChunks.</blockquote><p>We want to make this transition smooth for our existing users using the nifty migrate feature we already had for migrating from version 1 to 2. We also show a nice little diff on what exact changes the CLI is going to do in the config during migration process.</p><p>We started with version 3 to 4 migration during mid-April and are happy to announce that we’re getting the final pieces to get in place for a smoother transition. We will release this big feature soon after some internal testing.</p><blockquote><strong>Some of the PRs that went into this work: </strong><a href="https://github.com/webpack/webpack-cli/pull/558"><strong>#558</strong></a></blockquote><h3><strong>Miscellaneous improvements</strong></h3><ul><li>Added autocomplete support for configuration properties for add command. <a href="https://github.com/webpack/webpack-cli/pull/502">#502</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*G6RRp8L1X8LGmm034jc8vA.gif" /></figure><ul><li>Upgraded major version for all dependencies. <a href="https://github.com/webpack/webpack-cli/pull/290">#290</a></li><li>Greenkeeper support for automating dependency management.</li><li>Support for custom paths to webpack configuration files for add command. <a href="https://github.com/webpack/webpack-cli/pull/501">#501</a></li></ul><h3><strong>Lessons Learned 💂</strong></h3><p>Working on big open-source projects and tough and exciting. The best part is having your work directly impacting hundreds of thousands of developers who use webpack.</p><p>There are a lot of learnings that comes along with experience and familiarity with the core team and community. Collaboration and team effort are key for the success to any large scale project.</p><p>Community matters a lot. We should never forget the end goal of what we’re trying to solve and always listen to what the community needs and the concerns they share.</p><p>Adapting to existing code and following design patterns help maintain consistency throughout the application. Always write composable, maintainable and loosely coupled code which makes scaling easy.</p><p>GSoC and webpack is probably the biggest breakthrough of my career. Can’t thank enough to Google and webpack for giving me this amazing platform. This opportunity definitely has a very huge impact on me. It has allowed me to <strong>grow from an open-source contributor to an open-source maintainer</strong>.</p><blockquote>Big shoutout to <a href="https://medium.com/u/f3e507726e9d">Even Stensberg</a>, <a href="https://medium.com/u/393110b0b9e4">Sean T. Larkin</a> and <a href="https://medium.com/u/cccc522e775a">Tobias Koppers</a> for helping me throughout the programme and being such a good mentors and teachers. ❤️</blockquote><h3><strong>Next on the CLI roadmap 🚀</strong></h3><p>Some of the things that we have next on the roadmap are refactoring the entrypoint folder to decrease some bloat and making it easier to maintain, improvements in the documentation along with the release of new commands and lots of user-experience revamp like an introduction of an interactive mode or dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*GvLS6xZ5AELFrkyfHzwhXg.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=545c20d5388d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/webpack/its-a-wrap-google-of-code-545c20d5388d">It&#39;s a wrap: Google 🌞 of Code</a> was originally published in <a href="https://medium.com/webpack">webpack</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>