Posts

Showing posts with the label webdev

Looking back on 2015: six exciting web technologies

In 2015, there was an amazing amount of innovation related to the web platform. The following sections describe six technologies that I find exciting: Electron React Native Progressive web apps Visual studio code Rollup Web Assembly This blog post is a loose follow-up to “ Web platform: five technologies to look forward to in 2014 ”, which I wrote in early 2014. Electron Electron (by GitHub) lets you build cross-platform desktop apps with web technologies. Its features include: Automatic updates Crash reporting Windows installers Debugging and profiling Native menus and notifications Electron was initially created for GitHub’s editor Atom and is now used by various companies, including Microsoft (Visual Studio Code, see below), Slack and Docker. Architecturally, Electron contains both a Node.js runtime and a minimal embedded Chromium browser. Electron apps run in several processes: A main process runs the main script specified by the app’s package.json file. To display a user inte...

Mobile-friendly web pages

Google has announced that they are marking web pages as “mobile-friendly” in their search results . I was initially worried about this, because many websites have mobile-specific versions that are worse than their desktop versions on mobile devices. I also don’t like being auto-forwarded to mobile locations (e.g. from www.example.com to m.example.com ), because it prevents URLs from being universal. However, Google’s criteria for mobile-friendliness are reasonable: Pages must… Avoid software that is not common on mobile devices, like Flash Use text that is readable without zooming Size content to the screen so users don't have to scroll horizontally or zoom Place links far enough apart so that the correct one can be easily tapped Google’s blog post gives tips for ensuring that your page is recognized as mobile-friendly. It seems like a similar approach could be used for checking whether pages are accessible.

SimpleHTTPServer: a quick way to serve a directory

Python’s SimpleHTTPServer is the classic quick solution for serving the files in a directory via HTTP (often, you’ll access them locally, via localhost ). This is useful, because there are some things that don’t work with file: URLs in web browsers. Using SimpleHTTPServer SimpleHTTPServer is invoked like this (the parameter <port> is optional): python -m SimpleHTTPServer <port> (On OS X, Python is pre-installed and this command works out of the box.) Let’s look at an example of using SimpleHTTPServer: During the following Unix shell interaction, I first list the files in the current directory and then start SimpleHTTPServer to serve it. $ ls . foo.html $ python -m SimpleHTTPServer Serving HTTP on 0.0.0.0 port 8000 ... Afterwards, I can access the following URLs: http://localhost:8000/ lists the files in the current directory (namely, just foo.html ). If there were a file index.html , it would be displayed, instead. http://localhost:8000/foo.html disp...

The interoperability of Web Component polyfills

At the moment, there are two polyfills for the upcoming Web Components standard (roughly, for widgets): Polymer by Google X-Tag by Mozilla Fortunately, the three ways of writing a Web Component (via the Polymer polyfill, via the X-Tag polyfill or by using the APIs directly) are interoperable. Quoting “ Custom Element Interoperability ” by the Polymer team: We’re happy to say that, yes, custom elements of any variety (be they Polymer, X-Tag or vanilla) can all happily coexist. The blog post explains how that works and provides an example that you can download from GitHub. Third Web Component polyfill: @b_lionel told me about Bosonic , which is partially based on Polymer and also interoperable .

Web platform: five technologies to look forward to in 2014

This blog post describes five technologies that will make 2014 an exciting year for the web platform: asm.js: near-native performance on the web ParallelJS: parallelized JavaScript code ECMAScript 6 (ES6): evolving the language, uniting the community Web Components: a standard infrastructure for widgets CSS Grid Layout: native-like GUI layout asm.js: near-native performance on the web What it is: a subset of JavaScript that runs fast on current engines (about 70% of compiled C++ code, at the moment). Why it is exciting: Near-native speed in web browsers. Tightly integrated with JavaScript. Already compatible with all existing JavaScript engines. An engine optimizing asm.js code takes more work, but can be implemented incrementally. More information: “ asm.js: closing the gap between JavaScript and native ” ParallelJS: parallelized JavaScript code What it is: This project was born under the name “River Trail” and parallelizes JavaScript code that uses ...

Hello Polymer: Q&A with Google’s Polymer team

