Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Cheston
Jul 17, 2012

(he's got a good thing going)
Can OAuth come with content restrictions? I'm making a site that will have adult content (though not an outright porn site), and I don't want to let users log in through Apple or Twitch and then have that rescinded. At a glance it looks like porn sites only use email auth, but I can't find a concrete reason for that.
** the answer is absolutely and that you are entirely at each oauth provider's mercy


neurotech posted:

I'm looking for suggestions on ways to keep on top of what's happening in the front end space in terms of new tools, industry news, interesting articles, that sort of thing.

How do you all keep your finger on the pulse of this stuff?

JavaScript Weekly. There's also a companion newsletter, Node Weekly, for backend JS.

Cheston fucked around with this message at 23:26 on Mar 18, 2022

Adbot
ADBOT LOVES YOU

Cheston
Jul 17, 2012

(he's got a good thing going)

fsif posted:

So say I have a pretty simple React app—one where you go through a short survey and are given a recommendation at the end. I don't care about SEO or things being server side generated or really routing.

If I know this app is going to be accessed almost exclusively on mobile devices with varying connection speeds, is there still a benefit in using Next.js over just a simple Vite/React build? Like, if the code is statically or server side generated, will it load more quickly or be more performant than just loading everything on the client? Or would the differences be largely negligible? Or any other considerations I'd need to account for?

Just building your JS/CSS/HTML in advance and serving it will have the same benefits as statically generating a page in Next.js. The code will not be more performant, but it will start to load more quickly.

Vercel as a hosting platform does some great stuff on top of next.js. In theory any serverless hosting platform can do what they're doing, but none of them are doing it as well.

Cheston
Jul 17, 2012

(he's got a good thing going)
Any recommendations for senior front-end engineer interview prep? Or just Senior interview prep in general? I have no problem with the coding challenges I'm getting, and I can talk very well about personal projects, but I feel like I'm supposed to be asking five erudite questions every minute and I can't think of any.

Cheston
Jul 17, 2012

(he's got a good thing going)
Here's some next.js. I have router and router.isReady in the effect's dependencies, but the exhaustive-deps rule claims I only need router.

code:

function PreloadDestinationThing() : ReactElement {
  const router = useRouter();
  const [href, setHref] = useState<string>(null);
  useEffect(() => {
    if (router.isReady && href != null) {
      let dest;
      if (Array.isArray(router.query.dest)) {
        dest = router.query.dest[0] ?? '/';
      } else {
        dest = router.query.dest ?? '/';
      }
      router.prefetch(dest);
      setHref(dest);
    }
  }, [router, router.isReady, href]);

...
Are React Hooks required (or at least, intended) to always return a new object when any part of the current object is altered? Is there explicit documentation on the rules Hook authors must follow?

Cheston
Jul 17, 2012

(he's got a good thing going)

M31 posted:

Yes, the exhaustive-deps rule assumes the dependencies are not mutable, so router.isReady is unnecessary because if it has changed it would mean router also changed. https://beta.reactjs.org/learn/lifecycle-of-reactive-effects#can-global-or-mutable-values-be-dependencies

Btw, the href state seems like a bug (it will never be != null)? If you are calling setHref somewhere else you are better of calling prefetch at that time as well.

gotcha, thanks!

And yeah, it looks like I fixed that bug somewhere along the way.

Cheston
Jul 17, 2012

(he's got a good thing going)

smackfu posted:

Which version of Next allows me to ignore all the React Server Components stuff?

In Next 14 you can just serve a client component from the root server component and never have to deal with it. Or use the pages router instead of the app router, though with that your paths can only be yoursite.com/two/levels deep.

Cheston fucked around with this message at 15:02 on Jan 3, 2024

Adbot
ADBOT LOVES YOU

Cheston
Jul 17, 2012

(he's got a good thing going)
I quit my (mid-level front-end) job last year to deal with medical issues, and I'm starting my job search again. Does anyone have recommendations for front-end interview prep?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply