<?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[Stories by Anton Kosyakov on Medium]]></title>
        <description><![CDATA[Stories by Anton Kosyakov on Medium]]></description>
        <link>https://medium.com/@antonkosyakov?source=rss-5d9acb98b6c8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*yec7JzpmVyhUv4oQ.</url>
            <title>Stories by Anton Kosyakov on Medium</title>
            <link>https://medium.com/@antonkosyakov?source=rss-5d9acb98b6c8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 06:59:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@antonkosyakov/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Sustainable Node.js development with only a browser]]></title>
            <link>https://medium.com/gitpod/sustainable-node-js-development-with-only-a-browser-4887bc6e737b?source=rss-5d9acb98b6c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/4887bc6e737b</guid>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[Anton Kosyakov]]></dc:creator>
            <pubDate>Fri, 14 Dec 2018 13:07:59 GMT</pubDate>
            <atom:updated>2018-12-14T13:07:59.373Z</atom:updated>
            <content:encoded><![CDATA[<p>Nowadays, there are many collaborative platforms for showcasing JS code snippets and frameworks. Most of them run in your browser, some even manage to magically run Node.js applications in the cloud. They abstract away many possibilities in order to focus on prototyping and learning.</p><p>This simplification (or even magic) eventually turns out to be a hard wall. Once we leave the prototype stage, we need to be able to control and freely combine different versions of frontend and Node.js frameworks, connect to the database that best fits our use case, use different JS flavors and deployment services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7zkVCKjkjvyutzD5hFn_Tw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/fQxMGkYXqFU?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Clark Young</a> on <a href="https://unsplash.com/search/photos/%22workshop%22?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>In this blog post, I will show you a transparent way of getting started with Node.js easily without the magic. The approach taken provides a low entry barrier without the wall once you grow out of it. You will learn how to write Node.js applications in a browser-based environment, that has all the depth of a full local dev environment with VS Code but the friendly onboarding of JSFiddle. These environments can be freely shared to work together and showcase your applications.</p><p>The dev environment is called <a href="https://www.gitpod.io/">Gitpod</a> and is entirely free for open-source development.</p><h4>Table of Contents</h4><ul><li><a href="https://medium.com/p/4887bc6e737b#b85f">Hello World</a></li><li><a href="https://medium.com/p/4887bc6e737b#8154">Automating Node.js setup</a></li><li><a href="https://medium.com/p/4887bc6e737b#1bc9">Working with Pull Requests</a></li><li><a href="https://medium.com/p/4887bc6e737b#77a3">Working Together</a></li><li><a href="https://medium.com/p/4887bc6e737b#84df">Developing full-stack Node.js applications</a></li><li><a href="https://medium.com/p/4887bc6e737b#8c36">Summary</a></li></ul><h3>Hello World</h3><p>Let’s get started by developing a simple “Hello World” application and learning the basics of Node.js development.</p><h4>Start a new project</h4><p>Gitpod treats any GitHub repository as a project which can be opened. Let’s start by creating a new repository for our Hello World project:</p><ul><li>open your GitHub dashboard and select New Repository;</li><li>enter a repository name and click Create repository.</li></ul><p>Now, we can open the created project in Gitpod. You can do it by simply prefixing the repository URL with gitpod.io#. For example, I’ve called my repository node-hello-world and it can be opened in Gitpod with <strong>gitpod.io#</strong>https://github.com/akosyakov/node-hello-world.</p><p>The first time, you will need to sign in Gitpod with your GitHub account. GitHub will ask you to authorize read access to your email address. Write access to repositories can be granted later on <a href="https://gitpod.io/access-control/">your access control page</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K8cn3G30eQouKmWQb228LQ.png" /></figure><p>Gitpod starts a new workspace, which is a Linux-based cloud container, and provides access to it via a VS Code powered online IDE. Workspaces are started on demand and automatically shut-down if you don’t use them. They are continuously replicated and never deleted, so you always can restart a workspace later from <a href="https://gitpod.io/workspaces/">your Gitpod dashboard</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mXM-VDzzmpXCvlAVvQIjVw.gif" /></figure><p><em>If you don’t want to create a new project from scratch, click on </em><a href="https://gitpod.io/#snapshot/0d82ae08-c328-4cb5-96e5-7233d5de0c11"><em>a snapshot link</em></a><em> of my workspace to try Hello World application. I will cover later how one can make a workspace snapshot.</em></p><h4>Writing a Node.js application</h4><p>By default, each workspace is preconfigured with standard tools like Node.js, npm, yarn and nvm. Later we will learn how to change the Node.js setup. Now, let’s code something and run it:</p><ul><li>open the command palette (F1) and select New File command;</li><li>create a new file with app.js name and type the following content:</li></ul><pre>const message = &#39;Hello World&#39;;</pre><pre>console.log(message, &#39;from Gitpod!&#39;);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*b-63v0Asfa09vfzG" /><figcaption>As you type, you can see that Gitpod validates your code. It also provides you with smart completions and documentation on hover.</figcaption></figure><h4>Run / Debug a Node.js application</h4><p>In order to run the application, type node app.js into the terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*KzrRQ41oARG7XoQB" /></figure><p>Of course, you can have more than one terminal to your cloud workspace.</p><p>Next up, let’s see how we can debug the application:</p><ul><li>create a debug configuration (Debug-&gt; Add Configuration) and select Node.js: Launch Program configuration snippet in the content assist of the opened editor;</li><li>add a breakpoint into app.js file, by clicking on the gutter on the left;</li><li>open the Debug View (View -&gt; Debug),</li><li>press the green play icon to start debugging (or press F5).</li></ul><p>Our program should run, and when a breakpoint hits you can inspect call stack, variables and even use the debug console to evaluate expressions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VHUqe81CKwdHq7uK" /></figure><h4>Working with Git</h4><p>Let’s have a look at how we can share our changes through Git. Open the Git view, stage your changes, enter a commit message and click commit. You can also open a diff editor by clicking on changed files and push new commits to GitHub with Git: Push... command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FqWgZy08qIkj3qVp" /></figure><p>If you have not granted write access to your repositories yet, Gitpod will ask for it. Grant permissions and try to push again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bHchL7DVfmfdYWqjWsqRaw.png" /></figure><h3>Automating Node.js setup</h3><p>As mentioned above each workspace by default is preconfigured with standard tools, like Node.js 8.x.</p><p>Let’s assume that we agreed on using Node.js 10.x for our project instead. Usually, all developers have to update their local Node.js versions and often switch between them depending on what project or branch is used.</p><p>With Gitpod, it is different. You can configure a workspace with a specific Node.js version for each branch via Docker images, without changing the local setup for any developer at all.</p><p>The easiest way to initialize the config is to use Gitpod’s CLI. The CLI will walk you through the most important configuration options and create a .gitpod.yml file that is located in the root of your repository.</p><p>In the terminal type gp init.</p><ol><li>For the first option choose: docker file. It will create a Dockerfile that sits next to .gitpod.yml. Here you can add any kind of tools and dependencies you will need for development. When starting a fresh workspace, Gitpod will pick that Dockerfile up and provide a cloud container based on that.</li><li>Now press enter until the tasks section. Type node app.js. The tasks are automatically started whenever a workspace gets started. You can have multiple tasks and use different lifecycles. Each task will be opened in a separate terminal.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*yVXQ8QGJEmCnNQ52" /></figure><p>The created files will be automatically opened in the editor. Let’s change the config so that it starts two tasks in separate terminals:</p><pre>image:</pre><pre>  file: Dockerfile</pre><pre>tasks:</pre><pre>  - init: node --version</pre><pre>  - command: node app.js</pre><p>And change the Dockerfile to use Node.js 10.x as the base image:</p><pre>FROM node:10</pre><p>To try it our we need to push the config back to GitHub and open a new workspace. Let’s do this through a pull request, so we learn about the GitHub integration on the way.</p><p><em>Here is </em><a href="https://gitpod.io/#snapshot/ea0d6704-a513-4c94-b8e7-fe72c3d8e5fb"><em>another snapshot link</em></a><em> to try our configuration without opening a pull request. You can learn more about workspace configuration </em><a href="https://docs.gitpod.io/40_Configuration.html"><em>here</em></a><em>.</em></p><h3>Working with Pull Requests</h3><p>Gitpod provides seamless integration with GitHub features like creating and reviewing pull requests.</p><h4>Creating a new Pull Request</h4><p>Let’s open a new pull request from Gitpod:</p><ul><li>commit your changes using the Git view (see above);</li><li>use Git: Checkout command or click the branch item in the status bar to create a new branch. Name it somehow, e.g. gitpodify;</li><li>next up open the Pull Request view on the right. You cannot create a new pull request yet, because first the new branch should be published to GitHub, click publish changes;</li><li>after that, the Pull Request view will be updated and you can open a new pull request.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vHysVOgVJaH6-j1t" /></figure><h4>Reviewing a Pull Request</h4><p>As I’ve mentioned at the beginning Gitpod treats each GitHub repository as a project. Actually, it is even smarter and can figure out from any GitHub URL which branch should be opened and how.</p><p>Let’s go to the pull request page on GitHub and prefix its URL with gitpod.io#, just like we did initially:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YXS_V_quV3Lg7Y-X" /><figcaption>Opening a PR with new workspace image can take some time since Gitpod needs to build the image. But it is only rebuilt when changed.</figcaption></figure><p>As you can see, Gitpod opens with a branch for your pull request. PR file changes are presented on the left sidebar to review. Our init and command workspace tasks are executed in terminals, Node.js is 10.x now, and Hello World is printed.</p><p>While reviewing in Gitpod, you can comment, change the code to address comments, suggest new changes, etc. When you are done, merge your pull request from Gitpod as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KIZkXiyQv3aZzsjA" /></figure><h3>Working Together</h3><p>Since Gitpod workspaces are running in the cloud, we can share them in similar ways how you share documents in Google Docs.</p><h4>Helping others with Node.js development</h4><p>You can share you running workspaces with colleagues to collaborate on exactly the same codebase, development tools, running terminals, and applications. It is particularly useful to assist each other on some tricky configuration, dependency or code problem.</p><p>In order to share a running workspace: click on your account avatar, select Share Running Workspace, enable sharing, copy a link and share the copied link with your colleagues.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yp7USviOYhUm_P40" /><figcaption>Both users use exactly the same workspace and see the shared output in terminals.</figcaption></figure><h4>Showcasing Node.js applications</h4><p>You can take a complete snapshot (clone) of your workspace, even including your IDE layout, and share it as a link. Think about workspace snapshots like code snippets on JSFiddle. It is useful in the same way: to share reproducible examples on issues, Stack Overflow answers, for tutorials and workshops. But at the same, you share the complete development setup and present it in the appropriate way.</p><p>In order to share a workspace snapshot: click on your account avatar, select Share Workspace Snapshot, copy a link and share the copied link where you want.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-n2I6-4fPuKK70_5" /><figcaption>The <a href="https://gitpod.io/#snapshot/14dc69f1-0e8c-4a36-b221-0ab16e91326e">shared workspace snapshot</a> preserves not only the development setup but the IDE layout and even selection in the editor.</figcaption></figure><h3>Developing full-stack Node.js applications</h3><p>So far, we’ve only had a look at a simple Node.js application. In case you wonder whether it will scale to sophisticated applications you can try any of the following repositories:</p><ul><li><a href="https://github.com/gitpod-io/nodejs-shopping-cart">Node.js Shopping Cart</a> is a reference Node.js application demonstrating how to use the Express framework. You can open it in Gitpod with <a href="https://gitpod.io/#https://github.com/gitpod-io/nodejs-shopping-cart">one-click</a> and follow along <a href="https://medium.com/gitpod/debugging-node-js-applications-in-theia-76c94c76f0a1">this blog post</a> explaining in details how to debug the app.</li><li>Gitpod is based on an open-source IDE framework — <a href="http://theia-ide.org/">Theia</a>. It’s built with a lot of JS technologies, including Node.js, Express, TypeScript and React. And, of course, <a href="https://github.com/theia-ide/theia/blob/master/doc/Developing.md#run-the-browser-example-with-gitpod">Gitpod is used to develop Theia</a>.</li><li>You even can develop Electron applications in Gitpod, like VS Code. Chris demonstrates it in <a href="https://medium.com/gitpod/developing-native-ui-applications-in-gitpod-15af2967c24e">this blog post</a>.</li></ul><h3>Summary</h3><p>Gitpod provides the complete Node.js development experience right from a browser. It enables you to automate your development setup, quickly onboard developers, streamline code review and testing processes on GitHub, help each other in real time, showcase your applications and setups. Also, it is entirely free for open source development!</p><p>If you have any questions, <a href="https://spectrum.chat/gitpod">join Gitpod Community on Spectrum</a>! We are listening intensely to all feedback.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4887bc6e737b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gitpod/sustainable-node-js-development-with-only-a-browser-4887bc6e737b">Sustainable Node.js development with only a browser</a> was originally published in <a href="https://medium.com/gitpod">Gitpod</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Debugging Node.js applications in Theia]]></title>
            <link>https://medium.com/gitpod/debugging-node-js-applications-in-theia-76c94c76f0a1?source=rss-5d9acb98b6c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/76c94c76f0a1</guid>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[gitpod]]></category>
            <category><![CDATA[theia]]></category>
            <dc:creator><![CDATA[Anton Kosyakov]]></dc:creator>
            <pubDate>Thu, 15 Nov 2018 17:39:12 GMT</pubDate>
            <atom:updated>2018-11-15T17:39:12.624Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://www.gitpod.io/">Gitpod</a> is based on the open-source <a href="http://theia-ide.org/">Theia IDE Framework</a>, which is highly inspired by VS Code, reuses its major components like the Monaco editor and intelligent-language support and is designed to run as a web application.</p><p>At TypeFox, we use Gitpod to develop Theia and all its satellite projects, like Theia extensions and language servers. We’ve discovered that for most use cases we don’t need to go to local development anymore. Development, testing, and the review processes are streamlined, leading from source code to a proper development environment accessible from a browser with a single click.</p><p>Up to now, there was one important use case that forced us back to local tools, because it was not supported by Gitpod: Debugging.</p><p>Now, it is available, and I would like to give you a run through the basics of Node.js debugging in Gitpod based on an example.</p><h3>Step 0: Open Node.js Shopping Cart example in Gitpod</h3><p>Start a new workspace for the example GitHub repository: <a href="https://gitpod.io/#https://github.com/gitpod-io/nodejs-shopping-cart">https://gitpod.io#https://github.com/gitpod-io/nodejs-shopping-cart</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WySkgfqLHyOkQq_c" /></figure><p>A new Gitpod workspace will be opened. Required dependencies are installed automatically since the repository is configured with <a href="https://docs.gitpod.io/40_Configuration.html">a .gitpod.yml file</a>. You can see it in the terminal, opened in the bottom area.</p><h3>Step 1: Start debugging</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/0*cm6tolHouEztvvuC" /></figure><p>In order to start debugging, you should open the debug view first. You can do it via Viewmain menu or with Ctrl/Cmd+Shift+D.</p><p>The debug view allows you to configure launch configurations, start and manage debug sessions. Configurations are persisted debugging setups. They are stored in a <a href="https://code.visualstudio.com/docs/editor/debugging#_launchjson-attributes">VS Code compatible format</a> in a launch.json JSON-file located in your workspace’s .theia folder. If your project already has the VS Code launch file, then Gitpod will recognize and use it instead.</p><p>Node.js Shopping Cart is an Express.js web-application. The repository already has a pre-configured Launch Program configuration, which starts the web server Node.js process in the debug mode. Let’s run it with F5 or by pressing the run button left to the configuration drop-down.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SUD-Cfy3YC86JJmgo1bLpA.png" /></figure><h3>Step 2: Preview the application</h3><p>A notification should pop-up suggesting you open an application side-by-side with an editor or externally, in a new browser tab. Let’s open it side-by-side to be able to debug and use our app at the same time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*65SBIeZyvn_31V9biYKNAQ.png" /></figure><p>Take your time and play with the app. You can review items to buy and in your cart, move them into or out of your cart.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M6KN6axYYOW8iqlnqsXpVw.png" /></figure><h3>Step 3: Pause on a breakpoint</h3><p>In this step we debug what happens when a user navigates to the homepage.</p><p>First, we need to add a breakpoint to the routing logic. It is defined in routes/index.js. You can open that file from the navigator or using the quick file palette (Ctrl/Cmd+P) .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6ni4GKFo9FFJoh_r8lvLVg.png" /></figure><p>Next, add a breakpoint in the editor margin against a line which you want to debug. A route callback handling / path looks promising.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AaqYqH5LILFw4g0-jNu5Bg.png" /><figcaption>Breakpoints are displayed in the debug view and applied to currently running sessions.</figcaption></figure><p>Now, in the app, try navigating to the homepage. The debug session will pause on the breakpoint. You can traverse the current stack trace, inspect variables and control the execution flow with the debug actions toolbar:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*Ru0MXHEcU_RzQEAKX30seA.png" /></figure><h3>Step 4: Inspect and modify data</h3><p>There are several ways to see variables’ values:</p><ul><li>you can traverse current scopes and variables in the debug view;</li><li>you can hover over expressions in the editor to evaluate them with a current session;</li><li>or you can use the debug console (REPL) to evaluate custom expressions.</li></ul><p>You can always double-click on any variable to modify its value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_zf4PL_AWfzeBZlp2mRjZQ.png" /></figure><h3>Next steps</h3><p>Debugging is an important feature to provide the complete development experience. The Node.js debugging support is the first step for Gitpod in this direction. We are working to bring more debug features and add support for more runtimes. We would also love to hear what features and runtimes you want to see supported. <a href="https://github.com/gitpod-io/gitpod/issues/new/choose">Tell us</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76c94c76f0a1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gitpod/debugging-node-js-applications-in-theia-76c94c76f0a1">Debugging Node.js applications in Theia</a> was originally published in <a href="https://medium.com/gitpod">Gitpod</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>