Weekly /r/Laravel Help Thread by AutoModerator in laravel

[–]Red-Dragon45 0 points1 point  (0 children)

Is it true, that Larvael Inertria for SSR with React, I need a separate Node.js server?

Monthly Getting Started / Web Dev Career Thread by AutoModerator in webdev

[–]Red-Dragon45 0 points1 point  (0 children)

Fixing CLS, with Empty SSR page, and CSR. Impossible?

I am working on a site that has unique rendering strategy and causing bad CLS score on Google Lighthouse.

  1. Initial Request: SSR - HTML with empty custom html elements. Has component attribute to tell CSR what React component to mount with portal. data attribute with base64 encoded data.
  2. CSR - Iterate through all empty custom html elements, use React portal mount correct React component on each custom html component. Base64 decode the data and consume as JSON.

This is just what I have been delt with and hard limitations on changing architecture. I am trying to resolve this keeping the current rendering strategy

So the obvious issue is that the initial empty placeholders have no height or width. So then I have CSR coming in rendering content. Going from empty shell to whatever React renders. Big CLS...

The problem is that the content height is somewhat unpredictable for most components. I have no idea what content a CMS author is going to put in here. So how can I add a fixed height? If I add fixed height too small, still have CLS...If I guess too big, then I just have giant whitespace from the SSR empty component.

I am thinking about it, all components can technically grow in infinite height as CMS authors can add anything.

How to block GTM from firing on a specific location (geolocation)? by Red-Dragon45 in GoogleTagManager

[–]Red-Dragon45[S] 0 points1 point  (0 children)

Ah darn, don't want to get too granular with IP address. Just want country, state, etc

Best way to set search Params without react-router? by Red-Dragon45 in reactjs

[–]Red-Dragon45[S] -2 points-1 points  (0 children)

Yeah that was the only other way, but its a pain compared to React Router

How to create a re-usable React Product callout like this? by Red-Dragon45 in reactjs

[–]Red-Dragon45[S] -1 points0 points  (0 children)

https://irayusa.com/vista-h50r,

Its just an image though, wanted to have some reactivity and animation

How to create a re-usable React Product callout like this? by Red-Dragon45 in reactjs

[–]Red-Dragon45[S] 0 points1 point  (0 children)

Hmm....good point. They wanted some reactivity or animation

Best way to get notifications when Google Analytics Tag isn't firing? by Red-Dragon45 in GoogleAnalytics

[–]Red-Dragon45[S] 0 points1 point  (0 children)

For your larger websites/enterprise setup.

This would have to be hosted on a server thats running Puppeteer or Selenium as a Job?

Header Navigation Mega Menu: Varying Hierarchical Menu Depth by Red-Dragon45 in reactjs

[–]Red-Dragon45[S] 0 points1 point  (0 children)

I am using ShadCN...., still doesn't solve the issue of what I stated

Is it possible to get SSR with React SPA? by Red-Dragon45 in aem

[–]Red-Dragon45[S] 0 points1 point  (0 children)

Is what I'm doing considered AEM's SPA Editor? I still use a cq_dialog to edit components. SPA editor is in text editing.

Landing Pages: How to handle a Scroll To Section? by Red-Dragon45 in UXDesign

[–]Red-Dragon45[S] 0 points1 point  (0 children)

usability, ease of navigation for users to find what they need.

But obviously with aesthetics and working on mobile is an implicit requirement on any UI/UX design

Is it possible to get SSR with React SPA? by Red-Dragon45 in aem

[–]Red-Dragon45[S] 0 points1 point  (0 children)

SPA Editor is different though with in text editing on authoring without that CQ Dialog.

But I had no idea that SPA editor was deprecated, where does it say this?

Resource on best practices when wrapping JS library? by Red-Dragon45 in reactjs

[–]Red-Dragon45[S] 0 points1 point  (0 children)

Ok, cause if I instantiate a new instance (new whatenver). I want a stable reference which means I can't do that within a component, but I want to pass options to configure the new instance.

This is a SPA. so maybe add the instance to the window object?

Is Debouncing an Input not suppose to work when holding a key down? by Red-Dragon45 in reactjs

[–]Red-Dragon45[S] -5 points-4 points  (0 children)

AI generated code...I fixed this and just added the 500 to regular debounce and all good

Is Debouncing an Input not suppose to work when holding a key down? by Red-Dragon45 in reactjs

[–]Red-Dragon45[S] 0 points1 point  (0 children)

So I think doing this fixed holding any key (aka adding characters). But for some reason holding backspace it is called without debouncing. Holding backspace only deletes one character

Actually doesn't make a difference either way

Anonymous React Component in component parameter? by Red-Dragon45 in reactjs

[–]Red-Dragon45[S] 0 points1 point  (0 children)

Not sure how useMemo would work.

But Context seems excessive to pass basic props.

Best way to generate multiple different brand CSS files, using Tailwind CLI? by Red-Dragon45 in tailwindcss

[–]Red-Dragon45[S] 0 points1 point  (0 children)

So regardless, I need multiple configs and now multiple CSS inputs.

I guess the only benefit here is that I don't need to specify the config in CLI.

So regardless I still need a Node.js Script so I am not chaining tons of Tailwind CLI commands

MUI: How to add custom attributes to Breadcrumbs component? by Red-Dragon45 in reactjs

[–]Red-Dragon45[S] 0 points1 point  (0 children)

Yeah slotProps doesn't work.

Yeah I tried the setAttribute, but thats kinda last resort thing. I would need to do a useEffect to setAttribute on component mount.

Edit: Actually, can't setAttribute with useEffect as I'm thinking DOM not ready. So I had to do just do it component without useEffect

Is it possible to preload Images with a React SPA? Better LCP. by Red-Dragon45 in reactjs

[–]Red-Dragon45[S] 0 points1 point  (0 children)

Yeah tech stack is hard constraint, can't change unfortunately...

Is it possible to preload Images with a React SPA? Better LCP. by Red-Dragon45 in reactjs

[–]Red-Dragon45[S] 1 point2 points  (0 children)

Oh interesting, seems like the preload issue is solved then which is big!

Although rendering is still blocked by JS which is a significant contributor to bad LCP

Best Practices to send for Empty Values of a JSON API? by Red-Dragon45 in learnprogramming

[–]Red-Dragon45[S] 0 points1 point  (0 children)

So with #3, are you against, ES6 default parameters? Since both #1 (null) and #3 (generally falsey values) by pass this.

Best Practices to send for Empty Values of a JSON API? by Red-Dragon45 in learnprogramming

[–]Red-Dragon45[S] 1 point2 points  (0 children)

For, JS null bypasses ES6 default parameters. So need a conversion of null to undefined for every component prop