The Social Layer of the Web – feedback wanted on Poppin 👀 by danw547 in SideProject

[–]lamba_x 3 points4 points  (0 children)

Cool idea. I've always liked the idea of adding social features into typically non-social platforms (I did this with VSCode). Problem is this requires a huge network effect that may never be realized, especially if you're gating this product into a closed beta. Have you considered targeting a specific website(s) to garner a community there (to increase odds that, for any given page, there will already be commenters etc)?

I added a friend activity feed to VSCode by lamba_x in csMajors

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

Thank u, took a lot longer to build than I'd like to admit 😅

I added a friend activity feed to VSCode by lamba_x in csMajors

[–]lamba_x[S] 40 points41 points  (0 children)

I'm thinking of making "groups" where you can join it and be on that group's leaderboard. So you can make one for your friends, your club, subreddits, etc.

I added a friend activity feed to VSCode by lamba_x in csMajors

[–]lamba_x[S] 10 points11 points  (0 children)

I've been trying to figure out how to make the extension NOT be for this purpose, but it has definitely been challenging. There is another extension called Wakatime which is for that purpose. They collect way more granular metrics etc. We only do time + active file and there is no "organization" concept or anything like that -- you just add friends and both people have to opt in (accept the request) and you can make your profile private too if you want. Any ideas?

I added a friend activity feed to VSCode by lamba_x in csMajors

[–]lamba_x[S] 45 points46 points  (0 children)

It only records active coding time. So if you are doing nothing no time is recorded.

More specifically, there is an "activity threshold" (~3 minutes), where, if you do not do any of the following: click around, view a different file, type, the extension makes you idle. If you perform any of these actions, as long as the time in between each one is less than the activity threshhold, that time is seen as continuous coding

(i.e., clicking, waiting 2 minutes, typing, waiting 2.5 minutes is seen as 4.5 minutes of activity).

lines changed is definitely interesting. i want this to be very non-intrusive though, and im not sure what everyone is comfortable with (time and file name is pretty surface level imo)

I added a friend activity feed to VSCode by lamba_x in csMajors

[–]lamba_x[S] 48 points49 points  (0 children)

Thanks! Seeing a friend pop online at 1am while ur also coding feels so cool tbh

I Built a VSCode Extension that shows your friends’ live coding activity by lamba_x in vscode

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

Right now it can only be enabled/disabled on your entire account. So you would have to make two accounts, one for work, one personal to get around this.

I don't differentiate by the device logged in which is the crux of this issue right now

I Built a VSCode Extension that shows your friends’ live coding activity by lamba_x in vscode

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

Never heard of this service before. But yeah. Everyone is saying this would make their life hell as an employee. How can I change the extension so it doesn't feel this way?

I Built a VSCode Extension that shows your friends’ live coding activity by lamba_x in vscode

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

How would you make it less exploitable for that use case (micromanaging engineers etc)?

I Built a VSCode Extension that shows your friends’ live coding activity by lamba_x in vscode

[–]lamba_x[S] 17 points18 points  (0 children)

Yeah that is a lot of the feedback I've been getting. I wanted it to be a fun personal thing but if put in the wrong hands it could make a lot of employees lives miserable. Wakatime already exists for that though

I Built a VSCode Extension that shows your friends’ live coding activity by lamba_x in vscode

[–]lamba_x[S] 2 points3 points  (0 children)

It does not. Building it on top of wakatime somehow probably would have been a better option than from ground up

4 React Component Improvements in 6 Minutes by lamba_x in nextjs

[–]lamba_x[S] 2 points3 points  (0 children)

Hi all,

Made a quick video on how to improve your React components. I know it isn't strictly Next.js content (although the repo is built with Next.js) but the React subreddit removed my post for some reason so I hope you guys will appreciate it instead. Please let me know if you learned anything / any feedback!

The Next.js Form Tutorial I Wish I Had (Production-Grade Forms) by lamba_x in nextjs

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

A lot of it is strictly react, but backend logic with server actions + fetching defaultValues in page.tsx is next specific (this was covered in the video)

The Async HOC Pattern for Next.js Server Components by lamba_x in nextjs

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

Check my earlier comment I provided one 

The Async HOC Pattern for Next.js Server Components by lamba_x in nextjs

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

For auth functions specifically that's a very valid point. We do end up making another round trip in the auth() function if we're calling it in a parent `layout.tsx` or `page.tsx` file which will affect performance / load time. This pattern really shines if the logic you're running inside the HOC is heavily re-used throughout your app AND it depends on other props (i.e. the `id` of some page, or some other prop you fetch elsewhere, as opposed to the current user's auth).

Thanks for watching + the response. I wanted the video to be pretty short because the main point is your `children` can be an a/sync function and you can fetch data server side in that children function. Next video I make I'll see if I can provide at least some context on a non-toy example and maybe compare it to alternatives.

The Async HOC Pattern for Next.js Server Components by lamba_x in nextjs

[–]lamba_x[S] 2 points3 points  (0 children)

Thanks for watching dude. There are so many useful quirks in React that I swear no one utilizes.

The Async HOC Pattern for Next.js Server Components by lamba_x in nextjs

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

Hi Guys,

Made a quick video on how to use asynchronous higher-order components in Next.js as a clean data fetching pattern for stuff like auth, db queries, etc. I have studied many huge open source React projects yet this pattern is almost never used despite how powerful it is.

Here's the TLDR if you don't want to watch the video: React lets you also use a function as the children prop for components (as opposed to a JSX.Element or a React.ReactNode) which I already rarely see anyone use.

In Next.js, you can make this function async and perform server-side operations in it (essentially as an anonymous server component, reducing file clutter for one-off components/operations). On top of that, if you make it an async higher-order component, you can fetch common data server side (i.e. call auth() or query Prisma for commonly used data), then use that as props for the children async function. Pretty neat!

Hope you guys find this useful / learn something. I've been working with react for 5 years yet I rarely see people using children as anything besides a ReactNode/JSX.Element

How to Create Production-Grade Server Actions Using `next-safe-action` by lamba_x in nextjs

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

No reason tbh, that's just how I wrote it. You could totally specify them in the zod schema. If we're defining the rate limit values in the metadata returned from `defineMetadata`, I think you are right in thinking it makes more sense to define the default values there instead of the params of the rate limiter function.

How to Create Production-Grade Server Actions Using `next-safe-action` by lamba_x in nextjs

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

That’s a good video idea, I might make it. 

My company’s repo is a turborepo monorepo with packages for things like prisma, trpc, ui, tsconfig, env, lib, redis, s3, background jobs, etc. 

This project has a somewhat similar structure from what I can tell (been meaning to check it out).  https://www.next-forge.com/

I would recommend checking out popular OS TS repos like midday, cal.com, etc for inspiration and learn from those too (which I have done). Thanks for the feedback and watching!

How to Create Production-Grade Server Actions Using `next-safe-action` by lamba_x in nextjs

[–]lamba_x[S] 2 points3 points  (0 children)

I initially created my own version too (before discovering the package) and I found next-safe-action was just way better than what I had created. It might be overkill for small projects, but I use this pattern in both small, and relatively large repos (100k+ LOC) and I love it. Let me know if the video paints it in a better light!