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
Gildiss
Aug 24, 2010

Grimey Drawer

Skandranon posted:

It may be possible to make more concise, but I've not had time to work on it (because React is the devil and I hates it).

I have just started dipping my toes into React in my down time and I am kind of liking it after having been working with Angular for a year now.
But my roots are in functional and not OO, so that may be why.
What are the specific reasons you have for React being demonic?

Adbot
ADBOT LOVES YOU

Gildiss
Aug 24, 2010

Grimey Drawer
Didn't twitter move completely away from rails? No big companies behind it means a loss of momentum and eventual death.

Gildiss
Aug 24, 2010

Grimey Drawer

Noam Chomsky posted:

https://www.quora.com/Why-did-twitter-move-away-from-Ruby-on-Rails

Twitter's reasoning for moving away from Rails does not apply to anyone just getting started or really any app that isn't as highly used as Twitter.

Yes, but most places that are hiring wont be picking it up nearly as much these days without a big name behind the tech. And that leads to less positions, less overall support and new developments, etc.
Angular - Google, React - Facebook, Everything soul crushing enterprise places love - Microsoft.

https://www.youtube.com/watch?v=a5dpBpaFiMo

It's basically this, but the ending is different.

Gildiss
Aug 24, 2010

Grimey Drawer

Read that this morning and had the exact same thought.

Gildiss
Aug 24, 2010

Grimey Drawer

Lumpy posted:

See what happens when you ask questions instead of assuming everything you don't understand is stupid and wrong-headed?

The best is thinking it's stupid and wrong-headed, but then not saying anything because who cares and then cash your big paycheck and leave the company in a year.

Gildiss
Aug 24, 2010

Grimey Drawer

Vesi posted:

any reason you're not using angular2 since this doesn't seem like a legacy project?

Everything I've read about angular 2 sounds like a stability nightmare.

Gildiss
Aug 24, 2010

Grimey Drawer

MrMoo posted:

Isn't that just JS frameworks in general? They don't exactly have a long shelf life.

Meanwhile looks like Polymer 2 is starting to ship and defaulting to ES6 classes to define web components.

The only articles I had seen about Angular 2 were about breaking updates and the modules it depends upon not being stable either.
Now I just don't see anything about it.

So yes, business as usual for JS packages.

Gildiss
Aug 24, 2010

Grimey Drawer

Honest Thief posted:

I need to improve my test methodologies, I know how to use test frameworks, like Karma for instance, but plainly I don't know how to even start unless someone forces me to just squirt out some tests to fill out their progress reports. I'm not the biggest fan of TDD due to mostly the community at times coming of as ideological and dogmatic, but I guess I can improve without having to buy into the whole thing.

Maybe put in coverage requirements?

Gildiss
Aug 24, 2010

Grimey Drawer

Honest Thief posted:

I got none, this is more in cases when, like it has happened before, a project manager requests for test coverage and just leaves it at that.

So put in a build requirement that test coverage on all services must be above x or the build fails.

Gildiss
Aug 24, 2010

Grimey Drawer

Honest Thief posted:

It's more about writing meaningful tests, something beyond render function and expect(component).toExist(). Most of the time I just feel lost when trying to come up with tests.

Oh, well yeah.
:same:

Gildiss
Aug 24, 2010

Grimey Drawer

Helicity posted:

http://artofunittesting.com/

Great book even if you're not a C# developer. I still personally can't do TDD since I like to get something working first, but after that point I'll usually write tests hand in hand with the feature. I'll do TDD if fixing a bug. Good unit tests > no unit tests > bad unit tests. Having to learn new code or refactor old code with awesome unit tests in place almost makes you break down and cry with happiness.

A good book.

Can also find videos of him giving talks about the book which are nice summaries of the main points.

Gildiss
Aug 24, 2010

Grimey Drawer
Are you all staying at positions that would even warrant this long term thinking?
My last 2 years have been going from burning wreckage to burning wreckage.
I feel like I'm in a season of walking dead seeing an idyllic place and watching it destroyed from within by idiots and then everyone dies or is scattered to the winds.

Gildiss
Aug 24, 2010

Grimey Drawer

a hot gujju bhabhi posted:

I've got an issue with hover effects on the iPad. When the user touches the screen to scroll, it activates the hover state for the element that they've touched. Is there a way to change this behaviour? It looks ridiculous, and this is just one of MANY issues the iPad is giving us.

Don't use hover effects?

Gildiss
Aug 24, 2010

Grimey Drawer
We almost had to develop exclusively on IE at Bank of America after an IT director saw a dev change a dollar amount using the dev console. He issued an order to force all devs to remove Chrome.
There was obviously push back but I don't think he got called a retard which is unfortunate.

Gildiss
Aug 24, 2010

Grimey Drawer

ROFLburger posted:

I don't get it. Could you not demonstrate to that person that you could do the exact same with with the IE dev tools? Or was this at a much earlier time

This was about a year ago.

Gildiss
Aug 24, 2010

