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
barkbell
Apr 14, 2006

woof
there was a lot of hype around remix but it doesnt seem that great? i dunno

Adbot
ADBOT LOVES YOU

prom candy
Dec 16, 2005

Only I may dance

Roadie posted:

For me, the one big thing still totally missing in Next as compared to Remix is form handling. Not "mutations" or any other fancy poo poo done through frontend JS, just plain form handling that will work right with a form POST from a static page.

Remix by comparison got this right from step 1 with "all mutations are just form submissions".

Yeah I really like that aspect of Remix. It really reminded me of building apps a decade ago, but with modern tooling and UX. It's going to be interesting to see if Next adds a data mutation story soon. They moved pretty fast on nested layouts after Remix was released.

Nova69
Jul 12, 2012

lazerwolf posted:

What’s the best framework for small web UIs,mainly for forms and data tables. I need to have graphql support.

It's not one single framework, but:

React with a Vite build aystem
Apollo Client for graphql
UI library of choice (bootstrap, material UI etc)
react-hook-form for form state management
ag-grid for data tables

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense
Small web ui they said. Not the most gigantic bloated web development environment possible that can construct a small web ui.

prom candy
Dec 16, 2005

Only I may dance

Nova69 posted:

Apollo Client for graphql

I don't know what the best is but I can tell you with certainty it's not Apollo.

(Try react-query or urql OP)

Nova69
Jul 12, 2012

prom candy posted:

I don't know what the best is but I can tell you with certainty it's not Apollo.

(Try react-query or urql OP)

Apollo Client is great, what are your issues with it?

Nova69
Jul 12, 2012

Nolgthorn posted:

Small web ui they said. Not the most gigantic bloated web development environment possible that can construct a small web ui.

It's the Web, its going to be bloated as soon as you pull in a single npm package

Macichne Leainig
Jul 26, 2012

by VG
Please don't deploy node_modules

hey mom its 420
May 12, 2007

Yeah, it seems they released next 13 too early just for the conference thing. the server component first approach looks great though, along with the nested layout and suspense thing. I tried playing around with it and was surprised how few actual client components i needed for some toy examples and how nicely colocated a lot of the code is. can't wait to give it a shot for real when it's released. it'll be quite a wait i imagine though.

if you're doing web these days there's a 90% chance you want next.js + typescript. Even if you don't use the fancy features like SSR/ISR, just the routing and utilities are worth it. as for the GraphQL client, try appollo or react-query and see which you like best I guess.

lazerwolf
Dec 22, 2009

Orange and Black

Nolgthorn posted:

Small web ui they said. Not the most gigantic bloated web development environment possible that can construct a small web ui.

Yeah exactly. The stack above more or less describes our current state. I was wondering if I could go lighter weight but we have some constraints with our data fetching

hey mom its 420
May 12, 2007

I know I often find mysef seesawing between:
- "I really shouldn't be reinventing things someone already did better, I should rely on libraries and premade components more" and
- "wow I'm getting bogged down in libraries, I should just stick to the minimum and roll my own solutions"

I guess the real art is in walking the line deftly. at my job they created all their own UI components (kind of badly) from scratch, and then we had one guy spending two weeks loving with a dropdown menu and it was still wonky after that. then, for a smaller project I said let's just use MUI, but I don't like it since it kind of locks you in and forces you to opt into a lot of other stuff and it's hard to customize. Now, I'm thinking of switching to tailwind + headless components (mix-matching from radix ui, headless ui, react-aria etc.). It takes a bit more work to implement actual components but I to me it feels like a nice middle ground between having control over your own code and not having to manually implement components with good UX/accessibility.

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense

lazerwolf posted:

Yeah exactly. The stack above more or less describes our current state. I was wondering if I could go lighter weight but we have some constraints with our data fetching

Unfortunately there is no really good graphql solution still. They're all a gigantic mess, frameworks built upon frameworks, upon frameworks. It's not really that complicated, I've been putting off writing my own implementation because I have too much on my plate already.

At least client side it's possible to easily interact with a graphql server long as you're willing to write your graphql queries by hand.

https://stepzen.com/blog/consume-graphql-in-javascript

Edit: or I dunno something like this

https://www.npmjs.com/package/gql-query-builder

Nolgthorn fucked around with this message at 22:05 on Oct 29, 2022

