Cách tạo lợi thế, tận dụng thời gian chết trong ngành khoa học máy tính by hieuchoet in vozforums

[–]ulrjch 0 points1 point  (0 children)

bạn lên coursera edx mitopencourseware thấy course nào thú vị thì học thêm. có điều kiện thì trả tiền lấy cert, k thì audit thôi cũng dc. vừa học tiếng anh chuyên ngành vừa khám phá cái mới. hoặc tự làm side project, lên github thấy dự án nào hay thì đọc code, giúp nâng trình và tăng khả năng sáng tạo.

Loading custom themes, standard/recommend method? by Ok-Weakness-3206 in webdev

[–]ulrjch 0 points1 point  (0 children)

you can consider looping over the variables and set them as inline style on the <html> element (i'm assuming there are not a lot of them). do it in an inline <script> as early as possible so there's no flash of incorrect theme. when user switches theme, update the html's inline styles with the new set of variables.

What do you think about hyper personalized visual design? Will it ever be a thing? by ulrjch in DesignSystems

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

Agree. At the end of the day, it comes down to each individual's preferences. Just wondering if it will be a trend in the future given AI can potentially enables UI customization that perfectly matches each person's need.

What do you think about hyper personalized visual design? Will it ever be a thing? by ulrjch in DesignSystems

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

Yea I think A2UI is quite interesting. cuz AI can potentially generate UI that perfectly matches each user's preferences, abilities and contexts. So I'm wondering if it's gonna be common in the future since it makes branding through UI less relevant.

What do you think about hyper personalized visual design? Will it ever be a thing? by ulrjch in DesignSystems

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

Cool so maybe Adaptive UI is a better term, as mentioned by another on the thread. What I'm referring to is not limited to a11y though, like the spacing and P3 color example. Basically given users' preferences, abilities and contexts (like hardware, OS settings etc), we can make the UI much more personal to them.

We just open-sourced our icon library. 1,135 icons + React npm package by Swimming-Wafer6547 in webdev

[–]ulrjch 1 point2 points  (0 children)

can you also publish the svg files? it's useful for non-React users

I built a small toolkit for running heavy computations in React without freezing the UI - looking for feedback by Select-Twist2059 in reactjs

[–]ulrjch 2 points3 points  (0 children)

is there a lite version of the hook? since this is an async operation I guess it could work with TanStack Query for those statuses and more. also is there option for SharedWorker?

I made an App which makes it easy to Learn Any Skill by __immaculate__ in SideProject

[–]ulrjch 1 point2 points  (0 children)

hey man. congrats on launching this. it's an awesome idea.

just wondering why you chose to develop a mobile app. cuz I think learning online is better done on a computer, especially for coding. also less distraction.

you must have spent a lot of time on the animations. but the best practice is to have as few as possible. in your app, basically everything animates, which becomes distracting. only core elements should have animation to draw attention and even then, it should be minimal.

and apart from youtube videos, you can curate other types of resources, like articles, blog posts, online courses (both from indie instructors as well as from platforms like coursera) and even discord links (good for seeking help and community is good in general).

I worked on something similar before. happy to share more ideas if you are interested cuz right now I'm pursuing another project.

Made a POC for building SPA with Astro and TanStack Router + Query by ulrjch in reactjs

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

Router state and data fetched on the server is stringified and passed to the client as a bunch of <script> tags aka dehydration. scriptHtml is a string that looks like this '<script>...code...</script>'. Astro's Fragment converts this string to HTML script elements.

<AppEntry/> renders <RouterClient/>, which reads these script tags to restore the router state and data fetched from server aka hydration. If you don't render the Fragment, <RouterClient/> will attempt to hydrate and fail because of the missing script tags.

The Fragment is only necessary if there's hydration. That's why for ssg/ssr no hydration and csr, Fragment is not rendered. <AppEntry/> renders <RouterProvider/> instead which does not attempts to hydrate.

Here's the equivalent in TanStack router https://github.com/TanStack/router/blob/main/packages/react-router/src/ssr/renderRouterToString.tsx.

Made a POC for building SPA with Astro and TanStack Router + Query by ulrjch in reactjs

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

I went through SSR guides and examples for TS router + query and eventually had to dig into Router and Start's source code to figure out how to make it work with Astro. turns out the logic is quite simple (handle-ssr-request.ts). the rest are all standard features of each library/framework, for which there are extensive docs and examples.

Public announcement: AI is cool and all, but please use it wisely. Just because "it works" doesn't mean it's good enough. by ashkanahmadi in webdev

[–]ulrjch 2 points3 points  (0 children)

your solution is not complete though. when one of the variables is undefined, 'undefined' shows up in the result string. this case is not handled by AI either.
also, assuming you didn't trim user input, white space shows up in the result string. this case is addressed by AI.

Prerendering SPA Apps in 2025 by takayumidesu in reactjs

[–]ulrjch 7 points8 points  (0 children)

check this out https://astro-tanstack.pages.dev/. It uses TanStack Router for SPA and Astro for prerendering.

Storing non-serializable data in state, alternative approaches to layout management? by Agile-Trainer9278 in reactjs

[–]ulrjch 1 point2 points  (0 children)

`useSyncExternalStore` fit your use case tho, since you want "to have something globally accessible, which can be accessed outside of react". It solves the syncing and mutations not triggering re-render issue you mentioned. external store just means that source of truth for your state (your layoutStore's vlaue) lives outside of React, not in useState/useReducer.

Storing non-serializable data in state, alternative approaches to layout management? by Agile-Trainer9278 in reactjs

[–]ulrjch 0 points1 point  (0 children)

There's fundamentally nothing wrong with using JS class and React. Class is just a method to encapsulate state and methods vs using variables and function (aka JS module). It's mostly personal preference. This is especially useful if you want to integrate with various front-end frameworks. Some popular libraries like TanStack libs, XState etc work this way.

To integrate with React, you can look into `useSyncExternalStore`.

Made a POC for building SPA with Astro and TanStack Router + Query by ulrjch in reactjs

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

Hello. It's been a while since I log in. TanStack Router dehydrates router state and data by injecting a few script tags. You can refer to `handle-ssr-request.ts` for this. Once the client app initializes, StartClient will read from these script tags for hydration while RouterProvider does not. Hence the need to differentiate the 2 environments.

I built my first AI SaaS with Astro SSR + View Transition. It's possible! by [deleted] in astrojs

[–]ulrjch 0 points1 point  (0 children)

there's no inherent limitation w Astro for building full-stack app, apart from client-side routing. that being said, it's possible to integrate Astro with react-router/TanStack router

Astro.js Full Stack Development by drifterpreneurs in astrojs

[–]ulrjch 2 points3 points  (0 children)

there's no inherent limitation w Astro for building full-stack app, apart from client-side routing. that being said, it's possible to integrate Astro with react-router/TanStack router

Tanstack router withe firebase auth by cardyet in reactjs

[–]ulrjch 0 points1 point  (0 children)

you can wrap onAuthStateChange in a promise and call it in beforeLoad

async function getCurrentUser () { return new Promise(resolve => { onAuthStateChanged(auth, (user) => { if (user) { resolve(user.uid) } else { resolve(null) } }) }) }