NotLuksus
Explore posts from serversWeird Context Behaviour
I'm currently setting up a tip tap editor with solid and wanted to create a context to pass the editor around the components.
I have a root component that creates the editor and then multiple sub components that want to consume the editor.
10 replies
Shared Layouts with SolidStart
I wondered if its possible to have a shared Layout for
the routes
/ and /pricing
but not for /dashboard
e.g. I have a navbar I want to show only on that routes.
From the docs it seems like it's only possible for pages inside folders so
/landing/
/landing/pricing
having a different layout then
/dashboard
would work?
3 replies
createAsyncResource and <Suspense>
I would expect this to first render
Todos
Loading...
for 2 seconds and then all the todos in a list instead of the Loading
However when I open the page, the browser loading indicator is there for 2 seconds and then just the "end result" gets rendered in the browser.
What am I doing wrong?
Quite new to solid so please excuse if this question is dumb haha
Thanks for help!
8 replies
TTCTheo's Typesafe Cult
•Created by NotLuksus on 12/18/2023 in #questions
Errors while running mutations when deploying CT3A using SST
13 replies
TTCTheo's Typesafe Cult
•Created by NotLuksus on 12/7/2023 in #questions
Use @monaco-editor/react as a tsx editor
Has anyone figured out how todo this? I can only get any types for my jsx code and no syntax highlighting, which apparently is a general limitation.
Would highly appreciate any working code snippets or hint in the right direction.
Current code:
Thanks for reading!
8 replies
TTCTheo's Typesafe Cult
•Created by NotLuksus on 10/27/2023 in #questions
Clerk Middleware throws edge runtime error
2 replies
DTDrizzle Team
•Created by NotLuksus on 8/2/2023 in #help
ReferenceError: Cannot access 'addon' before initialization
This is one of the files in ./schema/
When I run
npx drizzle-kit generate:sqlite
I get the error:
And I don't understand why since the schema doesn't have any self references32 replies
TTCTheo's Typesafe Cult
•Created by NotLuksus on 6/7/2023 in #questions
Next JS 13 (noob) questions
Thank you, if you actually read threw all this. Would make my day!
So I have some question / want to make sure I got everything correct before I start implementing.
1. Fetching data from a db
When I just want to fetch simple data from my db I would just write the call directly in the server component right?
So I dont do?
2.Loading State
When I use the loading.tsx file at page level and any of the components lower in the component tree loads data, whatever is in there replaces everything that is inside the page.tsx file. Anything that is inside the layout stays?
As an example I have a page called Shop, this shop consists of an infinite scoll of items and some text at the top, this is all done in the page.tsx file.
This then is ofc used in the layout file, in the layout there is also a sidenav with filters and a navbar.
And in the loading.tsx file there is just some text that states loading.
Now when data is loaded everything in page.tsx gets replaced, even my text at the top right?
Is it possible to keep that text shown and only replace the actual items with the loading ui?
3. Sharing state?
Not sure how to call this, but lets stay with the example from above, I choose a filter in the sidenav, which would need to be a client component as it would need useState, how would I then pass this to the component that actually fetches the data?
And how would I then refetch the data and show the loading state again?
4. Fetching more data
Regarding pagination and infinite scrolling, I watched the video and there (at least normal pagination) is done using query params.
Is that the pattern that should be used in general?
Or do you just fetch the initial items on the server and then use something like react-query to do the client side data fetching?
In that case there would be some code duplication as the same db call would once be in my react code and in my api route right?
Thanks a lot for reading all of this (probably also stupid) questions
3 replies
TTCTheo's Typesafe Cult
•Created by NotLuksus on 5/29/2023 in #questions
SSR with NextJs layouts (page dir)
So I have a shared layout in my app which looks like this
I now need some data in the header of the page which I would prefer to ssr using getServerSideProps, however these props are only passed to the Page and not to the layout.
Any ideas on how I can do this?
2 replies
DTDrizzle Team
•Created by NotLuksus on 4/4/2023 in #help
"Extend" tables by other tables
Hey all,
first of all great work with drizzle.
Haven't had the time to play around with it so far. But just from how I currently use other orms.
I have an AbstractEntity "class" which isn't an actual db table, but shares the common column each table should have e.g. a unique id.
Basically like a parent class, but for DB tables.
Is it possible to do something similar.
Without trying: Can I just create an object using the given types/constructors from drizzle and then spread them?
I hope that makes sense
2 replies
TTCTheo's Typesafe Cult
•Created by NotLuksus on 12/21/2022 in #questions
Weird Next Image behaviour
Hey,
I'm currently building a gallery that has pagination and the expected behaviour is to display a loading state on the images while they are loading. This works fine on the first page load (https://gyazo.com/b80b2b18a58abd0c089f3ade111a4235), but doesn't when I switch between the pages as seen here: https://gyazo.com/5d1b1e86f116e71f43ee208f02ae8c3f
Any idea why that is?
27 replies
TTCTheo's Typesafe Cult
•Created by NotLuksus on 12/2/2022 in #questions
Smooth Scrolling in Next
Hey,
does anyone know a good way or a good library to implement smooth scrolling in React/Next.
Talking about the scrolling that if you stop scrolling it continues a bit further down and doesnt stop directly
1 replies
TTCTheo's Typesafe Cult
•Created by NotLuksus on 11/30/2022 in #questions
Apple AirPod Style Animation on scroll
Hey,
Kind of a noob question, but I wondered what the best way to implement something like this animation would be.
Example: https://www.youtube.com/watch?v=hY1a94niwpY
I did some research and found multiple ways, some use image sequences others mp4s.
Just wondered how you guys would go on with this.
Thanks 🙂
10 replies
TTCTheo's Typesafe Cult
•Created by NotLuksus on 11/8/2022 in #questions
Loading UI not interactive
Hey,
I played around a bit with loading ui's in next 13 and for some reason links, buttons, etc. can't be clicked during loading.
I wondered if that is correct or if im just stupid
Thanks
4 replies
TTCTheo's Typesafe Cult
•Created by NotLuksus on 10/26/2022 in #questions
Error Unsupported Server Component type undefined
Hey,
I'm playing around with Next 13 rn and I encountered an issues.
I have my root layout.tsx
Which only has the default stuff in it + my Navbar Component
The page.tsx uses a server side component to fetch data from my database and display it.
My navbar component however I want to be a client side component, once i add "use client"; to the file i get the error: Error: Unsupported Server Component type: undefined
In my server console it tells me to check the line where I use the Navbar component in the layout.
Has anyone faced a similar project or this how its supposed to work?
8 replies
TTCTheo's Typesafe Cult
•Created by NotLuksus on 10/26/2022 in #questions
Next 13
With next 13 do you just replace getserverside props with the use api and leave Trpc the same for mutations / client side requests etc. ?
Not planning on using it right now, just as a general question for the future
7 replies
TTCTheo's Typesafe Cult
•Created by NotLuksus on 9/27/2022 in #questions
Next Router Issues
So I have an issues using next router.
In my project I have something similar to
/blog/[id].tsx
This [id].tsx does a getServerSideProps where it fetches the correspoding information from a database and passes that to the page.
Now when I do router.push() from anywhere in the application everything works fine.
How ever I have some blog posts that reference others.
Now when I do router.push("/blog/1234") while being on /blog/1 for example only the url changes.
So the url now is /blog/1234, but the content that is displayed is still the one of /blog/1
A work around is just using window.location.replace, but I'm not really happy with that solution und would prefer using next router.
Thanks for your help!
9 replies