hyperknot
hyperknot
Explore posts from servers
DTDrizzle Team
Created by hyperknot on 4/22/2025 in #help
How to use in browser environment?
I think that'll be the plan I take.
3 replies
SSolidJS
Created by hyperknot on 4/5/2025 in #support
Can I use Solid for rendering DOM elements under non-Solid parts of the website?
I don't yet know what it does. I guess by hooking into it and returning true I tell it not to modify it.
9 replies
SSolidJS
Created by hyperknot on 4/5/2025 in #support
Can I use Solid for rendering DOM elements under non-Solid parts of the website?
I guess the update might need some custom logic, but render and destroy seems to be straightforward.
9 replies
SSolidJS
Created by hyperknot on 4/5/2025 in #support
Can I use Solid for rendering DOM elements under non-Solid parts of the website?
ProseMirror seems to support an update function and a destroy function. I'm thinking about using it like this:
function createSolidNodeView(node, view, getPos) {
// Create the DOM element
const dom = document.createElement('div');

// Render a Solid component into this element
const dispose = render(() => <MyInteractiveComponent {...node.attrs} />, dom);

// Return a ProseMirror NodeView
return {
dom,
update(newNode) {
// You'd need to handle updates here
// This might require re-rendering the component
return true;
},
destroy() {
// Important: call dispose when the node is removed
dispose();
},
// other NodeView properties as needed
};
}
function createSolidNodeView(node, view, getPos) {
// Create the DOM element
const dom = document.createElement('div');

// Render a Solid component into this element
const dispose = render(() => <MyInteractiveComponent {...node.attrs} />, dom);

// Return a ProseMirror NodeView
return {
dom,
update(newNode) {
// You'd need to handle updates here
// This might require re-rendering the component
return true;
},
destroy() {
// Important: call dispose when the node is removed
dispose();
},
// other NodeView properties as needed
};
}
9 replies
SSolidJS
Created by hyperknot on 3/29/2025 in #support
How to trigger focus and scroll across the app?
for subscribing, do you mean createEffect()?
10 replies
SSolidJS
Created by hyperknot on 3/29/2025 in #support
How to trigger focus and scroll across the app?
but what is the signal then? it needs to be something, a number, a boolean, something
10 replies
SSolidJS
Created by hyperknot on 3/29/2025 in #support
How to trigger focus and scroll across the app?
maybe a handleClick or similar triggers a store.setState('randomInt', Math.random()...)
10 replies
SSolidJS
Created by hyperknot on 3/24/2025 in #support
Does store setState check for equality before updating signals?
Interesting, so map() is tracking everything, good to know!
43 replies
SSolidJS
Created by hyperknot on 3/24/2025 in #support
Does store setState check for equality before updating signals?
What I meant is that the SO post shows the dangers of using proxies directly. Now AFAIK Solid doesn't allow anyone to do this, we can only modify it with setState. So none of the dangers in the SO post apply to us (or I didn't quite understand the SO post) I started watching the flux video, haven't finished it yet.
43 replies
SSolidJS
Created by hyperknot on 3/24/2025 in #support
Does store setState check for equality before updating signals?
I've read the SO question, but I think Solid is protected from this, isn't it? Basically setState makes sure you are treating everything like an immutables, isn't it?
43 replies
SSolidJS
Created by hyperknot on 3/24/2025 in #support
Does store setState check for equality before updating signals?
But I understand it might not be the ideal solution for everything.
43 replies
SSolidJS
Created by hyperknot on 3/24/2025 in #support
Does store setState check for equality before updating signals?
Right now, I feel happy to use stores for like 99% of things, except state which is very much scoped to a UI component.
43 replies
SSolidJS
Created by hyperknot on 3/24/2025 in #support
Does store setState check for equality before updating signals?
I see
43 replies
SSolidJS
Created by hyperknot on 3/24/2025 in #support
Does store setState check for equality before updating signals?
OK, I read the untrack docs, it's something different. I never used untrack before.
43 replies
SSolidJS
Created by hyperknot on 3/24/2025 in #support
Does store setState check for equality before updating signals?
OK, I understand this part, it's like how we always have to write the full props.... versions with long variable names, we cannot just use local variables in Solid components.
43 replies
SSolidJS
Created by hyperknot on 3/24/2025 in #support
Does store setState check for equality before updating signals?
I'm reading the TodoMVC app, but first I'm trying to understand what's happening here: https://playground.solidjs.com/anonymous/cbaca548-0499-44b5-851b-f98ff0abc470 The DOM is updated, the "direct" console line is printed, only the "on" version is not.
43 replies
SSolidJS
Created by hyperknot on 3/24/2025 in #support
Does store setState check for equality before updating signals?
I mean for performance reasons, I want to avoid unecessary signal updates as much as I can. So I'm thinking of using reconcile everywhere. But then createEffects won't work.
43 replies
SSolidJS
Created by hyperknot on 3/24/2025 in #support
Does store setState check for equality before updating signals?
but that is the correct way to track an array, isn't it?
43 replies