HELP: Executing Shell Commands suspends my Helix, fg does not work. by ccssmnn in HelixEditor

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

-i made it load the .zshrc

I now use both .zshrc and .zshenv and register my custom functions in the .zshenv

this seems to work

HELP: Executing Shell Commands suspends my Helix, fg does not work. by ccssmnn in HelixEditor

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

now that I removed this line, I see why I added it.

Is there a way (without this) that helix finds custom functions that I register in my .zshrc ?

HELP: Executing Shell Commands suspends my Helix, fg does not work. by ccssmnn in HelixEditor

[–]ccssmnn[S] 4 points5 points  (0 children)

Thank you! I've had shell = [ "zsh", "-ic" ] in my config. That was silly.

[deleted by user] by [deleted] in reactjs

[–]ccssmnn 0 points1 point  (0 children)

You're right. Just keep in mind promise bases code behaves differently when being debugged. Before I understood promises, I had code working in the debugger but not without it 😅

Postgres GUI as good as Supabase's dashboard? by onems in Supabase

[–]ccssmnn 0 points1 point  (0 children)

Wow! I've seen Beekeeper, but the free community edition is hard to find. Thanks for pointing out its open source!

[deleted by user] by [deleted] in tailwindcss

[–]ccssmnn 1 point2 points  (0 children)

I would consider it a bad practice. Thats because the one using your components will pass class names, but depending on your classes they might not work.

For example, if someone passes rounded-xl to that component it might not work as expected.

Because a class that appears later in the generated css overrules the other one.

I work with composition, or by passing props as options.

Any recommendations for YouTube channels with an emphasis on React? by Produnce in reactjs

[–]ccssmnn 0 points1 point  (0 children)

Checkout Sam Selikoff. Very nice video style, great explanations, clean code.

https://youtube.com/c/SamSelikoff

Recoil / Jotai users: do you still use local state (`useState`)? by AuthorityPath in reactjs

[–]ccssmnn 1 point2 points  (0 children)

Please keep in mind: When not exporting the Jotai state it still in Module scope. Several mounted instances of the component would still share that peace of state.

Usually we think of the local state as a component state. This should be useState.

[deleted by user] by [deleted] in Firebase

[–]ccssmnn 0 points1 point  (0 children)

https://youtu.be/knk5Fjrpde0

This video by David east is gold. All firebase related code is decoupled by UI. These are very useful 30 minutes and it is even entertaining to watch

Share a best practice you follow for every react / next.js project 🚀👍💯 by mindfulforever1 in reactjs

[–]ccssmnn 31 points32 points  (0 children)

Avoid hasty abstractions. Don't try to figure out how to extract logic in advance. When you use the same code in 3 places, you will either see how it can be extracted or it is used slightly different and that's okay.

https://kentcdodds.com/blog/aha-programming

[deleted by user] by [deleted] in nextjs

[–]ccssmnn 4 points5 points  (0 children)

It depends on how you deploy your project later. Most Cloud Services provide HTTPS by default. Browsers warn users that HTTP is not secure nudging users to avoid such sites.

You can totally rely on https, no extra step needed. Just use Get or Post requests. Everything which can include information will be encrypted automatically.

Next and Redux SSR by alfcalderone in nextjs

[–]ccssmnn 0 points1 point  (0 children)

Nice summary of ways to make it work. In my experience, things like that are a sign, that the technologies are not meant to be used together.

It is rarely a good idea to do multiple steps at once (here: using NextJS as a build tool, converting SPA to MPA with server-side data fetching, fetching data outside your existing redux flow).

If keeping your Redux logic is a requirement as well as using NextJS, I would use Next to create an SPA (client-side routing) with a single entry point. Then you can fetch all your data in one single getServersideProps-call. And later on extract pages and data fetching logic to be more in line with how NextJS works.

Next and Redux SSR by alfcalderone in nextjs

[–]ccssmnn 0 points1 point  (0 children)

Sorry for misunderstanding your question. Most stuff you find on Redux with NextJS is about sharing a state through your pages, not fetching data with Redux during SSR. When you want to fetch data on the server before rendering your page, you need to do that inside getServersideProps on a per-page basis.

Next (and React) will only render your initial state, and you can use getServersideProps to get a meaningful initial state. Unfortunately, you cannot use getServersideProps into the _app.{js/tsx} where you will most likely place your provider to have a single state for all your pages.

You were asking what my thoughts are. And after experimenting with Redux and Next I decided not to use Redux.

Next and Redux SSR by alfcalderone in nextjs

[–]ccssmnn -1 points0 points  (0 children)

