WinterCG will standardize browser APIs for JS server-side runtimes – The New Stack
The web-based Interoperable Runtimes Community Group, WinterCG for short, has core contributors from Cloudfare, Vercel, Shopify, and several other web heavy hitters. They want to standardize server-side APIs the same way browser APIs have been standardized for developer sanity.
Standardization practices are not new. Working under the aegis of the World Wide Web Consortium (W3C), the Web Hypertext Application Technologies Working Group (WHATWG), established in 2004, created the API standards for web browsers. Some of their work includes HTTP requests, web sockets, URL normalization, and streams.
Implementing these same standards in server-side environments has been a bit slower.
Code practices differ between server-side environments and web browsers. What are the current solutions? Polyfill? Hacked code to just “make it work”? Create new APIs? New middleware to adapt the API to the backend environment? WinterGC’s goal is to start changing that.
Why is this important for developers?
Flexibility. Modular and portable code for victory.
As someone who doesn’t write code with the intention of migrating to a new environment but who never says never, I also wouldn’t turn down the idea of trying something new with the familiarity of home .
The majority of my work is coded in Node.js but for my latest open source product I ventured into the unknown and developed in the Deno environment for the first time. There were ups and downs, but there was definitely a functional overlap. Uniformity in functional overlap is something I look forward to.
A good example of this disconnect in API implementation can be found in the implementation of Streams in Node.js. The Node.js implementation is incredibly close to WHATWG standardization and results in faster data flow than other browserless environments.
What WinterCG is and what WinterCG is not
For WinterCG, “interoperable on the web” means that implementing features in a way that is the same or at least as consistent as possible with how those features work in web browsers was very important to the group. So much so that it entered the first half of their name.
In practice, this means that the URL() constructor will perform the same functionality in web browsers as it does in Node.js, Deno, and Cloudflare Workers. URL() will remain consistent and standardized across the stack.
An important goal of adapting standards across the stack is to eliminate the need for each new environment to create its own APIs for common functionality. It is crucial to state that WinterCG will not create new APIs or its own set of standards that would compete with existing standards defined by the WHATWG.
The group will not focus on adapting functionality from one environment to another. The scope of WinterCG will remain focused on adapting continuity between functions that exist in web environments and Node.js, Deno and Cloudfare Workers or the three server-side environments without web browsers.
In the event that a new spec idea emerges from WinterCG, the group will submit the idea to WC3 and the WHATWG for consideration. If the WHATWG is not interested in moving forward, WinterCG has the agency to move forward as long as there is no conflict with existing web standards.
An important area to mention is Web Crypto Streams. The group is currently drafting a new specification for web cryptography streams for W3C review as part of a larger effort to update the web cryptography specification.
Cryptography is a sore point for the developer community as a whole, as the Web Cryptography API provides a minimal set of APIs for common operations. Other than Node.js, which is available as an embedded module, there is no support for streaming I/O to symmetric cryptographic algorithms. Thereafter, performance and scalability are limited. Hopefully the work of WinterGC will have an impact in this case.
Fetch is another pain point of inconsistency. Web browsers and server-side runtimes implement Fetch. Due to the discrepancies between use cases on the front-end and back-end in recovery specifically, WinterCG is working on documenting a subset of the recovery standard to account for the narrower scope of each implementation.
There is also a minimum list of APIs which can be found here.
The New Stack is a wholly owned subsidiary of Insight Partners, an investor in the following companies mentioned in this article: Deno.