prom candy
Dec 16, 2005

Only I may dance

Nova69 posted:

Apollo Client is great, what are your issues with it?

Working with the cache is a nightmare and it's bloated relative to other options.

Edit: also I know the original poster said they need it but for everyone else just avoid graphql in general imo unless you have a good reason for needing it. Use like Next + tRPC if you can control your whole stack.

prom candy fucked around with this message at 22:36 on Oct 29, 2022

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!
I have years of experience in Angular and Vue, how do I get a different job when basically everyone uses React?

Before you say "just learn React", even if I had the time, would that even be good enough since it wouldn't be in a "professional" setting and just something I did in my free time?

The Fool
Oct 16, 2003


learn enough react to get through an interview and lie on your resume

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense
I can't even imagine finding a job that doesn't use react and redux. I'm looking for jobs just even backend node, they all want react too. I tried job agencies and every single job and company all want react.

Every job as far back as I can remember to ruby on rails have all been react. I can't escape it!!! Somebody help me!

worms butthole guy
Jan 29, 2021

by Fluffdaddy
Leave web dev?

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense
No way, it's a gravy train

Summit
Mar 6, 2004

David wanted you to have this.
Learn React as best you can, put it on your resume as a technical skill, when asked say you’ve done some side projects and would love to get a role working with React professionally. Be honest that you’re green with that specific tech but experienced in frontend generally, and willing to learn something new. So many bad devs learn one lib and then refuse to acknowledge anything else exists, this will be a good explanation to certain other devs who understand that the fundamentals and the ability to learn are more important than rote knowledge.

camoseven
Dec 30, 2005

RODOLPHONE RINGIN'

Summit posted:

Learn React as best you can, put it on your resume as a technical skill, when asked say you’ve done some side projects and would love to get a role working with React professionally. Be honest that you’re green with that specific tech but experienced in frontend generally, and willing to learn something new. So many bad devs learn one lib and then refuse to acknowledge anything else exists, this will be a good explanation to certain other devs who understand that the fundamentals and the ability to learn are more important than rote knowledge.

This is what I did and it worked very well

Vincent Valentine
Feb 28, 2006

Murdertime

Also if you've learned Angular and Vue learning React will not be hard nor time consuming. It's basically just gonna be you figuring out new syntax to implement similar ideas.

prom candy
Dec 16, 2005

Only I may dance
Core react is really pretty simple, especially if you already know FE frameworks. Learning the ecosystem and metaframeworks is harder but I think you could get React basics down in a weekend.

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense
Redux is still kind of the killer for me, I keep forgetting how I'm supposed to do things it feels convoluted. Other state management tools I've used aren't nearly as hard.

hey mom its 420
May 12, 2007

Redux sucks anyway, at least when you take into account how it's usually used in most companies. It's simple enough since it's just a global store with reducer functions and hundreds of lines of boilerplate. But conceptually it's not hard to learn.

Same goes for React if you've already used Vue, the basic concepts are the same really. It's just components, props and state. React went off on its own with hooks and now next.js, but Vue is playing catch up in that area. But there are a million learning resources for React, and I'm sure people here will be happy to answer your questions. It's up to you to make the time though.

One thing that I think will give you an advantage is knowing TypeScript. All good web dev companies are either using or transitioning to TS, and not just because it's fancy, but because it's really really good.

HaB
Jan 5, 2001

What are the odds?

The Merkinman posted:

I have years of experience in Angular and Vue, how do I get a different job when basically everyone uses React?

Before you say "just learn React", even if I had the time, would that even be good enough since it wouldn't be in a "professional" setting and just something I did in my free time?

Counterpoint: there are plenty of Vue jobs out there, my man. You just have to look a bit.

I hate React and would rather pluck out my eyeballs with a shrimp fork than work on it.

I just switched jobs 4 months ago. There were plenty of things to apply for and interview for.

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!

HaB posted:

I just switched jobs 4 months ago. There were plenty of things to apply for and interview for.

Feels like 4 months ago was still in the "Great Resignation" period, now we're in the "impending global economic collapse" period so I don't see as many jobs.


Thanks everyone for the advice.

worms butthole guy
Jan 29, 2021

by Fluffdaddy
Yeah try learning useContext before messing with Redux, I'd argue it makes Redux easier to grasp

gbut
Mar 28, 2008

