ChrisThornham
ChrisThornham
SSolidJS
Created by ChrisThornham on 10/3/2024 in #support
SRR And Web Crawlers. Help Me Understand
Sweet! Thank you. I agree. The "get indexed" timeline is extremely variable. I've been an online entrepreneur for 15+ years now, and I still don't fully understand how Google's algorithm works. Haha. Have a good one.
5 replies
SSolidJS
Created by ChrisThornham on 10/3/2024 in #support
SRR And Web Crawlers. Help Me Understand
Haha. Chicken or egg. It's hard to build a sitemap without a crawler. I just coded a custom sitemap generator using import.meta.glob from vite. Do you think it will work if I add that sitemap to my site and a robots.txt file?
5 replies
SSolidJS
Created by gsoutz on 10/3/2024 in #support
How do I do something after a redirect, like reload the page, or in this case reconnect a websocket?
I think you'll have to recall your getUser function on each load. Or store the current user name. Then check it on page load. If the user name is the same, proceed. But if the user name has changed, rerun getUser.
10 replies
SSolidJS
Created by gsoutz on 10/3/2024 in #support
How do I do something after a redirect, like reload the page, or in this case reconnect a websocket?
Couldn't you use onMount() or createEffect() on the page you are redirecting to? Basically, when this page loads, check for a websocket connection. If it exists, return. If not, reconnect.
10 replies
SSolidJS
Created by ChrisThornham on 9/13/2024 in #support
Can I Pass `createAsync()` a Signal?
Just read about it. I get it now. That's a cool addition to the tool belt. Thanks again!
15 replies
SSolidJS
Created by ChrisThornham on 9/13/2024 in #support
Can I Pass `createAsync()` a Signal?
Oh cool. I'll dig through that. Thanks!
15 replies
SSolidJS
Created by ChrisThornham on 9/13/2024 in #support
Can I Pass `createAsync()` a Signal?
Haha. For people like myself who are still learning, definitely!
15 replies
SSolidJS
Created by ChrisThornham on 9/13/2024 in #support
Can I Pass `createAsync()` a Signal?
That works great! Is this the extent of the docs on startTransition? https://docs.solidjs.com/reference/reactive-utilities/start-transition#starttransition
15 replies
SSolidJS
Created by ChrisThornham on 9/13/2024 in #support
Can I Pass `createAsync()` a Signal?
Brilliant! Thank you.
15 replies
SSolidJS
Created by ChrisThornham on 9/13/2024 in #support
Can I Pass `createAsync()` a Signal?
And that should fix the flicker?
15 replies
SSolidJS
Created by ChrisThornham on 9/13/2024 in #support
Can I Pass `createAsync()` a Signal?
Thank you! Is there a simple way to show me how to use startTransition?
15 replies
SSolidJS
Created by ChrisThornham on 9/8/2024 in #support
Unexpected SolidStart Behavior On Vercel. Can You Help?
Interesting! Thanks for mentioning this.
5 replies
SSolidJS
Created by ChrisThornham on 9/8/2024 in #support
Unexpected SolidStart Behavior On Vercel. Can You Help?
For anyone who might stumble upon this in the future, I solved the problem by moving the navigation logic outside of onAuthStateChange and into it's own createEffect(). This way, the if check only runs when authStore has updated.
5 replies
SSolidJS
Created by a𒈙𒈙𒈙 on 9/9/2024 in #support
How to access cookies with ssr?
Ok. You'll import getCookie at the top of your file. Next, you'll want to access your cookie on the server. You can do that in SolidStart with "use server";. Here's an example of how you can use "use server"; inside of a function.
import { getCookie } from "vinxi/http";

export const myFunction() {
"use server"; // this function will now run on the server.

// Get the cookie by name
const cookie = getCookie("cookie-name");

// Use the cookie
return cookie:
}
import { getCookie } from "vinxi/http";

export const myFunction() {
"use server"; // this function will now run on the server.

// Get the cookie by name
const cookie = getCookie("cookie-name");

// Use the cookie
return cookie:
}
9 replies
SSolidJS
Created by a𒈙𒈙𒈙 on 9/9/2024 in #support
How to access cookies with ssr?
I'll write a more detailed description when I get to my computer.
9 replies
SSolidJS
Created by a𒈙𒈙𒈙 on 9/9/2024 in #support
How to access cookies with ssr?
If you're interested in learning more about Vinxi, this link will help: https://vinxi.vercel.app/api/server/cookies.html
9 replies
SSolidJS
Created by a𒈙𒈙𒈙 on 9/9/2024 in #support
How to access cookies with ssr?
You access cookies through Vinxi. Here's an example:
import { getCookie } from "vinxi/http";

// Then get the cookie by name.
const cookie = getCookie("cookie-name");
import { getCookie } from "vinxi/http";

// Then get the cookie by name.
const cookie = getCookie("cookie-name");
Hope that helps, Chris
9 replies
SSolidJS
Created by ChrisThornham on 9/8/2024 in #support
Unexpected SolidStart Behavior On Vercel. Can You Help?
Here's an update. I can correct the behavior if I add a 1 second delay between setAuthStore and the if check for navigation. So, it appears that setAuthStore hasn't finished setting the auth state before the if statement runs. Is it possible to await setAuthState? Or correct this some other way? Adding a delay feels a bit hacky. Also, why would this happen on Vercel but not in my local environment? Is there a network lag that occurs when calling setAuthState on Vercel that doesn't occur locally?
5 replies
SSolidJS
Created by ChrisThornham on 9/6/2024 in #support
How Can I Generate A Sitemap?
@Madaxen86 Thanks! I'll dig into this.
3 replies
SSolidJS
Created by ChrisThornham on 9/5/2024 in #support
Environment Variables Missing `npm run start`
Sorry, I missed this. Yes, I tried that as well, and it didn't work.
12 replies