Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
throwitaway1123
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
8 ms
·
1.
▲
by
throwitaway1123
1y ago
There's actually a library called ast-grep which does something very similar to what you're describing. They have an example in their introduction which performs a find and replace operation on a JS AST using a pattern: ast-gr
2.
▲
by
throwitaway1123
1y ago
For anyone looking for context on smooshgate: https://developer.chrome.com/blog/smooshgate
3.
▲
by
throwitaway1123
1y ago
Yes, as you pointed out, not only can bundlers tree shake namespace imports, but they're literally used in the esbuild documentation to demonstrate the concept of tree shaking. The issue you linked to is referring to the case in which
4.
▲
by
throwitaway1123
1y ago
Alternatively, with namespace imports in JS you can write [1]: import * as someLibrary from "some-library" someLibrary.someFunction() Which works pretty well with IDE autocomplete in my experience. [1] https://
5.
▲
by
throwitaway1123
1y ago
Somewhat related: you technically can access some type metadata in TypeScript at runtime using the `emitDecoratorMetadata` and `experimentalDecorators` tsconfig options, along with Microsoft's `reflect-metadata` polyfill package. There
6.
▲
by
throwitaway1123
1y ago
> I do wonder if this makes the importable gets (via type: json) a reality like assert was going to. Yes, the JSON modules proposal is finished. https://github.com/tc39/proposal-json-modules https://caniu
7.
▲
by
throwitaway1123
1y ago
Which browsers have you tested this in? I ran the feature detection script from the Chrome docs and neither Safari nor Firefox seem to support fetch upload streaming: https://developer.chrome.com/docs/capabilities/
8.
▲
by
throwitaway1123
1y ago
Enums and parameter properties can be enabled with the --experimental-transform-types CLI option. Not being able to import TypeScript files without including the ts extension is definitely annoying. The rewriteRelativeImportExtensions tscon
9.
▲
by
throwitaway1123
1y ago
In Node 22.7 and above you can enable features like enums and parameter properties with the --experimental-transform-types CLI option (not to be confused with the old --experimental-strip-types option).
10.
▲
by
throwitaway1123
1y ago
Node does have a permissions system, but it's opt in. Many runtimes/interpreters either have no sandbox at all, or they're opt in, which is why Deno's sandbox is an upgrade, even if it's not as hardened as iptables
11.
▲
by
throwitaway1123
1y ago
> you can't just allow exact what you need in that category? You have to allow the entire category and then deny everything you don't want/need? No, you can allow access to specific domains, IP addresses, filesystem paths,
12.
▲
by
throwitaway1123
1y ago
The repeat directive I mentioned as an example of a custom looping control flow construct used in a tagged template is the exact same one another commenter later mentioned (and you responded to) here by the way: https://news.ycom
13.
▲
by
throwitaway1123
1y ago
I certainly don't think I'm talking past you, but I can't force you to elaborate.
14.
▲
by
throwitaway1123
1y ago
JSX was also created with the intention of using traditional conditional/looping constructs, but that hasn't stopped Solid and Preact from repurposing it for fine grained reactivity. Preact's signal implementation has Solid-l
15.
▲
by
throwitaway1123
1y ago
> This is why both SolidJS and Vue Vapor both have helpers for rendering lists and conditional elements Haven't these tagged template libraries coalesced around the html`<${SomeComponent}><//>` syntax for custo
16.
▲
by
throwitaway1123
1y ago
You clearly have an axe to grind, and I'm not particularly interested in proselytizing. If you don't find the Declarative Shadow DOM useful, that's fine! The example I was responding to was using the Declarative Shadow DOM. M
17.
▲
by
throwitaway1123
1y ago
> First off, what’s with the pointless JavaScript? There’s no need for imperative code here. Exactly, I'm not sure why you've included the JS. The whole point of the Declarative Shadow DOM is to create shadow roots declarativel
18.
▲
by
throwitaway1123
1y ago
You absolutely can. It's the primary purpose of the DSD (Declarative Shadow DOM), one of the many new specifications people complain incessantly about. <my-component> <template shadowrootmode="open">
19.
▲
by
throwitaway1123
1y ago
> you have to explicitly specify mode: open The mode does not toggle the shadow DOM on and off. It just specifies whether or not the element's shadowRoot object is a public property. An open mode makes this possible: `document.query
20.
▲
by
throwitaway1123
1y ago
It's worth pointing out that Node has a built in globbing function: https://nodejs.org/docs/latest-v24.x/api/fs.html#fspromisesg... > Also there's arguably design. Should a 'glob' libra
21.
▲
by
throwitaway1123
2y ago
> which hinged on your definition of what the word "inevitable" means is the narrowest possible interpretation of my statement. My argument does not hinge upon the definition of the word inevitable. You originally said "I
22.
▲
by
throwitaway1123
2y ago
I wrote 362 words on why language rewrites are a faulty indicator of language quality with multiple examples and anecdotes, and you hyper-fixated on the very first sentence of my comment, instead of addressing the substance of my claim. In
23.
▲
by
throwitaway1123
2y ago
> That is not my intention. Perhaps you are reading absolutes and chasing after black and white statements. The first comment I wrote in this thread was a response to the following quote: "Yet projects inevitably get to the stage wh
24.
▲
by
throwitaway1123
2y ago
Rather than fixating on this single Prisma example, I'd like to address your larger point which seems to be that all greenfield projects are necessarily best suited to low level languages. First of all, I would argue that software rewr
25.
▲
by
throwitaway1123
2y ago
> First, they are using WASM which itself is a a low-level representation. WASM is used to generate the query plan, but query execution now happens entirely within TypeScript, whereas under the previous architecture both steps were handl
26.
▲
by
throwitaway1123
2y ago
> I mean, I can't think of a time a high profile project written in a lower level representation got ported to a higher level language. Prisma is currently being rewritten from Rust to TypeScript: https://www.prisma.io&#x
27.
▲
by
throwitaway1123
2y ago
They're going to add it once it stabilizes in Node: https://github.com/denoland/deno/issues/24828#issuecomment-2...
28.
▲
by
throwitaway1123
2y ago
Preact is definitely a good choice if you're looking for something lightweight. React-dom was already relatively hefty, and seems to have gotten even larger in version 19. Upgrading the React TypeScript Vite starter template from 18 to
29.
▲
by
throwitaway1123
2y ago
Those definitely help, but the proposed erasableSyntaxOnly flag would disallow all features that can't be erased. So it would prevent you from using features like parameter properties, enums, namespaces, and experimental decorators. It
30.
▲
by
throwitaway1123
2y ago
> Enums is going to make your TypeScript code not work in a future where TypeScript code can be run with Node.js Apparently they're planning on adding a tsconfig option to disallow these Node-incompatible features as well [1]. Using
More ›