apollo79
apollo79
Explore posts from servers
SSolidJS
Created by jaak on 6/2/2024 in #support
Path syntax flexibility
It is a bit different use case though
13 replies
SSolidJS
Created by jaak on 6/2/2024 in #support
Path syntax flexibility
It is possible to select records using functions though, like e.g. update("users", i => i.id === 42, 'loggedIn', false);
13 replies
SSolidJS
Created by Massukka on 5/26/2024 in #support
View transition api and solid start
I am not at my computer rn so can't really dig deeper
11 replies
SSolidJS
Created by Massukka on 5/26/2024 in #support
View transition api and solid start
This is my solution and it works...
11 replies
SSolidJS
Created by Massukka on 5/26/2024 in #support
View transition api and solid start
import type { ParentComponent } from "solid-js";
import { type RouteSectionProps, useBeforeLeave } from "@solidjs/router";

import "./view-transition.css";
export const ViewTransition: ParentComponent<RouteSectionProps> = (props) => {
  let isTransitionNavigate = false;

  useBeforeLeave((event) => {
    if (document.startViewTransition) {

      // if this is not already the second navigation,
      // which happens after the view-transition was initialized from inside this component
      if (!isTransitionNavigate) {
        const isBackNavigation = Number.isInteger(event.to) && (event.to as number) < 0;

        event.preventDefault();

        isTransitionNavigate = true;

        if (isBackNavigation) {
          document.documentElement.classList.add("back-navigation");
        const transition = document.startViewTransition(() => {
          event.retry();
        });

        transition.finished.finally(() => {
          isTransitionNavigate = false;
          document.documentElement.classList.remove("back-navigation");
        });
      }
    }
  });

  return <>{props.children}</>;
};
import type { ParentComponent } from "solid-js";
import { type RouteSectionProps, useBeforeLeave } from "@solidjs/router";

import "./view-transition.css";
export const ViewTransition: ParentComponent<RouteSectionProps> = (props) => {
  let isTransitionNavigate = false;

  useBeforeLeave((event) => {
    if (document.startViewTransition) {

      // if this is not already the second navigation,
      // which happens after the view-transition was initialized from inside this component
      if (!isTransitionNavigate) {
        const isBackNavigation = Number.isInteger(event.to) && (event.to as number) < 0;

        event.preventDefault();

        isTransitionNavigate = true;

        if (isBackNavigation) {
          document.documentElement.classList.add("back-navigation");
        const transition = document.startViewTransition(() => {
          event.retry();
        });

        transition.finished.finally(() => {
          isTransitionNavigate = false;
          document.documentElement.classList.remove("back-navigation");
        });
      }
    }
  });

  return <>{props.children}</>;
};
11 replies
SSolidJS
Created by Massukka on 5/26/2024 in #support
View transition api and solid start
My implementation looks similar and it works fine
11 replies
SSolidJS
Created by Massukka on 5/26/2024 in #support
View transition api and solid start
Do you know when exactly it doesn't work?
11 replies
SSolidJS
Created by Hussein on 5/21/2024 in #support
how do i use Drizzle?
(make the whole file "use server")
68 replies
SSolidJS
Created by Hussein on 5/21/2024 in #support
how do i use Drizzle?
I had some issues with prisma as well, moving the data functions (cache) to a different file made them go away
68 replies
SSolidJS
Created by marcusbuffett on 3/29/2024 in #support
createEffect is reactive, JSX isn't
No, the Dynamic shouldn't affect this, just as the createEffect, the template is still reactive You usually don't pass accessors as props though, but call it as you pass it and solid transforms it into a getter, so that could be the reason here. Try passing loading={loading()} and then consume it as boolean in your component
7 replies
SSolidJS
Created by DannyBoy on 2/24/2024 in #support
SolidJS Universal - How does the method of tree creation get chosen?
I never thought that this would actually happen
12 replies
SSolidJS
Created by DannyBoy on 2/24/2024 in #support
SolidJS Universal - How does the method of tree creation get chosen?
Sorry, my cat... 🙀🤣
12 replies
SSolidJS
Created by DannyBoy on 2/24/2024 in #support
SolidJS Universal - How does the method of tree creation get chosen?
34444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
12 replies
SSolidJS
Created by ChrisThornham on 1/12/2024 in #support
API Routes Not Found. Can You Help?
Happy to help 🙂 You too!
6 replies
SSolidJS
Created by ChrisThornham on 1/12/2024 in #support
API Routes Not Found. Can You Help?
solid-start provides you a web request object, so you can just refer to mdn: https://developer.mozilla.org/en-US/docs/Web/API/Request
6 replies
SSolidJS
Created by ChrisThornham on 1/12/2024 in #support
API Routes Not Found. Can You Help?
1. You have to return something from your route, else the route "does not exist", as it has no content. 2. The API call arrives at the server and the function gets called. It is found on the server, but does not exist for the client as it has no content or different status code 3. request.body is a ReadableStream, but since you are using JSON, you can simply call await request.json() and you will get the data I hope that this is helpful, if you have any questions, feel free to ask 🙂
6 replies
SSolidJS
Created by aws on 12/22/2023 in #support
Best way how to call sever function onClick (SOLVED)
I think the new router (v0.10.x) is not compatible with solid-start v0.3.x If you want to use it you'll have to upgrade to 0.4.x
16 replies
SSolidJS
Created by Brendonovich on 12/15/2023 in #support
Multi-line element truncation
If you don't need the stuff with custom read more ellipsis, I would suggest going the modern CSS way, since -webkit-line-clapm is well supported
8 replies
SSolidJS
Created by Liquido on 12/11/2023 in #support
How can I set a style based on reactive state with fallback to props?
The way you have it now, it will call the clicked getter function only once, to have it rerunning, you can change color to be a getter https://playground.solidjs.com/anonymous/de94fa0e-cefd-4f24-8f1e-9351ff5907f6
6 replies