Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
proposal-record-tuple
ECMAScript proposal for the Record and Tuple value types. | Stage 2: it will change!
-
firehoser
Discontinued A wrapper around AWS Kinesis Firehose with retry logic and custom queuing behavior. Requires node >= 6.0.0
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
and kudos also belong to the people whove been heavily championing and bikeshedding the proposal on behalf of the rest of us for the last 8 years - which i just discovered is really nicely documented in the repo: https://github.com/tc39/proposal-pipeline-operator/blob/main...
there's usually a ton of nuance behind the syntax considerations and i usually find that the people on tc39 care way more than i do about the things i never think about until its too late. peeking into their discussions is often very enlightening... and a reminder of how hard it is to do language design by committee and at scale.
There was also a different proposal that allows objects to be extended: https://github.com/tc39/proposal-bind-operator
Personally, I don't use classes much, but sometimes I think free functions a little bit hard to find, so I tend to experiment with the following pattern.
interface User { … }
const User = {
Mozilla created SweetJS over a decade ago[0]. It added hygenic macros to JS and I'm sure everyone on the TC39 committee is familiar with it.
There's a lot to like about it, but macros in such a complicated language as JS are hard to get right. They'd also potentially lead to huge fracturing in the JS ecosystem with different factions writing their own, incompatible macro-based languages.
Look at JSX for an example. It's actually a subset of a real standard (E4X -- actually implemented in Firefox for a long time), but just one relatively small syntax addition has added complexity elsewhere.
For example, `const foo = (x:T) => x` is valid Typescript for a generic arrow function, but is an error if your file is using JSX.
I like the idea of macros, but I suspect they made the right call here.
[0] https://www.sweetjs.org/
I hope Records & Tuples[0] land before this does. It would have meaningful and far reaching positive effects for the language, without much controversy. Like most of these things, it takes about 5-7 years for it to permeate through enough of the engines to be meaningfully useful in the day to day of web developers (node / deno typically 12-18 months tops). It would drastically speed up existing code once wide adoption is gained though.
I don't think the Pipe Operator would be as useful in comparison
[0]: https://github.com/tc39/proposal-record-tuple
https://github.com/mirusresearch/firehoser/blob/46e4b0cab9a2...
and this
return moment(input).utc().format('YYYY-MM-DD HH:mm:ss')
> They should repurpose `do` so that `do {}` (without the `while`) is an expression that you can put statements inside and return the last statement.
There's a proposal for precisely that. Unfortunately, only Stage 1 though.
https://github.com/tc39/proposal-do-expressions