cirilla
cirilla
SSolidJS
Created by smushball on 5/22/2024 in #support
Await a resource inside a function?
this maybe?
resource.promise = async () => {
while (true) {
const p = promise;
try {
const result = await promise;
if (p !== promise) continue;
return result
} catch (error) {
if (p !== promise) continue;
throw error;
}
}
};
resource.promise = async () => {
while (true) {
const p = promise;
try {
const result = await promise;
if (p !== promise) continue;
return result
} catch (error) {
if (p !== promise) continue;
throw error;
}
}
};
38 replies
SSolidJS
Created by Blankeos on 5/17/2024 in #support
<Show /> vs React-style conditional rendering.
the compiler is smart enough to handle ternaries and &&
N.B. only one level deep, if you go deeper with nesting you get the unwanted rerendering
7 replies
SSolidJS
Created by Gabriel Viol on 5/9/2024 in #support
Computations created outside a `createRoot` or `render` will never be disposed
Instead of flag being a JSX expression, you can make it a function that returns that e.g. () => <img ... and then change where you have flag to flag() so that the elements are not created eagerly
11 replies
SSolidJS
Created by Basil on 4/14/2024 in #support
`vite-plugin-solid` makes Vitest take over twice as long to run
There's a step where it goes through you dependencies and checks for a solid export field, which seems like it could take some time https://github.com/solidjs/vite-plugin-solid/blob/873f4cec4db1dcffac9d909191cf828a9902a418/src/index.ts#L195 Perhaps try editing the files for vite-plugin-solid in your node_modules to time it
2 replies
KPCKevin Powell - Community
Created by cirilla on 9/25/2023 in #front-end
CSS grid, setting maximum span
<div class="container">
<div class="inner"></div>
<div class="inner"></div>
<div class="inner"></div>
<div class="inner"></div>
<div class="inner long"></div>
<div class="inner"></div>
<div class="inner"></div>
</div>

<style>
.container {
padding: 2rem;
background-color: yellow;
height: 5rem;

display: grid;
grid-template-columns: repeat(auto-fill, minmax(40rem, 1fr));
gap: 1rem;
}

.inner {
background-color: blue;
}

.inner.long {
grid-column: span 5;
}
</style>
<div class="container">
<div class="inner"></div>
<div class="inner"></div>
<div class="inner"></div>
<div class="inner"></div>
<div class="inner long"></div>
<div class="inner"></div>
<div class="inner"></div>
</div>

<style>
.container {
padding: 2rem;
background-color: yellow;
height: 5rem;

display: grid;
grid-template-columns: repeat(auto-fill, minmax(40rem, 1fr));
gap: 1rem;
}

.inner {
background-color: blue;
}

.inner.long {
grid-column: span 5;
}
</style>
7 replies
KPCKevin Powell - Community
Created by cirilla on 9/25/2023 in #front-end
CSS grid, setting maximum span
Not the max columns there but like, if I put span 3 on something it'll force the grid to have 3 columns and it'll have zero width for the ones that don't naturally fit, is there some way to do it such that I can say "take up 3 columns at maximum otherwise span across however many there are"
7 replies