proposal-shadowrealm
proposal-shadowrealm | proposal-built-in-modules | |
---|---|---|
19 | 4 | |
1,376 | 891 | |
1.2% | 0.3% | |
6.0 | 0.0 | |
13 days ago | 11 months ago | |
HTML | HTML | |
- | BSD 2-clause "Simplified" License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
proposal-shadowrealm
-
Updates from the 98th TC39 meeting
ShadowRealm: ECMAScript Proposal, specs, and reference implementation for Realms [Stage 3 -> 2].
-
Should you use jest as a testing library?
You can't out of the box. There is an open issue on the Node.js repositoryto let the node:vm module to use the vm's context, but it is still open. It seems that the Node.js core team is interested in fixing this problem by implementing the new ShadowRealm spec, and I think we will make some progress during 2023.
-
Building an Extension System on the Web
ShadowRealms — a successor of the Realms proposals, this API is intended for use cases exactly like plugins or extension systems, providing an option for creating distinct global environments to run the code in. While not entirely secure on its own, this API could provide a strong foundation to build actual extension systems on the Web. That said, 4 years later, the TC39 proposal is currently only at stage 3, not implemented by any browser;
-
Vitest vs Jest benchmarks on a 5 year old real work SPA
With --no-isolate it was 2.8x faster than vitest and 1.7x faster than Jest, but 19 tests failed (see table above). Some people report issues with watch mode when using --no-isolate. So I decided to not pursue it any further. Once the vm module that Vitest relies on supports ESM, or when the amazingly named Shadow Realms are added to JavaScript, we will likely get this performance boost for free without the downsides.
-
Improving Vitest Performance
If ShadowRealms are ever added to EcmaScript (and implemented into V8/Node) they'll allow for a different approach to isolating code that would be faster without the downsides of sharing global.
- Virtualization is not an important enough use case for the web platform to tradeoff ergonomics and possible confusion for web devs, who by and large […] do not understand the separation between the specs. More to the point, they really shouldn't need to.
-
Is there an npm package for perchance?
Eventually I will get around to creating a "proper" package by just grabbing all the JS that is loaded by the code in the iframe, and bundling it up. We really need the ShadowRealm proposal to go through because the perchance engine messes with a lot of JS internals, so it would mess up the rest of your app. Could do it in a WebWorker, but then everything would have to be async.
-
Show HN: Run unsafe user generated JavaScript in the browser
The upcoming JavaScript Shadow Realms proposal looks like it solves a similar problem: https://github.com/tc39/proposal-shadowrealm/blob/main/expla...
- Named Element IDs Can Be Referenced as JavaScript Globals
-
Running user code in the browser (for a leetcode clone)
Browser-based JavaScript doesn't yet have a way to isolate code fully in this manner though there is a new JavaScript feature on the way that would provide this capability. Its called ShadowRealm and would basically give you a new global context to execute code that's completely separate from your main document code.
proposal-built-in-modules
-
Turboprop: JS Arrays as Property Accessors!?!
There is proposal for stdlib, but it will take some time until (if ever) it will reach stage 4.
-
Don't make me think, or why I switched to Rails from JavaScript SPAs
The working group most in charge of JS is ECMA's TC-39 (TC => Technical Committee) [0]. They've been taking a very deliberate, slow path to expanding the "standard" library because they take a very serious view of backwards compatibility on the web. Some proposals were shifted because of conflicts with ancient versions of things like MooTools still out in the wild, for instance. (This was the so-called "Smooshgate" incident [1].)
This may speed up a bit if the Built-In Modules proposal [2] passes, which would add a deliberate `import` URL for standard modules which would give a cleaner expansion point for new standard libraries over adding more global variables or further expanding the base prototypes (Object.prototype, Array.prototype, etc) in ways that increasingly likely have backwards compatibility issues.
TC-39 works all of their proposals in the open on Github [3] and it can be a fascinating process to watch if you are interested in the language's future direction.
[0] https://tc39.es/
[1] https://developers.google.com/web/updates/2018/03/smooshgate
[2] https://github.com/tc39/proposal-built-in-modules
[3] https://github.com/tc39/proposals
-
What NPM Should Do Today to Stop a New Colors Attack Tomorrow
There is a TC39 proposal for a "Javascript Standard Library." It's at stage 1, which is better than stage 0.
https://github.com/tc39/proposal-built-in-modules
-
[AskJS] What is the thing you hate the most about JS?
The standard library is a tough one. There is a proposal for built-in modules but it is very early days and miles away from what is needed. Clojure ships with functions that make the likes of Lodash and Ramda redundant. I think for a dynamic language an extensive library of functions for manipulating collections is essential. It is a real thing that once dynamic language codebases grow too big, they become a challenge to maintain. Therefore having functions that do a lot of common tasks for you mitigates that issue. Paired with immutability, lots of code just becomes data passing through pipelines, giving less surface area for bugs and making everything more concise and declarative.
What are some alternatives?
wtfjs - 🤪 A list of funny and tricky JavaScript examples
openapi-typescript-codegen - NodeJS library that generates Typescript or Javascript clients based on the OpenAPI specification
Pentive - Collaborative Spaced Repetition
proposal-pattern-matching - Pattern matching syntax for ECMAScript
vm2-process - Execute unsafe javascript code in a sandbox
proposal-observable - Observables for ECMAScript
vrite - Open-source developer content platform
redwood - The App Framework for Startups
caja - Caja is a tool for safely embedding third party HTML, CSS and JavaScript in your website.
proposal-record-tuple - ECMAScript proposal for the Record and Tuple value types. | Stage 2: it will change!
LavaMoat - tools for sandboxing your dependency graph
Nest - A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript 🚀