Grimey Drawer

Odette posted:

Unfortunately (or fortunately? I'm not sure), there are still dozens of people that believe Microsoft under Nadella is just a fox in sheep's clothing, waiting to use the 3 E's again.

You don't? Just take a look at the Windows 10 data they are collecting. They're still dirt nasty.

Also what is this React Fiber?

Gildiss
Aug 24, 2010

Grimey Drawer
On top of that the worst devs I have worked with have all been Java devs so it could potentially be very easy to impress in that field.

Gildiss
Aug 24, 2010

Grimey Drawer
http://arepublixchickentendersubsonsale.com/

All you need is a question to get started.

Gildiss
Aug 24, 2010

Grimey Drawer

an skeleton posted:

Anyone have any suggestions or good experiences with trying to share CSS/whatever your styling language is across multiple projects for consistency? We're a react shop if it matters.

Make a general theme and style guide and documentation with examples and explanations of common components, very similar to Bootstrap. This gives people no excuse to not follow that common set of rules for components.

Gildiss
Aug 24, 2010

Grimey Drawer

prom candy posted:

I know javascript, es6, es7, and coffeescript.

Forgetting jQuery?

Gildiss
Aug 24, 2010

Grimey Drawer

Helicity posted:

All 4 of my dev jobs have been through networking. Befriend 1-2 good recruiters and stay in touch, make friends with a handful of cool people at each job, go out to lunch with them at least once a year. Go to user groups/meetups and do the same. Then you hear about cool things from people. This isn't something you can see benefits from immediately, so it requires prep and patience. That's not incredibly useful to you right now, but I'd consider it for the long-term.

And make sure you land in a city you want to be in because I'm going to move soon and lose all my connections and reputation soon! Can't wait to start over again! gently caress living in America!

Gildiss
Aug 24, 2010

Grimey Drawer

Thermopyle posted:

Yes, but that's not what it seems like this person is saying...

Yeah, I am mostly salty about having to live in the US still for other unrelated reasons.
Maybe 'gently caress open offices!' or 'gently caress my inability to pass remote interviews!' would be more appropriate?

Gildiss
Aug 24, 2010

Grimey Drawer

Lumpy posted:

The only thing I dislike about VIM is that now I simply can't use anything else because it feels sooooo sloooooowww to work in. And nobody has a VIM-mode plugin that actually does all the stuff that makes VIM so good.

I've been tempted to start learning it.
But I don't want to get a set of keys for a mechanical keyboard with all the vim shortcuts on them like my old coworker.

What's a good cheat sheet?

Gildiss
Aug 24, 2010

Grimey Drawer
I only just discovered PWA and AMP via a code challenge for an interview and that is an excellent summary for something I still didn't fully grokk.

Going to be interesting building a site ground up with it I think.

Gildiss
Aug 24, 2010

Grimey Drawer
I will be moving into a position where I am the only web dev at this company working with the backend consisting of the head programmer, making the web version of their already existing Android and iOS apps.

Real rear end green field project, aside from the fact they want it in React.

What is the wish list of things you would do given this situation for a React project?

Gildiss
Aug 24, 2010

Grimey Drawer
Reposting an old gem from my last job.

Gildiss posted:

Another gem in the ESLinting mines.


code:
function(a,b){
    return (((typeof a.lastName === 'string' ? a.lastName.toUpperCase() : '') < (typeof b.lastName === 'string' ? b.lastName.toUpperCase) : '')) ? -1 : (((typeof a.lastName === 'string' ? a.lastName.toUpperCase() : '') > (typeof b.lastName === 'string' ? b.lastName.toUpperCase) : '')) ? 1 : 0));
}
Just because you can do something doesn't mean you should.

E: lol the blame shows this as being from one of the contracting teams tech leads.

Gildiss
Aug 24, 2010

Grimey Drawer
Firebase?

Gildiss
Aug 24, 2010

Grimey Drawer
https://reactjs.org/docs/react-component.html#componentwillunmount

Nm that was right, handle the cancelling of the request in here.

Gildiss
Aug 24, 2010

Grimey Drawer

Love Stole the Day posted:

I could be wrong but if I remember right it is possible to manually create and cancel a promise before it is completed. Since it seems that your doRequest() function seems to return a promise (which I think is why you use `.then( () => { .. } )` ) maybe you can set its promise to a variable in the parent component and then manually cancel it from within the child component when it unmounts? Though in that case you'd have to change from an anonymous function to a named one: something like `fn_OnRequestReceived()` or whatever.

I might be misremembering how Promises work off the top of my head, though.

Yes, this is the way I would go about it, set a state variable to hold the Promise and and in unmount cancel the request.

Gildiss
Aug 24, 2010

Grimey Drawer

The Dark Wind posted:

Does anyone have recommendations for a grid system similar to Bootstrap in React? I know there's Reactstrap/React-bootstrap, but we'd like to avoid pulling in the entire library for just a fraction of the features. And we can't use CSS grid because we have to support IE9 (I know, I know...). I'm sure there are some good pre-existing solutions out there, was wondering if anyone had some good personal experiences with any library that they'd recommend.

