This proposal introduces signals to JavaScript, aiming for a common direction akin to Promises/A+, focusing on ecosystem alignment for potential standardization. Originating from collaborations among authors of frameworks like Angular, Vue, and React, it seeks to define core semantics rather than developer-facing APIs, intending signals for underlying framework construction rather than direct application use. Early prototyping and integration into frameworks are planned before progressing beyond Stage 1, emphasizing suitability and benefits over existing framework-provided signals. Signals aim to simplify UI state management, offering an infrastructure for efficient state synchronization without the repetitive boilerplate, demonstrating potential through examples contrasting traditional JavaScript with proposed signals usage. The document outlines interoperability, performance, dev tools support, and standard library benefits as motivations, with an extensive API sketch provided for further development.
If you don't like the summary, just downvote and I'll try to delete the comment eventually 👍
Cool idea! Since you're aiming for ECMAScript, make sure it's a JavaScript polyfill. All of the polyfill's source code files are TypeScript files (`*.ts`). It looks like you've done some but not all of the conversion in the repo. Just wanted to point it out though.
Righto, another reason not to trust the proposal in my opinion. If you cannot write ECMAScript standardized javascript, and instead rely on a transpiler, you should not be modifying the standard.
Um... that seems like a pretty confusing statement.
All meaningful modern JS ecosystem libraries are written in TypeScript, for type safety. For that matter, it's fairly common to not do much in the way of "transpiling" in the sense of "converting the JS syntax to an older backwards-compatible equivalent" - it's just about stripping out the types at publish time.
But either way, that has no bearing on the validity of the proposal for a new data type to be considered for adding to the language. The polyfill is being written as a library to prove out concepts and API definitions. Long-term, that may get added internal to the engine side. But until then, it makes sense to write that library like you would any other JS-ecosystem library: using TypeScript for correct types and to work well with the rest of the ecosystem that expects TS types to be available when you use that library.
5
u/fagnerbrack Apr 16 '24
If you want a TL;DR:
This proposal introduces signals to JavaScript, aiming for a common direction akin to Promises/A+, focusing on ecosystem alignment for potential standardization. Originating from collaborations among authors of frameworks like Angular, Vue, and React, it seeks to define core semantics rather than developer-facing APIs, intending signals for underlying framework construction rather than direct application use. Early prototyping and integration into frameworks are planned before progressing beyond Stage 1, emphasizing suitability and benefits over existing framework-provided signals. Signals aim to simplify UI state management, offering an infrastructure for efficient state synchronization without the repetitive boilerplate, demonstrating potential through examples contrasting traditional JavaScript with proposed signals usage. The document outlines interoperability, performance, dev tools support, and standard library benefits as motivations, with an extensive API sketch provided for further development.
If you don't like the summary, just downvote and I'll try to delete the comment eventually 👍
Click here for more info, I read all comments