wtfjs
proposal-shadowrealm
Our great sponsors
wtfjs | proposal-shadowrealm | |
---|---|---|
94 | 19 | |
33,956 | 1,365 | |
- | 1.7% | |
0.0 | 6.0 | |
5 months ago | 4 days ago | |
JavaScript | HTML | |
Do What The F*ck You Want To Public 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.
wtfjs
- Milyen hasznos Github repokat ismertek?
- doNotDespairEverythingIsAhead
-
Companies: We can't find any good candidates!!! Also companies:
Me in the interview: "Generally, no, a variable can only be assigned one numeric value at a time. However, Javascript is famous for unpredictable behaviors in variable comparison statements, for instance [] == ![]. There's actually a whole library built around documenting this type of behavior this for comedic value, and other more serious libraries geared towards solving the problem. So it's possible that some obscure variable assignment scenario would result in that line evaluating as true, but it's not something you'd expect to encounter in the real world. This has gotten a lot better with typescript and es2022, but still something you need to watch for a bit."
-
“Go is hard to justify unless at massive scale”
I do see that point of view, didn't think of that, there are some aspects of go which are a bit weird if you never touched lower abstraction languages, yet once you learn what they are, you are all set and you can code in anything. go has the least amount of gotchas I have seen in any programming language. compare it with loads of the weird stuff javascript does https://github.com/denysdovhan/wtfjs and go is like heavenly lol
- Typescript is polishing a turd
- 3 < 2 < 1 === true
- Show HN: Whatdoesthiscodedo.com – AI explanations for other people’s code
-
Learning Frontend/React is the new rat race.
Its a very poorly designed language. Its syntax and semantics are often confusing and unpredictable. There is no well defined mental model of how constructs work in this language.
-
🚀 8 GitHub Repositories to learn JavaScript
WTF JS
-
Awesome Github Repos to Master JAVASCRIPT
😎 A great guide to Javascript that is both simple and wonderful, but also difficult and fun that seems like bullshit. -> wtfjs
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.
What are some alternatives?
Power-Fx - Power Fx low-code programming language
Pentive - Collaborative Spaced Repetition
jsfuck - Write any JavaScript with 6 Characters: []()!+
vm2-process - Execute unsafe javascript code in a sandbox
html-over-the-wire - HTML over the wire: List of frameworks which receive HTML snippets from the server.
vrite - Open-source developer content platform
wtfpython - What the f*ck Python? 😱
caja - Caja is a tool for safely embedding third party HTML, CSS and JavaScript in your website.
typegoose - Typegoose - Define Mongoose models using TypeScript classes.
LavaMoat - tools for sandboxing your dependency graph
window.fetch polyfill - A window.fetch JavaScript polyfill.
rua - Build tool for Arch Linux providing control, review and jailed build options