FjordWarden
Explore posts from serversCustom renderer with hyper dom expressions
I've been trying to write my own custom renderer with the
solid-js/universal
module, but I am failing to understand how I should integrate the renderer into for example a Canvas
component. I've studied the solid-three example and solid-universal-renderer-template examples and they seem to use directive in vite.config.js
to tell the transpiler somehow to use the other renderer.
I'm just using vanilla js so maybe I need to path solid/h
in some way to get this to work. At any rate I'd appreciate if someone could tell me this is the right direction to take.2 replies
Return non DOM element as component with hyper dom expressions
I'd like to create a declarative api that uses components that are not part of the DOM tree. Sort of like this Canvas API:
I'm just not sure how to implement to Bezier so it can also receive events.
5 replies
No Context when using hyper dom expressions
I've this strange behaviour that
useCounter(CounterContext)
returns undefined
when porting the context example to use hyper dom expressions.
Check codepen here: https://codepen.io/wrnrlr/pen/eYojdqV?editors=1011
Any ideas what I am doing wrong?4 replies
Move table columns around with drag & drop
I've created a data table component where you can move around the order of the columns using the drag and drop api.
Specifically, I am using
e.dataTransfer.setData
to set the index on an ondragstart
and read it during the ondrop
event.
It works as expected, at least on the first try, after that the behaviour becomes weird because it will always use the old index and not the new ordering.
I've tried using a Index
instead of a For
, this solves the index issue but then the data will be matched with the wrong column.
One way to work around this is to just pass the index in manually like this: {each:()=>props.headers().map((h,i)=>[h,i])}
.
Might there be a better option?1 replies
Can't upgrade request to websocket
I want to use a websocket in one of my middlewares.
But I keep getting an error saying I can't upgrade my connection:
I've googled this error but only find old results relating this error to the version of deno or oak lib where I run the latest deno (1.37.2) and oak (12.6.1).
11 replies
Read CSV files inside zip file using the web streams API
I need to read a number of csv files inside a zip file.
The basic example I've got working so far is the following:
The problem is that the chunk is some weird array of strings of numbers and not the row I would expect.
Any help would be welcome.
2 replies
Remove element from store not working
I'm trying to remove an element from a reactive store based on the index. I've tried versions of this but I keep getting an error telling me "Cannot mutate a Store directly":
I've tried both <For> and <Index>
I've also tried something like
props.setMyFilter(i(),undefined)
but this does not result in any change in the DOM, but it does log an error because it is trying to render a element from the store that is no longer there.
4 replies
Render a component referenced by a object
How van I render a component that is referenced by an object instead of just writing the tag directly?
For example I'd have a store where I want to programmatically change what ckind of editor is supported:
Something like
f.form
does not work here. Maybe this is not a good idea and I should just use a type attribute in the object and check with an if when rendering, but I was wondering more if this is an option at all.1 replies
How to iterate over Object.entries()?
How does one use
<index>
or <for>
together with Object.entries(obj)
this only seems to work for {k()[0]}
, and not {k()[1]}
Playground example: https://playground.solidjs.com/anonymous/349c6400-367b-4856-938a-8cf5b4208aea
In the console it logs: Unrecognized value. Skipped inserting {a: 'a'}
4 replies
createResource does not working with json()
Why does text() work but json() does not:
I am sure the content I get back is valid JSON and changing the content type has no effect.
I can't think of a reason why this difference in behaviour?
3 replies
Abort resource
I am building some full text search input field and got the basic thing working.
Next I want to add support to abort the previous fetch request because they can take a while and currently they build up with every token I type.
This is my current attempt at a solution, but it has a problems.
I never finishes the any fetch because it is aborted in the effect at the same time the resource runs.
What is the suggested solution to accomplish this, I can't be the first to try this but I find very little info on how to do this with SolidJs.
2 replies