😤I put the UN🇺🇳 in 🎊FUN🎉


worms butthole guy posted:

Yeah try learning useContext before messing with Redux, I'd argue it makes Redux easier to grasp

But also don't use context for global state.

worms butthole guy
Jan 29, 2021

by Fluffdaddy
Not doing this argument agai. Lol

gbut
Mar 28, 2008

😤I put the UN🇺🇳 in 🎊FUN🎉


Ok, I admit I'm not a heavy context user myself, so I'm mostly conveying information I've heard from colleagues with more experience: context is not optimized for global state and using it as-is leads to triggering re-renders on props that haven't changed, unlike scoping updates via reducer in redux. I've been avoiding it due to that little nugget of wisdom(?)

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.
I think React is definitely nicer to use than something like Angular, but there are a ton of footguns everywhere. If you're building a SPA of any reasonable size there are a ton of React details you need to be aware of to avoid having 50% of your page rerendered every time the user moves their mouse. IIRC they are working on tooling that inserts all the relevant memoization hooks automatically, but currently it's definitely not great.

(Cue "well actually, you just have to..." replies)

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense

Sagacity posted:

I think React is definitely nicer to use than something like Angular, but there are a ton of footguns everywhere. If you're building a SPA of any reasonable size there are a ton of React details you need to be aware of to avoid having 50% of your page rerendered every time the user moves their mouse. IIRC they are working on tooling that inserts all the relevant memoization hooks automatically, but currently it's definitely not great.

(Cue "well actually, you just have to..." replies)

I think it will continue being slow forever until they replace it no matter what.

barkbell
Apr 14, 2006

woof

gbut posted:

Ok, I admit I'm not a heavy context user myself, so I'm mostly conveying information I've heard from colleagues with more experience: context is not optimized for global state and using it as-is leads to triggering re-renders on props that haven't changed, unlike scoping updates via reducer in redux. I've been avoiding it due to that little nugget of wisdom(?)

use it for low-velocity changes like your ui theme provider, your google analytics id provider, hell even user info

also, just learn react op

hey mom its 420
May 12, 2007

Yeah, having to manually employ useCallback and useMemo isn't the best development experience. But if you (big if) organize your stuff correctly, you'll only have to use such optimizations in rare instances when things are noticeably slow.

My main gripe with Vue was that it's always playing catch-up with React (hooks/composition API, TS integration, etc.) but somehow React has a way more stable API despite being the one to pioneer new features. Vue 2 feels really outdated, but Vue 3 feels not mature enough (especially when I was looking to do SSR), and upgrading from 2 to 3 is a real pain (flinches in python). Also the templates not being JSX by default really hurts it when it comes to TS integration and composability. The computed properties in Vue are great though, it's like getting MobX for free.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

gbut posted:

But also don't use context for global state.

Absolutely use context for global state.


Just make sure it is state that changes exactly once when the user logs in.

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense
It feels like there's an enormous amount of states that don't require a re-render and are only useful for event handling. They are used the split second they are needed and that's all, so more or less 99% of re renders that are happening don't matter. Which is why hooks became so prominent, I can say "unless this prop changed ignore whatever is going on". And I use it absolutely everywhere.

Maybe it's time for the entire design concept to change.

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense
The whole Idea that I need to explicitly wrap a component in React.memo, just so that it doesn't update unless it's props change, is completely insane to me. React is the most overrated framework to have ever existed.

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
that's a fair argument, but after working with something like vue for a couple years which tries to give you better out-of-the box diff checking but no escape hatch to do it manually yourself, having access to things like react.memo and shouldComponentUpdate is really nice

working on app for a few years with coworkers coming and going really makes memoization techniques nice to have when you can't review ever PR

teen phone cutie fucked around with this message at 02:29 on Nov 1, 2022

Macichne Leainig
Jul 26, 2012

by VG
They should just rename it Hooks.js :colbert:

Adbot
ADBOT LOVES YOU

dupersaurus
Aug 1, 2012

Futurism was an art movement where dudes were all 'CARS ARE COOL AND THE PAST IS FOR CHUMPS. LET'S DRAW SOME CARS.'

Nolgthorn posted:

The whole Idea that I need to explicitly wrap a component in React.memo, just so that it doesn't update unless it's props change, is completely insane to me. React is the most overrated framework to have ever existed.

That’s not how it works, though?

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