S
SolidJS•7mo ago
gsoutz

solid primitives storage is bug

I can't set value 0 number what is this. Secondly please fix the types in documentation like this asdf = (props) { } What is this props default type add that to documentation examples it's 2024 you still don't have types....
23 Replies
<Alterion.Dev>
<Alterion.Dev>•7mo ago
Where exactly are you seeing docs without types @gsoutz if you want things to change, you'll have to take the time to help us understand what the issue is, rather than do a drive-by complaint.
gsoutz
gsoutz•7mo ago
everywhere, just read it it's obvious
<Alterion.Dev>
<Alterion.Dev>•7mo ago
You'll unfortunately have to be a bit more precise. The reference guide has plenty of type docs. The tutorial, however, does not mix in typescript, as it's not obligatory to use solidjs with it Adding the layer of typescript complexity forced into every part of the beginners guide would actually force out people with an even harder and significant learning curve. And, to be fair, props is an object with the keys being your attributes, and the values you send it, I'm not sure how it would be typed? If you understand objects in typescript, it should be relatively obvious
gsoutz
gsoutz•7mo ago
bro instead of sending wall of text, just fix this and send a PR. fine I will stick to 🤪
<Alterion.Dev>
<Alterion.Dev>•7mo ago
Well if you can't dialog like an adult, we're not going to keep this conversation going. There's nothing we can do for you if you're going to stick with this attitude.
davedbase
davedbase•7mo ago
Yeah, I was going to suggest that being a nicer might get you a bit further ahead. Just friendly advice
<Alterion.Dev>
<Alterion.Dev>•7mo ago
Besides the Typescript question you had, the "can't set the value 0 number" doesn't really hold true? What exactly can't you set to 0? Because obviously, signals can be set to 0. And obviously I can pass props that are 0, that works fine.
export default function Counter(props: { start: number }) {
const [count, setCount] = createSignal(props.start);
return (
<button class="increment" onClick={() => setCount(count() + 1)}>
Clicks: {count()}
</button>
);
}
export default function Counter(props: { start: number }) {
const [count, setCount] = createSignal(props.start);
return (
<button class="increment" onClick={() => setCount(count() + 1)}>
Clicks: {count()}
</button>
);
}
and called with <Counter start={0} /> , again from the basic example, works perfectly well. So if you still want help, you're going to have to go beyond the "bro it's broke" level of question.
gsoutz
gsoutz•7mo ago
ok let me give you a hint, I am not going to contribute further to this project. What do you think this line does> https://github.com/solidjs-community/solid-primitives/blob/main/packages/storage/src/persisted.ts#L171... And props is here untyped.
import { createContext } from "solid-js";

const MyContext = createContext()

export const Provider = (props) => {
return (
<MyContext.Provider>
{props.children}
</MyContext.Provider>
)
}
import { createContext } from "solid-js";

const MyContext = createContext()

export const Provider = (props) => {
return (
<MyContext.Provider>
{props.children}
</MyContext.Provider>
)
}
GitHub
solid-primitives/packages/storage/src/persisted.ts at main · solidj...
A library of high-quality primitives that extend SolidJS reactivity. - solidjs-community/solid-primitives
<Alterion.Dev>
<Alterion.Dev>•7mo ago
You mean the children? You can easily type this with JSX.Element , as per https://docs.solidjs.com/reference/component-apis/children What you pointed to wasn't the docs. It's solid-primitive, part of the ecosystem, but it's not part of the official core code, or docs, it's community-provided
gsoutz
gsoutz•7mo ago
Sorry for the confusion, my link is about storage bug. Second thing is about solid docs. Two separete things here.
<Alterion.Dev>
<Alterion.Dev>•7mo ago
If you want community-provided things to get better, it's up to you to PR it, so you can go do that if you want? "props is untyped" because props is just an object. A Record<string, V> if you will. As for "storage bug", again, just pointing to source code saying it's not working isn't helpful, you have to actually demonstrate a bug in your own code, so that a developer might be able to reproduce it. Open an issue in https://github.com/solidjs-community/solid-primitives/issues, perhaps that would yield better results
<Alterion.Dev>
<Alterion.Dev>•7mo ago
there's even some really nice github features you can leverage to make that easier
No description
gsoutz
gsoutz•7mo ago
Ok.
<Alterion.Dev>
<Alterion.Dev>•7mo ago
Please try to be less dismissive of the effort of all your peers, and be less aggressive towards people trying to help you, in the future. It goes a lot smoother that way. Most people don't like to be angrily talked to in that way, I'm sure you don't either, and I don't know why you think this is appropriate behaviour towards others.
gsoutz
gsoutz•7mo ago
I said please didn't I. bringing software with fundamental bugs in it makes everyone mad.
Want results from more Discord servers?
Add your server