Tommypop
Tommypop
Explore posts from servers
SSolidJS
Created by walid on 7/30/2023 in #support
SWC Support for SolidJS
It's definitely not production ready and, afaik, there's no SSR or hydration support yet
30 replies
SSolidJS
Created by Daniel Sousa @TutoDS on 7/23/2024 in #support
Optimize image loading
let observer;
onMount(() => {
observer = new IntersectionObserver((entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
setImgSrc(photo.src.small)
loadImage();
observer.unobserve(entry.target);
}
});
});
})

onCleanup(() => {
observer.disconnect();
});
let observer;
onMount(() => {
observer = new IntersectionObserver((entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
setImgSrc(photo.src.small)
loadImage();
observer.unobserve(entry.target);
}
});
});
})

onCleanup(() => {
observer.disconnect();
});
14 replies
SSolidJS
Created by Daniel Sousa @TutoDS on 7/23/2024 in #support
Optimize image loading
To fix this, you could wrap your IntersectionObserver in onMount, which runs when the component is mounted to the DOM
14 replies
SSolidJS
Created by Daniel Sousa @TutoDS on 7/23/2024 in #support
Optimize image loading
In SolidStart, components run twice: once on the server, and once on the client. IntersectionObserver doesn't exist on the server, so, when the component runs on the server-side it throws an error.
14 replies
SSolidJS
Created by omfj on 7/14/2024 in #support
How do get Cloudflare bindings in dev?
4 replies
SSolidJS
Created by Bersaelor on 7/10/2024 in #support
Ideas what could cause static assets from failing to import?
(This is because vite includes types for handling the imports of *.png and i think vinxi doesn't re-export vite types correctly sometimes)
9 replies
SSolidJS
Created by Bersaelor on 7/10/2024 in #support
Ideas what could cause static assets from failing to import?
So add vite as a dev dep and add vite/client to the types field of the tsconfig
9 replies
SSolidJS
Created by Bersaelor on 7/10/2024 in #support
Ideas what could cause static assets from failing to import?
Maybe add vite types
9 replies
SSolidJS
Created by Bersaelor on 7/10/2024 in #support
Ideas what could cause static assets from failing to import?
Seems like a tsconfig issue. Are the configs the same in both projects?
9 replies
SSolidJS
Created by Deflaktor on 5/29/2024 in #support
create example solidstart project takes forever
@Deflaktor What node version are you on?
13 replies
SSolidJS
Created by valerio.tsx on 6/2/2024 in #support
Renaming Index not working?
Hmm, that might be a mistake in the docs. You should be able to bracket the put brackets round the name, (socials.tsx), if you don't want it named index
12 replies
SSolidJS
Created by valerio.tsx on 6/2/2024 in #support
Renaming Index not working?
If the filename isn't index.tsx, then the filename is used as the route suffix
12 replies
SSolidJS
Created by valerio.tsx on 6/2/2024 in #support
Renaming Index not working?
Because an index.tsx file in a folder is used by the router as the route for that path
12 replies
SSolidJS
Created by valerio.tsx on 6/2/2024 in #support
Renaming Index not working?
You should rename socials.tsx to index.tsx I think
12 replies
SSolidJS
Created by Deflaktor on 5/29/2024 in #support
create example solidstart project takes forever
Bun did implement this function here: https://github.com/oven-sh/bun/pull/11392, but there hasn't been a release yet so updating bun likely won't work
13 replies
SSolidJS
Created by Deflaktor on 5/29/2024 in #support
create example solidstart project takes forever
Maybe try forcing version 0.5.11 when creating: bun create [email protected]. (I removed the use of a function that wasn't implemented in bun and node 18)
13 replies
SSolidJS
Created by Rubick on 5/6/2024 in #support
Using babel-preset-solid in browser
Just spent the last 30 mins digging through the stack trace haha
9 replies
SSolidJS
Created by Rubick on 5/6/2024 in #support
Using babel-preset-solid in browser
So your package.json should look like this
9 replies
SSolidJS
Created by Rubick on 5/6/2024 in #support
Using babel-preset-solid in browser
{
"name": "solid-babel-reproduce",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
},
"devDependencies": {
"@types/babel__standalone": "^7.1.7",
"typescript": "^5.2.2",
"vite": "^5.2.0"
},
"dependencies": {
"@babel/standalone": "^7.24.5",
"assert": "^2.1.0",
"babel-preset-solid": "^1.8.17"
}
}
{
"name": "solid-babel-reproduce",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
},
"devDependencies": {
"@types/babel__standalone": "^7.1.7",
"typescript": "^5.2.2",
"vite": "^5.2.0"
},
"dependencies": {
"@babel/standalone": "^7.24.5",
"assert": "^2.1.0",
"babel-preset-solid": "^1.8.17"
}
}
9 replies
SSolidJS
Created by Rubick on 5/6/2024 in #support
Using babel-preset-solid in browser
I think all you have to do is pnpm i assert (as looks like some babel code requires it and tries to resolve it from the package.json)
9 replies