Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
MrJohz
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
25 ms
·
331.
▲
by
MrJohz
1y ago
In React, say, I might write <MyComponent worker={worker} /> and expect the worker instance to be passed as an object to `MyComponent` as a prop. But with webcomponents, I can't do something like that. this.i
332.
▲
by
MrJohz
1y ago
Well it's not a lie, it's how HTML and the DOM work. Attributes are strings, and what you write in HTML will be passed as attributes. You do also have access to properties, but only in Javascript — you can't for example wr
333.
▲
by
MrJohz
1y ago
It basically is that, although the key idea with signals is the automatic tracking. There's no sort of `signal.subscribe()` call happening, instead any time you use a signal inside a reactive context, it automatically gets subscribed.
334.
▲
by
MrJohz
1y ago
The virtual DOM doesn't really lead to better efficiency, that's a bit of a myth. It's really a UX tool: it means that you can treat rendering as a pure operation (i.e. (state) => UI), and recreate as much of the UI tree a
335.
▲
by
MrJohz
1y ago
> Your `_jsx` function can auto-wrap children in a function. It unfortunately can't, because by the time the jsx function gets a chance to run, the expression has already been evaluated, whereas the whole point of a framework like t
336.
▲
by
MrJohz
1y ago
Re 1, SolidJS also has a `createStore` primitive which works the same as your $proxy. That said, based on your other comment that I relied to, it sounds like your internal signals implementation is based on the nested, mutable object case,
337.
▲
by
MrJohz
1y ago
The proxy object is a fairly classic way of doing signals (see Vue, SolidJS), and the whole thing about functions rerunning whenever data that was accessed inside that function changes is pretty much the definition of signals. It looks like
338.
▲
by
MrJohz
1y ago
Aberdeen's proxy is essentially an object of nested signals. In general: proxy({ name: "Foo", email: "bar", }); is semantically equivalent to new Signal({ name: new Signal("
339.
▲
by
MrJohz
1y ago
Sure, but "never fails CI" is a different assertion from "has no bugs", or even "deploys correctly in production".
340.
▲
by
MrJohz
1y ago
Not if it's segfaulting, no. That's the point of a segfault.
341.
▲
by
MrJohz
1y ago
A segfault won't leak sensitive data, though.
342.
▲
by
MrJohz
1y ago
As others have pointed out, gitignore exists and you should try and build your configuration so that most of the time you're changing gitignored files rather than checked in ones. That said, you can do some pretty cool stuff with Jujut
343.
▲
by
MrJohz
1y ago
I think the biggest difference is one of philosophy: in Fossil (as I understand it) every change you make to the code is tracked, and there's no concept of rebasing or making the history prettier. If you make a commit and then realise
344.
▲
by
MrJohz
1y ago
Dictations exist in German as well, and German is very regular. In fact, the German primary school teachers I know do far more dictations with their classes than I ever did growing up in England.
345.
▲
by
MrJohz
1y ago
French spelling is fairly regular though, isn't it? My understanding is that each phoneme gets spelled in its own way, and the rules are fairly consistent. Once you've learned them, you can typically read most French words aloud,
346.
▲
by
MrJohz
1y ago
Ah, that's probably related to the bug I'm seeing where I've got my Teams calendar synced to my phone, but about half of the events show up an hour later or earlier. Isn't getting this right, like, _the_ purpose of a cal
347.
▲
by
MrJohz
2y ago
It can be, depending on how it's used. But most of the modern tools I've seen are specifically designed to compile away the dynamic aspects of CSS-in-JS, meaning it essentially becomes a different way of writing normal CSS.
348.
▲
by
MrJohz
2y ago
Ironically, as a NodeJS dev, I was going to say the opposite: I'm very used to the idea that you have a strict set of warnings that block the build completely if they fail, and I find it very strange in the C world that this isn't
349.
▲
by
MrJohz
2y ago
In fact, the best critics of something are often its biggest fans. Roger Ebert, for example, wrote some pretty critical pieces, but nobody can deny that he was driven primarily by a love of cinema. Or take politics: I've seen people
350.
▲
by
MrJohz
2y ago
That's true, but it's not usually recommended for most cases. You lose out on a number of optimisations, and I don't believe it'll be directly supported for vapor mode when that comes, although it looks like there's
351.
▲
by
MrJohz
2y ago
I disagree, both Vue and SolidJS share the same underlying signal mechanism. Vue hides it a bit more, and has different default primitives, but they're both doing essentially the same thing under the hood. In both, you can think of a
352.
▲
by
MrJohz
2y ago
Yeah, I've heard a few people say that. Tbh, I think that (plus a few philosophical approaches) is probably the biggest difference between the two frameworks at this point. Both use signals, both use an optimising template compiler, bu
353.
▲
by
MrJohz
2y ago
Both use signal-based reactivity, both are heavily optimised at compile-time to ensure only the parts of your app that need to well change at runtime. Vue uses single-file components, SolidJS uses JSX. That has a surprisingly large influenc
354.
▲
by
MrJohz
2y ago
For a very simple example like this, your version will probably be okay, but it has its own set of problems: * It's difficult to introspect the current state of the system. If I were to build an API that fetches the current state, I&#x
355.
▲
by
MrJohz
2y ago
I wasn't trying to suggest that HN needs to update the UI like this, just give an example of how even a relatively simple UI like the one we're using now is full of duplicate data. I then also gave the example of a messaging app b
356.
▲
by
MrJohz
2y ago
Can you describe what you mean by that a bit more? As I understand it, with the new signals-based system in Svelte, updating data directly updates the DOM.
357.
▲
by
MrJohz
2y ago
A lot of UIs have redundant data, it's very common to have the same data represented in different ways. Consider the comments page on HN, for example, which has plenty of duplicate information: The list of comments on a submission tell
358.
▲
by
MrJohz
2y ago
Yeah, that's a pretty common approach. Unfortunately, browsers aren't very good at doing patch updates, so it'll completely reset any UI elements in the region being rerendered. It also will make it hard to scope anything you
359.
▲
by
MrJohz
2y ago
That's true, but there are various other syntax differences that mean that pasting HTML is always going to require some fixing up. For example, JSX requires all elements to have closing tags or use the /> syntax, whereas HTML h
360.
▲
by
MrJohz
2y ago
How do you update the html when something changes? For me, that's the most interesting question for these sorts of micro-frameworks - templating HTML or DOM nodes is super easy, but managing state and updates is hard.
More ›