Slamerz
TTCTheo's Typesafe Cult
•Created by Slamerz on 5/26/2023 in #questions
"createContext only works in Client Components." When I'm not using context.
@Naweed https://discord.com/channels/966627436387266600/1111740083050123415/1112037314194063361
The solution to my particular issue as posted in the thread was that I had been using the barrel pattern, and some of the exports from that barrel were client componenets.
So I just stopped using the barrel pattern for the project
16 replies
TTCTheo's Typesafe Cult
•Created by Slamerz on 7/25/2023 in #questions
Prod and Dev rendering differently
Cache clearing, and attempting to run site on different device to test also doesn't fix the issue.
8 replies
TTCTheo's Typesafe Cult
•Created by Slamerz on 7/25/2023 in #questions
Prod and Dev rendering differently
There are no errors in the console of server, or client for this page.
8 replies
TTCTheo's Typesafe Cult
•Created by Slamerz on 7/21/2023 in #questions
pagination from multiple sources?
22 replies
TTCTheo's Typesafe Cult
•Created by Slamerz on 7/21/2023 in #questions
pagination from multiple sources?
Yeah, I've seen some fuzzy pagination examples
22 replies
TTCTheo's Typesafe Cult
•Created by Slamerz on 7/21/2023 in #questions
pagination from multiple sources?
Yeah, with all the aggrigation websites out there I'm just more shocked there aren't more well defined solutions for a similar issue lol
22 replies
TTCTheo's Typesafe Cult
•Created by Slamerz on 7/21/2023 in #questions
pagination from multiple sources?
Yeah, I'm definetly gonna have to do some caching and a few other things
22 replies
TTCTheo's Typesafe Cult
•Created by Slamerz on 7/21/2023 in #questions
pagination from multiple sources?
At this point the strategy seems to be (Based on these articles and a few others I saw) make an endpoint that gives paginated values for say 20 results.
That endpoint pulls in 40 results from each source.
Page 1 [0-40]
Page 2 [0-40]
Combine them, serve the top 20, and hope that the next pages when those 40 run out weren't super out of synce date whise
22 replies
TTCTheo's Typesafe Cult
•Created by Slamerz on 7/21/2023 in #questions
pagination from multiple sources?
One of the datasources is an API that is completely out of my control, that updates often so storing the results from it in a database doesn't really work.
If the source didn't update very often I'd pry just clone it into my database and combining it all into 1 source
22 replies
TTCTheo's Typesafe Cult
•Created by Slamerz on 7/21/2023 in #questions
pagination from multiple sources?
I was attempting to fetch from front end, but might move it to it's own endpoint on the backend.
Basic problem in a more visual sense is that there are 2 sources with similar data that I'm attempting to combine into 1 paginated feed.
(Example data structures below)
Both sources are paginated.
I'm looking for a strategy to combine them into a feed that gives a consistent number of results while pages are available from these 2 sources.
The issue is that sometimes these 2 sources data are a bit far from each other sort wise.
Example is if Source A's data for a particular month is very active but Source B's is not.
When I currently pull in page 1 from each and combine/sort them the date range (in the example below) would be something like June 20-june 4th
But then when page 2 of Source A is pulled in the dates are back up to June 19th.
But I'm having a hard time visualizing or at least putting together a way to pull from both sources, check date ranges to see about pulling the next page of one of the sources and see if those better match the date range
Source A:
Source B:
22 replies
TTCTheo's Typesafe Cult
•Created by Slamerz on 5/26/2023 in #questions
"createContext only works in Client Components." When I'm not using context.
Found the issue, it was nothing to do with the provider, or needing to be made "use client" in the particular component I was attempting to import, it was an issue with using barrel pattern, in a directory that had unrelated files which did use context (were being used in the old pages router)
So fix was doing direct import paths to the files, no index.js files.
16 replies
TTCTheo's Typesafe Cult
•Created by Slamerz on 5/26/2023 in #questions
"createContext only works in Client Components." When I'm not using context.
I'm just not grasping how adding any components even if it's just a div means the whole page components has to be made use client
16 replies
TTCTheo's Typesafe Cult
•Created by Slamerz on 5/26/2023 in #questions
"createContext only works in Client Components." When I'm not using context.
But I'm getting these context errors when I'm not using any material ui components yet
16 replies
TTCTheo's Typesafe Cult
•Created by Slamerz on 5/26/2023 in #questions
"createContext only works in Client Components." When I'm not using context.
Yeah but I guess my confusion is why is it required in a component with no state fulness
16 replies
TTCTheo's Typesafe Cult
•Created by Slamerz on 5/26/2023 in #questions
"createContext only works in Client Components." When I'm not using context.
So it's just impossible to do any ssr in 13?
16 replies
TTCTheo's Typesafe Cult
•Created by Slamerz on 5/26/2023 in #questions
"createContext only works in Client Components." When I'm not using context.
Sorry, yes I followed the instructions in the next.js docs for applying context providers to the app.
https://nextjs.org/docs/getting-started/react-essentials#rendering-third-party-context-providers-in-server-components
Providers.tsx
16 replies
TTCTheo's Typesafe Cult
•Created by Slamerz on 5/24/2023 in #questions
Suggested First Load JS size
Yeah, it's not a huge app, two api calls, some image loading, and firebase Auth, and it started to baloon in size it felt like.
Just getting a feel for how big is "too big" or what is considered "big" to see if I really need to do some rewrites on the core app to lower things down
5 replies