Image
Today, there was an online event called “Hello Polymer”, in which Polymer team members Eric Bidelman, Alex Komoroske and Matthew McNulty talked about the framework. This blog post summarizes what happened. The actual video of the event starts at 2:40 . Goals and nature of the project Web components are a set of APIs (shadow DOM, templates, custom elements, etc.) that will enable cross-framework widgets and user interface elements for the web. The main goal of the Polymer project [1] is to help with designing those APIs. To that end, it polyfills them on modern browsers so that experience with them can be gained – with real projects. The Polymer team closely collaborates with web standards bodies, contributors to various frameworks and the Blink team. The following diagram describes the architecture of Polymer: platform.js : The red parts are shims [2] for upcoming APIs. These shims will be used by most frameworks in the future and eventually be replaced by native APIs. p...

Running code fast in web browsers: PNaCl versus asm.js

The main point of the blog post “ Thoughts on asm.js vs PNaCl ” (by Gregg Tavares) is: It just seems like asm.js and PNaCl are closer than people are admitting. Some of the other points he is making are more controversial, so be sure to read the comments to get the complete picture. Comparing the two solutions PNaCl [1] and asm.js [2] are Google’s and Mozilla’s solutions for running code with (near-)native speed in web browsers. asm.js is a minimal solution. It being based on JavaScript give it three advantages: asm.js code already runs in all current JavaScript engines, albeit much slower than in an asm.js-optimized engine. Easy to standardize: asm.js semantics is derived from JavaScript and thus very easy to define, because it can be based on the ECMAScript specification. Easy to port: an asm.js implementation is based on a JavaScript engine, meaning comparatively little work is required to create one. As an aside, standardization is a requirement for portab...

Plans for supporting Web Components in AngularJS and Ember.js

Web Components [1] are an upcoming standard for custom HTML5 user interface elements. Those UI elements will eventually become interchangeable between frameworks. Now the people behind AngularJS and Ember.js have described their plans for supporting Web Components. Below, you’ll see mentions of Google’s new framework, Polymer [1] . It is built directly on top of Web Components. One of Polymer’s goals is to help refine and fully figure out that standard. AngularJS In an entry on Google Groups, AngularJS co-creator Miško Hevery writes: We're in early stages of designing Angular 2.0, but some of our goals are: Angular will use the underlying web platform features available to it (e.g. Node.bind, template integration, Custom Elements, etc...) Web Components (Polymer, Ember, or any other framework/library) will work seamlessly within Angular apps and directives. Components written in Angular will export to Web Components (to be used by Polymer, Ember, or any other framework/library). ...

Google’s Polymer and the future of web UI frameworks

Updates: [2013-07-16] Hello Polymer: Q&A with Google’s Polymer team [more information on Polymer] [2013-05-23] Plans for supporting Web Components in AngularJS and Ember.js At Google I/O 2013, Google presented a new web user interface (UI) framework called Polymer . The way it works is indicative of the future of all web UI frameworks. Polymer Polymer is composed of the following layers: Foundation (platform.js): Foundational building blocks. Most, if not all, of these APIs will eventually become native browser APIs. Core (polymer.js): Helpers complementing Foundation. Elements: UI and non-UI components built on Core. The Foundation layer (platform.js) The Foundation layer comprises the following technologies: DOM Mutation Oberservers and Object.observe() (probably ECMAScript 7): for observing changes to DOM elements and plain JavaScript objects. Pointer Events : handle mouse and touch in the same manner, on all platforms. ...

Google’s Blink: a few interesting facts

With Blink , Google has created a permanent fork of the WebKit HTML engine. This blog post mentions a few interesting facts that provide context for that decision. How much did each company contribute to WebKit? There are several interesting diagrams and numbers in the article “ Reviewers and companies in the WebKit project ” (by Daniel Izquierdo Cortázar for Bitergia). It’s remarkable how much Google has recently contributed to WebKit. Obviously, not all contributions are created equal: some benefit everyone, others only the contributor. We don’t know what the ratio between the two kinds is for Apple, Google, etc. Why didn’t WebKit2 adopt Chrome’s multiprocess architecture? Here is an Apple employee’s explanation of why WebKit2 has a multiprocess architecture that is different from Chrome’s: Before we wrote a single line of what would become WebKit2 we directly asked Google folks if they would be willing to contribute their multiprocess support back to WebKit, so that we could bu...

Will the term “web platform” replace “HTML5”?

Image
When it comes to platforms for implementing applications, the term “web platform” seems to increasingly replace “HTML5” (which itself has largely replaced “Ajax” [1] ). In this context, both terms denote the programming platform of web browsers. The former includes JavaScript. The latter doesn’t, strictly speaking, but it includes JavaScript-based APIs. Why “web platform” is a good choice This is a positive development, for three reasons. First, “web platform” better describes the actual platform: the “HTML” in “HTML5” suggests “everything in web browsers except JavaScript”, but JavaScript is an integral part of the platform. Second, including a version number unncessarily constrains the lifetime of “HTML5”. Third, people know what the web is and we already talk about “web apps”. So, saying that web apps are based on the web platform is fitting. Accordingly, when the web community got together to better document web development, the name “web platform” was chosen for what was to be doc...

