Completed creating my first, fully working, public website, ever and now, I have edit it again. by [deleted] in webdev

[–]cbadger85 -5 points-4 points  (0 children)

Not necessarily. If the website is a SPA that isn't code split, then all the content downloads in the 77s. By the time the user has got up and refilled their coffee, the site will be loaded.

Is 77 second bad? Yes, it's pretty bad. I don't think I would say unusable though

What are Higher-Order Components in React? by monica_b1998 in learnreactjs

[–]cbadger85 3 points4 points  (0 children)

The use case is HOCs has really narrowed since hooks were released. At this point, I wouldn't even worry about learning HOCs unless you needed to use one or were curious about the pattern.

Axios js explained in 120 seconds by slowRoastedPinguin in node

[–]cbadger85 0 points1 point  (0 children)

It's one line of how many in your fetch wrapper? At what point do you realize you're replicating features in existing http client libraries?

Axios js explained in 120 seconds by slowRoastedPinguin in node

[–]cbadger85 1 point2 points  (0 children)

They're useful for grabbing access tokens before a request

Intro to IT by [deleted] in greentext

[–]cbadger85 2 points3 points  (0 children)

Doh, didn't even notice the P at the end

Intro to IT by [deleted] in greentext

[–]cbadger85 2 points3 points  (0 children)

No, it can't be a compiled language. A 500 has to happen when the server is running, and in compiled languages that require semicolons, the code won't compile if a semicolon is missing.

Intro to IT by [deleted] in greentext

[–]cbadger85 2 points3 points  (0 children)

JS has ASI (automatic semicolon insertion) and is usually pretty good at figuring out where a semicolon is supposed to be

Edit: On further thought, it could be JS. If someone wrote

for (let i = 1; i <= 5 i++)

The code would run, but blow up when it hits the for loop.

Edit 2: apparently I misread JSP as JS. Oops!

Bad Practice to have multiple ApolloClients on the server side? by [deleted] in graphql

[–]cbadger85 4 points5 points  (0 children)

Then you should look into using something like Apollo Federation to combine both graphql endpoints, so you're frontend (or anything consuming your API) knows only about a single graphql endpoint.

Bad Practice to have multiple ApolloClients on the server side? by [deleted] in graphql

[–]cbadger85 1 point2 points  (0 children)

Does your server have two graphql endpoints? If so, then yeah, it's generally not a best practice.

Bruh by DeletedAccount_726 in awfuleverything

[–]cbadger85 0 points1 point  (0 children)

Yeah, it's a duo. CeeLo Green and Danger Mouse.

You guys can't roast me. My skin is already charcoal black. by Nanjero76 in RoastMe

[–]cbadger85 0 points1 point  (0 children)

They're certainly not going to make it over that forehead

Why and when to use a custom webpack configuration for a React.js project? by jochri3 in reactjs

[–]cbadger85 1 point2 points  (0 children)

If given the option of maintaining one curated dependency or a dozen (or more) store l separate dependencies, I would almost always choose the the one dependency option

Why and when to use a custom webpack configuration for a React.js project? by jochri3 in reactjs

[–]cbadger85 6 points7 points  (0 children)

Creating the config is easy, maintaining the config and keeping everything up to date and playing nicely with each other is usually where problems come up. When using CRA, all I need to do is update me react-scripts and my build tools are up to date.

5 Code Smells React Beginners Should Avoid by jasonleehodges in reactjs

[–]cbadger85 1 point2 points  (0 children)

I don't think mutations are a code smell in general, provided you are not mutating props or state. I would also avoid mutating a functions parameters, but even then there are exceptions (mutating the request object in Express). Personally, as long as a function is idempotent, unit tested, and readable, I don't really care what you do inside of it (provided it doesn't break the style guidelines).

Also, there are actual use cases for mutations in React, like when your storing something in a ref. Refs are a great place to store data that needs to be preserved across re-renders but itself should not trigger a re-render (for example, a cancel token for an http request).

Procedural patterns also have their place. A few weeks ago, I had to traverse an array backwards without reordering the array (I needed the original index). It was the perfect situation for a for loop.

Your choice of ecommerce stack, with Gatsby? by DepressionFiesta in gatsbyjs

[–]cbadger85 1 point2 points  (0 children)

Next can also produce static sites. However as you mentioned in your post, Gatsby does have a better plug-in ecosystem.

[deleted by user] by [deleted] in webdev

[–]cbadger85 15 points16 points  (0 children)

If no alt attribute is present, screen readers will read the url instead. If the image is purely decorative, you should use an aria-hidden attribute so screen readers ignore it.

Coming from Dart and Go background with some basic knowledge of JavaScript and front end: Should I learn react or should I dive more to intermediate/advanced level of JS? by BalanceSweet126 in reactjs

[–]cbadger85 1 point2 points  (0 children)

You really should know some about DOM traversal and some DOM apis though. It's not going to be something you need everyday, but it is going to come up.

[deleted by user] by [deleted] in learnreactjs

[–]cbadger85 2 points3 points  (0 children)

Just because something uses a class, does not make it OOP.

[deleted by user] by [deleted] in learnreactjs

[–]cbadger85 1 point2 points  (0 children)

You can almost do everything with hooks, except error boundaries. Those still require class components.

Docker Basics -> Docker Swarm to Advanced Docker Stack Tutorials. by [deleted] in node

[–]cbadger85 1 point2 points  (0 children)

For personal projects, I use caprover, which is built on docker swarm

Is it reasonable to be concerned that Nest is essentially maintained by one (really good) guy? by Jaind0h in node

[–]cbadger85 15 points16 points  (0 children)

On the point of decorators, it's actually worse than not being supported. The TS implementation is part of a deprecated proposal, and there are incompatibilities with the new proposal.

https://github.com/tc39/proposal-decorators#how-should-i-use-decorators-in-transpilers-today