Serg Hospodarets Blog

Serg Hospodarets blog

Web frontiers
Serg Hospodarets
Web Share API brings the native sharing capabilities to the browser

For many years the Web is moving towards the parity with the Mobile native applications and adds the missed features. Today browsers have most of them, from the offline mode and enhancements with the Service Workers to Geolocation and NFC.

The one huge ability, which is still missed, but highly used in the mobile applications- the ability to share a page, article or some specific data.

The Web Share API is the first step to fill the gap and bring the native sharing capabilities to the Web.

...
Read full post  >
Native ECMAScript modules: the new features and differences from Webpack modules

In the previous article Native ECMAScript modules - the first overview I described the history of the JavaScript modules and the current situation with the native ECMAScript modules implementation:

For now, we have 2 available implementations, which we tried and compared to the bundled module.

The main takeaways, so far, are:

  1. To execute a script or load an external file and execute it as a module use <script type="module">
  2. .js extension cannot be omitted in the import (the exact URL should be provided)
  3. the modules’ scope is not global and this doesn’t refer to anything
  4. native modules are in the strict mode by default (not needed to provide 'use strict' anymore)
  5. module scripts are deferred by default (like <script type="text/javascript" defer />)

In this article, we are going to understand other differences with the bundled modules, abilities to interact with the module scripts, how to rewrite Webpack modules to native ES ones and other tips and tricks.

...
Read full post  >
Native ECMAScript modules - the first overview

All the major browsers shipped the native JavaScript modules support out of the box:

which means, the time we can use them without module bundlers/transpilers has come.

To understand better how we come to this point let’s start from the JS modules history and then take a look at the current Native ES modules features.

...
Read full post  >
Node.js debugging with Chrome DevTools (in parallel with browser JavaScript)

Recently Paul Irish described how you can debug Node.js applications with Chrome DevTools.

Since that time Chrome DevTools have evolved and the step, where you had to open the separate page with a specific URL to debug the Node.js code, was removed.

It means, today you can debug your browser JavaScript files and Node.js ones in the same DevTools window in parallel, which makes the perfect sense.

Let’s take a look how it works.

...
Read full post  >