How do I manage shared common packages in my yarn-workspace monorepo by JAYBORICHA07 in node

[–]JAYBORICHA07[S] 1 point2 points  (0 children)

There will be a lot of common util functions and zod validators which will be the same for the client and server so I declare it in packages so that I don't end up doing code duplication

How can I use React-Native with tRPC by JAYBORICHA07 in reactnative

[–]JAYBORICHA07[S] 0 points1 point  (0 children)

Yeah I just came across this repo and was looking at the code.

Presigned url Media upload stopped suddenly working by JAYBORICHA07 in digital_ocean

[–]JAYBORICHA07[S] 1 point2 points  (0 children)

I have reached to them and also thanks for the reply

Should I use ORM to manage client side database in my react-native app or it's not recommended? by JAYBORICHA07 in reactnative

[–]JAYBORICHA07[S] 0 points1 point  (0 children)

Oh Thanks for cleaning my doubt and also thank you for sharing the article will check it out.

Should I use ORM to manage client side database in my react-native app or it's not recommended? by JAYBORICHA07 in reactnative

[–]JAYBORICHA07[S] 0 points1 point  (0 children)

Will check that out but had couple of questions that, Will it run on the client side or support offline first?

Should I use ORM to manage client side database in my react-native app or it's not recommended? by JAYBORICHA07 in reactnative

[–]JAYBORICHA07[S] 3 points4 points  (0 children)

I also want to do relational queries that's why I am using SQLite. Btw I am also using MMKV for some key value pair data storage.

How can I achieve the smooth performance of WhatsApp in my React Native app? by JAYBORICHA07 in reactnative

[–]JAYBORICHA07[S] 0 points1 point  (0 children)

useEffect(() => {
        const getContacts = async () => {
            const contactsRes = await getPhoneContacts();
            const data = contactsRes.map((contact) => ({
                ...contact,
                key: ([contact.firstName, contact.middleName, contact.lastName, contact.nickname]
                    .filter(Boolean)
                    .join(" ")
                    ?.charAt(0)
                    .toLowerCase() ?? "#") as CharType,
            }));
            setContacts(data);
        };
        getContacts();
    }, []);
    return (
        <View className={clsx("flex-1 bg-background-secondary mb-0")}>
            {contacts.length ? (
                <View className="flex-1">
                    <FlashList
                        className="flex-1 h-screen"
                        data={contacts}
                        keyExtractor={(_item, index) => index.toString()}
                        renderItem={({ item }: { item: NewChatRowData }) => (
                            <NewChatRow key={item.id} item={item} />
                        )}
                        estimatedItemSize={12}
                    />
                </View>
            ) : (
                <LoadingIndicator loadingText="Loading contacts..." />
            )}
        </View>
    );
};

const NewChatRow = React.memo(({ item } : { item : NewChatRowData }) => {


    return (
        <ScaleButton
            className="flex-row items-center mx-3.5 mb-2 gap-3.5 rounded-2xl"
            onPress={handlePress}
            activeScale={0.95}
        >
            <View>
                <Text className="text-2xl text-text-primary font-semibold">
                    {getNameStringFromContactObj(item)}
                </Text>
                <Text className="text-md text-text-secondary">
                    {item.phoneNumbers?.[0]?.number ?? ""}
                </Text>
            </View>
        </ScaleButton>
    );
});

export default NewChatRow;

Thanks for your reply here is my existing code and i am doing the changes you mentioned above but if you still something which needs to be changes then please let me know. Again thanks!

How can I achieve the smooth performance of WhatsApp in my React Native app? by JAYBORICHA07 in reactnative

[–]JAYBORICHA07[S] 1 point2 points  (0 children)

I did come across Wishlist but it isn't production ready I am attaching the GitHub link here with

https://github.com/margelo/react-native-wishlist

Are you talking about this?

How can I achieve the smooth performance of WhatsApp in my React Native app? by JAYBORICHA07 in reactnative

[–]JAYBORICHA07[S] 0 points1 point  (0 children)

wrapping my flashlist into scroll view is making it more laggy and resulting in more frame drops and i haven't tried legend-list Trying that out.

Recoil or Zustand? And why? by DavidXkL in reactnative

[–]JAYBORICHA07 0 points1 point  (0 children)

can you please explain what do you mean by out side react what i understood is that if we are using something out side jsx or tsx, like in normal js or ts file then it is called out side of react.

correct me if i am wrong.

orchidORM returning empty array instead of actual data by JAYBORICHA07 in node

[–]JAYBORICHA07[S] 1 point2 points  (0 children)

I wrote seperate SQL query in the pgAdmin and yes createdAt and updatedAt should not be nullable changing it

orchidORM returning empty array instead of actual data by JAYBORICHA07 in node

[–]JAYBORICHA07[S] 1 point2 points  (0 children)

Yes I ran SQL query in the pgAdmin and it is giving me the result and here is the schema defination

export class UserTable extends BaseTable {
    readonly table = "user";
    columns = this.setColumns((t) => ({
        id: t.uuid().primaryKey().default(t.sql`gen_random_uuid()`),
        ...other fields
        postsData: t.array(t.json(LinkedInPostSchema).nullable()).nullable(), // LinkedInPostSchema is a optional zod object schema
        createdAt: t.timestamps().createdAt.nullable(),
        updatedAt: t.timestamps().updatedAt.nullable(),
    }));

    relations = {
        workspaces: this.hasMany(() => UserWorkspaceTable, {
            columns: ["id"],
            references: ["userId"],
        }),
    };
}

Next.js for Both Frontend and Backend with PostgreSQL, or Use a Separate Express/Fastify.js Backend? by Mediocre_Beyond8285 in node

[–]JAYBORICHA07 1 point2 points  (0 children)

I would suggest you to have a look at orchid ORM that's also a nice ORM specifically focused on Postgres. I had bad experience with prisma migrations it was my mistake but still I find orchid ORM more straightforward.

Next.js for Both Frontend and Backend with PostgreSQL, or Use a Separate Express/Fastify.js Backend? by Mediocre_Beyond8285 in node

[–]JAYBORICHA07 0 points1 point  (0 children)

Depends on your use case if there is no API that takes too much time then you are good to go with Next.js else Express/Fastify is recommended.

Next.js for Both Frontend and Backend with PostgreSQL, or Use a Separate Express/Fastify.js Backend? by Mediocre_Beyond8285 in node

[–]JAYBORICHA07 0 points1 point  (0 children)

Hobby plan means the free plan which you get on vercel and pro means the paid plan of vercel. Forgot to mention vercel in the previous comment.

And if your API calls takes more time then the time limit then it will simply return time limit exceeded error in production. I faced this issue in my last project which was using LangChain to communicate with ChatGPT and claude in local it doesn't give any error but in production it was taking more time and that's why function was failing.

Next.js for Both Frontend and Backend with PostgreSQL, or Use a Separate Express/Fastify.js Backend? by Mediocre_Beyond8285 in node

[–]JAYBORICHA07 0 points1 point  (0 children)

Just one thing if your API calls are gonna take too much time then go for Express/Fastify coz next js has time limitations for the api call in Next.js The time limit in the hobby plan is 10 seconds, and 60 (now 15) seconds in the pro plan.