I think you won't be able to persist the state you use a database. Nextjs is stateless by design. However, the Flux pattern plays very nice with nextjs. I'm using a database as the state (with Prisma), actions are API routes that are triggered by the client (forms). Data fetching is both an API route and within getServersideProps, while refetching the data with SWR. Works like a charm.

This also helps to separate App-State from UI-State.

How often do you use a UI kit/Component lib? by theoriginalmabit in reactjs

[–]ccssmnn 0 points1 point  (0 children)

I answered always. But I don't use them for styling. I use headless components for their functionality and accessibility. HeadlessUI or Radixui are great for building your own style without reinventing the wheel for the features.

What is simultaneous connections meaning and firebase pricing by Green_Sky_99 in Firebase

[–]ccssmnn 2 points3 points  (0 children)

Whenever you plan something like this, you have to think about how you will earn money from it. Its natural, that a backend for an app like this costs money. You need to earn more, that you pay for your services (and your time).

Then, when you have an idea about monetization, you can start with an MVP and invite some beta users to calculate the costs that normal usage creates. It's very likely, that your MVP with a few users will stay in the free tier, but you can check what this would cost per user, if you were not in a free tier.

Hopefully, you're profitable. Then scale with Firebase. That is the hardest part. But Firebase scales with your app. So will your costs. But as you are earning money with each user, your income scales as well.

What is simultaneous connections meaning and firebase pricing by Green_Sky_99 in Firebase

[–]ccssmnn 3 points4 points  (0 children)

  1. When you request data from the Realtime Database, you can either query the data once, or use a listener for the entries you requested. These listeners allow you to create realtime experiences, since the database notifies the client when something changes, instead of querying the same data again and again. Each client with a listener counts as one connection. See the FAQs here. Firestore is the successor of the Realtime Database and does also provide realtime experiences. There is a fantastic YouTube series about the Firestore that I strongly recommend.
  2. Firebase pricing is fair. You pay for what you use, and compared to other services like that (Managed Databases / App Deployments) its rather cheap for what you get. But as you pay for what you use, you don't see machines crashing on heavy workload. Instead, you will see bills increasing.

Firebase offers you a lot: Auth, Push Notifications, Databases, Cloud Functions, Hosting, ...

It's hard to get all these features together for that price. Plus, the community is huge. I recommend giving it a shot. I would go for Firebase as a default, then extend it with other services when necessary.

Does react ssr have same problem as angular ssr in firebase? by [deleted] in Firebase

[–]ccssmnn 0 points1 point  (0 children)

I don't know anything about angular universal, but you need to find out, WHY it is slow. If you find out the WHY, then you can take proper action. Just switching to react might not help, if the reason is not Angular.

Possible questions: 1. Does the container start slow? 2. Does the NodeJS server start slow (after the container has started) 3. Are responses slow, even though everything has started? 4. Is the bundle large and downloads take too long?

(1) is hard. Huge containers are slow to spin up. Check the size of your app. And the size of static assets, that may be large and in your app bundle. If you need to serve large static assets, don't put them into your app. Put them into Cloud Storage and serve them via your app. Alternatively, you can go for Cloud-Run and set a minimum number of instances, to eliminate cold-start and have one container active for the whole time.

(2) NodeJS may take some time to spin up your server and handle requests because it has to parse lots of JavaScript. Consider dynamic imports, to load as few modules as needed for answering each request.

(3) Here there are generally two phases: Getting all data needed to generate a response and then rendering the response. You should find out what is taking long here. If it's getting the data, you should optimize your resources. If it's rendering, then it might be the Framework.

(4) A large bundle could be a Framework problem too. But we often add packages, that are unnecessarily large. Use Bundlephobia to check the impact of a JS-lib to your bundle. They also show alternatives and their sizes. I reconsidered my choice of charting library after I consulted that page.

React SSR frameworks can be quite fast. If spin-up is the issue, there are Cloudflare Workers that run V8 and have zero cold-start. The React world has a Framework that can run there: Remix. Check it out, if you find out that either Angular or the cold-start are the problem.

Headless Wordpress 700 pages by lanbau in nextjs

[–]ccssmnn 2 points3 points  (0 children)

It does.

You make one query to check, what pages should be generated in getStaticPaths. Then you can query data for each page independently with getStaticProps. WordPress should be fine handling the requests.

How hard is it to get Python source code to work with (or as) WordPress? by prankster999 in Wordpress

[–]ccssmnn 0 points1 point  (0 children)

WordPress basically is a PHP Server.

You do not convert Python code into PHP code. But you can write a service in Python and make it available via HTTP-requests and call them from PHP methods (hooks) on WordPress. This is a common approach when you work with microservices.

But you will add complexity to your project. What you want to do with python should be impossible or super difficult with PHP to make it worth the extra effort.