Ive been using react-md.

Gildiss
Aug 24, 2010

Grimey Drawer

Ape Fist posted:

Lol. Try doing .net poo poo with it.

Its probably ideal?

Gildiss
Aug 24, 2010

Grimey Drawer

Grump posted:

Anyone work with Firebase? I'm wanted to work on a new pet project and wanted to use firebase.

The premise of the app is this: I want to give the app a list of liquors and it will give back a list of cocktail suggestions

Will I have to write server code if I want to paginate and filter/search or is that easy to do with Firebase? Will I have to write any server code for something like this?

I work with Firebase.

Depending on how much traffic you are expecting a server could be useful, but not necesary.

Do be aware though, for querying data, you can index based on any fields you have, but can only query from Firebase on one field per query, then filter further from that response data locally.

Gildiss
Aug 24, 2010

Grimey Drawer

MrMoo posted:

Basically, no. And in some cases "locally cached" can be worse than loading again over the network. If you want an image fast in memory then you need to manage that yourself. Aside of caching mechanisms the one tool available for performance is data urls, the trade off of additional round trips to transfer size.

For certain scenarios the advanced answer is service workers, but :lol: what a mess.

Can confirm service workers are uhhh a bit touchy. My current deployment has a service worker that now just unregisters service workers :lol:

Gildiss
Aug 24, 2010

Grimey Drawer
I still have not read a single thing about Hooks because they were announced 2 days after I just got done updating the two applications I develop to React 16.
All I did was sigh and then become extremely tired.

Gildiss
Aug 24, 2010

Grimey Drawer

smackfu posted:

Anyone have tips on working with static assets (like images) and CDNs and file naming? We recently had a designer say “oh that SVG we gave you that you deployed into production had a small layering bug, here is the new one.” We could just add a “b” or “v2” to the filename but maybe we should version them from the start? It’s our first time dealing with the CDN for this stuff so we are kind of winging it.

From my own experience, we kept the files named the same, overwrote them on the storage, and then ran an invalidation on AWS Cloudfront for that specific file path.
But that was also winging it.

Gildiss
Aug 24, 2010

Grimey Drawer

prom candy posted:

I just posted in the other web dev thread about how I gave up and ran back to my mac :(

I need a new laptop that I can put linux on but I want to do this too. My laptop doesnt reliably boot and doesn't see 5G wifi. Send help.

Gildiss
Aug 24, 2010

Grimey Drawer

Queen Victorian posted:

Are there other D3 people here? Any D3/framework integration success stories? Am I right to be concerned or do I need to just suck it up and fully embrace the framework?

On a cursory search there are plenty of articles laying out ways of going about using them together. Also one of them mentioned that only 8 of the 30 methods in D3 directly manipulate the DOM, the other 22 do not. So also check into exactly which methods need careful attention.

Also probably good since he doesn't have D3 and the rest don't have React to both come together and setup the standard for the compenents going forward and not just give him free reign on something he only has 50% of an answer to.

Gildiss fucked around with this message at 01:07 on Mar 27, 2019

Gildiss
Aug 24, 2010

Grimey Drawer

my bony fealty posted:

JSX is weird but you definitely get used to it. I like it more as a templating solution than the directives that most other FE frameworks seem to use.

fwiw I would recommend exploring React hooks early in your learning, React really feels designed with a more functional programming approach in mind and hooks let you embrace that. basically you can write components entirely as functions, no more classes needed. I read once that "React imagines UI as pure functions of state" and I thought that sounded about right.

Classes are not going anywhere though so don't feel like you have to move to hooks anytime soon, I've just found that everyone I know who has started using them really likes them (including myself). especially if you're like me and don't really care for classes in JS at all.

Do you have a good starting guide for hooks? There are so goddamn many and I don't trust any of them due to that.

Gildiss
Aug 24, 2010

Grimey Drawer

prom candy posted:

The official docs are good. Kent C. Dodds' video tutorial on egghead is good, I think you need an account but it should be free. I also haven't watched it yet but the other day Dan Abramov and MPJ did a livestream where Dan taught MPJ hooks from scratch: https://www.twitch.tv/videos/404530952?t=00h14m17s

Hooks are so goddamn good I love them.

Started with the twitch last night and then jumped into the docs and

prom candy posted:

Hooks are so goddamn good I love them.

Adbot
ADBOT LOVES YOU

Gildiss
Aug 24, 2010

Grimey Drawer

smackfu posted:

Not super surprised. You can write a lot of React, including pretty complex apps, without running into refs. Especially if you just use other peoples packages to do the complex bits.

Yeah I only used refs I think in one situation for an audio component.
Had no idea about that height thing but it is cool after seeing it. But yeah I have never come across that information out in the wild so wouldn't have even considered it.
Doesn't feel like as common knowledge as you think it is.

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