HTML5 context menus in the wild: Twitter’s “Follow” button

Twitter’s “Follow” button has an HTML5 context menu [1] . The button below allows you to try it out. On Firefox, you get a context menu whose top three items are “Follow”, “@rauschma on Twitter” and “Tweet to @rauschma”. Alas, other browsers don’t support the customization of context menus, yet. Follow @rauschma jQuery contextMenu is a polyfill [2] that works on all browsers and uses HTML5 on Firefox. There are plans to parse HTML5, but they are waiting for a second HTML5 implementation before they do that. References: HTML5 context menus in Firefox 8+ What is the difference between a shim and a polyfill?

The Edge 2013 videos are online

Edge 2013 was a web development conference that took place on February 9, 2013, in London. Its approach was different from most conferences. Quoting the website : Edge is a different kind of conference, for developers with experience to share, who want to see and bring improvements to the web platform. Our emphasis is on creating a good environment for productive debate and discussion, rather than presenting the experiences of a single speaker. Each themed session is an hour long, and starts with a maximum 10 minute talk by an expert in that topic, outlining the current state of the platform in that area. [...] The remainder of the session will be given over to an open but structured discussion, with a professional moderator and a panel of seasoned developers who have in-depth knowledge of the subject. [...] Session participants will include [...] a notetaker to record the discussion so we can share it on the web later. Now the videos are online: Panel 1: Offli...

Tweets with Internet Explorer usage statistics

People are posting Internet Explorer usage statistics on Twitter, tagged with #postyourIEstats (link works without being logged in). Summary: IE6 is mostly dead, as it should be. IE7 and IE8 still see considerable usage, but it’s on the decline. IE9 is currently most popular. As of 2012-11-15, it is the oldest Internet Explorer still supported by Google. IE10 usage is still low.

Web development: 2012 & forward

Functionn is a blog on open source web development. Today, they published an interview with me and several other people (including DailyJS’s Alex R. Young) covering various web-development-related topics. They asked the following questions: Tell us a little bit about yourself. How has 2012 been to you? What have you been working on lately? Now that 2012 is over, what do you think were some of the most exciting developments in the world of web development this year? What web development tool/library/framework/mindset shift has impressed you most in 2012? (You can talk about as many as you wish here). Which single tool/library/framework/mindset shift would you recommend other developers to use/put to work? What most excites, scares and disappoints you about the web today? One word to describe the web as it is today? How do you see the web change in 2013 and beyond? What do you look forward to in 2013? If you had the superpower to change something in the world, what would you change? :-...

Responsive web design versus adaptive web design

This blog post looks at the difference between responsive web design and adaptive web design. Before we can get started, we need to define another concept: progressive enhancement . Progressive enhancement Progressive enhancement is a way of designing a web application that has to work in a wide variety of environments (desktop computers, mobile devices, etc.). You start with a version for the least capable environment, check for additional capabilities and add features accordingly and dynamically (on the fly). The term “progressive enhancement” has been invented by Steven Champeon, in 2003. Responsive web design Ethan Marcotte coined the term “responsive web design” in a blog post in May 2010. He describes it thusly: Fluid grids, flexible images, and media queries are the three technical ingredients for responsive web design , but it also requires a different way of thinking. Rather than quarantining our content into disparate, device-specific experiences, we can use media quer...

A new way of delivering Retina images on the web

Recently, high-resolution screens (Apple calls them Retina displays) have become popular – first on cell phones, then on tablets and now on laptops. I have been waiting for those for literally decades: all other computer components (memory, processor speed, etc.) improved predictably, but screen resolutions did not get much better over the years. The problem for web developers is that things look nicely on these displays if resolution-independent mechanism are used: fonts, vector graphics, CSS effects, etc. However, with bitmap graphics, you are forced to deliver images with many more pixels. That has the potential of greatly slowing things down on the web if you are using a Retina device. Daan Jobsis has found an interesting solution: Use a high-resolution JPEG image, but but with an extreme compression rate (e.g. 75%): [...] this image was razor sharp. The difference is even noticable on the iPad 1, 2 and normal computer screens. How bizarre, the filesize is smaller than the orig...