|
How do I pass another argument to onSelectChange?code:
|
# ? Sep 23, 2017 20:55 |
|
|
# ? Jun 10, 2024 11:50 |
|
Grump posted:How do I pass another argument to onSelectChange? Just do this: code:
|
# ? Sep 23, 2017 21:31 |
|
Thermopyle posted:Also, redux is awesome. Mutable state is awesome. I cannot willingly go back ever. `mobx` is the new kid on the block redux alt. Nolgthorn fucked around with this message at 23:25 on Sep 23, 2017 |
# ? Sep 23, 2017 23:20 |
|
Nolgthorn posted:Mutable state is awesome. What? no one says this.
|
# ? Sep 23, 2017 23:50 |
|
The Dark Wind posted:Just do this: Thanks. For some reason, my brain always thinks writing functions inline is bad
|
# ? Sep 24, 2017 01:16 |
|
Nolgthorn posted:Mutable state is awesome. I cannot willingly go back ever. `mobx` is the new kid on the block redux alt. What the gently caress are you smoking?
|
# ? Sep 24, 2017 05:05 |
|
I'm doing some internal web dev at my salaried job. Most of my self-taught experience has been doing MVC ASP.NET dev, SQL backend with Dapper DAL. Front end is just a bunch of views and jquery with Ajax calls returning data / partial views. I kinda want to explore doing some better front end UI stuff - is react still the hotness, or is vue the new flavor of the month? Is there any relevance to the backlash around the new react license?
|
# ? Sep 24, 2017 05:23 |
|
Ruggan posted:I'm doing some internal web dev at my salaried job. Most of my self-taught experience has been doing MVC ASP.NET dev, SQL backend with Dapper DAL. Front end is just a bunch of views and jquery with Ajax calls returning data / partial views. I kinda want to explore doing some better front end UI stuff - is react still the hotness, or is vue the new flavor of the month? Is there any relevance to the backlash around the new react license? Getting into a car with any JS framework is like getting into the convertible with Raoul Duke and Dr. Gonzo high on drugs, "We're your friends, we're not like the others."
|
# ? Sep 24, 2017 05:32 |
|
Ruggan posted:I'm doing some internal web dev at my salaried job. Most of my self-taught experience has been doing MVC ASP.NET dev, SQL backend with Dapper DAL. Front end is just a bunch of views and jquery with Ajax calls returning data / partial views. I kinda want to explore doing some better front end UI stuff - is react still the hotness, or is vue the new flavor of the month? Is there any relevance to the backlash around the new react license? Disclaimer: work at Facebook I think legally speaking BSD + PATENTS wasn't that bad, and in fact moving to MIT just makes the patent situation more ambiguous (not a lawyer but the conventional wisdom is that it gives an implicit grant, not tested in court, use at your own risk, blah blah blah). But it's a license that's used ubiquitously and is associated with open source projects. No one ever got fired for going with MIT, basically, while plenty of legal departments were balking at a Facebook-unique license (Wordpress and Baidu being the major ones I know of). Basically the old PATENTS has been there for years and no one's gotten sued over a hypothetical React patent yet. If such a suit did happen you can be sure it would be a massive shitstorm, so I'm fairly confident it won't. AFAIK the situation is now equivalent to all the other libraries backed by big companies that use MIT. Also React is cool and good for what it's worth. A lot is made of framework churn in JS-land, but all the major competitors are backed by big users and likely to stick around for a long time, so it's really up to the individual to avoid decision paralysis. Don't be afraid to just pick one that feels the smoothest for you.
|
# ? Sep 24, 2017 06:02 |
|
Ruggan posted:I'm doing some internal web dev at my salaried job. Most of my self-taught experience has been doing MVC ASP.NET dev, SQL backend with Dapper DAL. Front end is just a bunch of views and jquery with Ajax calls returning data / partial views. I kinda want to explore doing some better front end UI stuff - is react still the hotness, or is vue the new flavor of the month? Is there any relevance to the backlash around the new react license? I learned React during my bootcamp and found it pretty intuitive thanks to JSX and simple to pickup, but apparently a lot of people feel that it has a big learning curve, especially with Redux, so YMMV. I've been trying to teach myself Vue.js before I start my new job next month since it's used on some projects, and so far I have to say it's a really nice and straightforward framework. The documentation is fantastic. Things do exactly what you expect them to do. I don't think you can go wrong with trying either.
|
# ? Sep 24, 2017 06:11 |
|
Odette posted:What the gently caress are you smoking? I'm smoking vuex since quitting redux, I still use some redux from time to time for work but I'm quitting that too.
|
# ? Sep 24, 2017 11:54 |
|
Grump posted:Thanks. For some reason, my brain always thinks writing functions inline is bad In this case it shouldn't matter. But you could: code:
|
# ? Sep 24, 2017 13:03 |
code:
|
|
# ? Sep 24, 2017 13:10 |
|
Bind returns a new reference, it performs essentially the same thing as an inline function in this case.
|
# ? Sep 24, 2017 13:16 |
|
Nolgthorn posted:Bind returns a new reference, it performs essentially the same thing as an inline function in this case. well, it's more that bind makes it so when the event handler is called, the context of the invoked function is the object passed in as first parameter, with the parameters being the subsequent args. arrow function and bound functions are pretty similar, but I generally like bound functions over arrow functions in event handlers because arrow functions can't be invoked recursively (as they are not named functions) and you might want to invoke an event handler recursively so you can debounce it.
|
# ? Sep 24, 2017 14:26 |
|
Every time I read this thread, I feel dumb for officially/unofficially deciding on Angular where I work.
|
# ? Sep 24, 2017 15:59 |
|
The Merkinman posted:Every time I read this thread, I feel dumb for officially/unofficially deciding on Angular where I work. Angular is cool and good. TheCog fucked around with this message at 16:57 on Sep 24, 2017 |
# ? Sep 24, 2017 16:49 |
|
The Merkinman posted:Every time I read this thread, I feel dumb for officially/unofficially deciding on Angular where I work. There's nothing wrong with Angular really...its right in there with React and Vue as far as being a modern thing that makes front end work better. Personally, I wouldn't pick it but that's not because it's a stupid and dumb thing to use. I just don't like the way it works compared to React or Vue...but that's relative. On a scale of 1 to 100 with 100 being what I most prefer and think is least dumb, from my standpoint React is like 100, Vue is 99, Angular is 90, and then you're down in the 60s-70s with stuff like Ember and going on down. Those rankings kind of combine stuff like using what I'm familiar with, preferences about how you work with them, community support, etc. React I've used a lot, Vue I've just dabbled with, Angular is somewhere in between those two, and I haven't touched any of the other stuff in years other than just keeping up with the frontend framework blogosphere.
|
# ? Sep 24, 2017 17:09 |
|
Thermopyle posted:There's nothing wrong with Angular really...its right in there with React and Vue as far as being a modern thing that makes front end work better. Angular early adopters were smoking crack. Recent angular is better but it still has a learning curve. I'd be willing to work with a project that uses a recent angular but I probably wouldn't pick it for a new project.
|
# ? Sep 24, 2017 20:34 |
|
You know what'd be useful? If there were a series of "____ for people who already know ____" guides. (e.g. "Angular for people who already know React")
|
# ? Sep 25, 2017 00:25 |
|
Love Stole the Day posted:You know what'd be useful? If there were a series of "____ for people who already know ____" guides. (e.g. "Angular for people who already know React") If a framework specific tutorial becomes useless at a speed of N, these surely would become useless at a speed of N^2.
|
# ? Sep 25, 2017 00:47 |
|
huhu posted:If a framework specific tutorial becomes useless at a speed of N, these surely would become useless at a speed of N^2. And if you know when it is N log N you'll do fine on your next interview.
|
# ? Sep 25, 2017 01:27 |
|
You could probably do a guide like that pretty well as long as you talk about the right stuff. The difficultly of jumping between stuff like angular and react isn't apis and plugins, but the different philosophies of how things go together. And that sort of thing doesn't change as frequently.
|
# ? Sep 25, 2017 03:14 |
|
Thermopyle posted:There's nothing wrong with Angular really...its right in there with React and Vue as far as being a modern thing that makes front end work better. This. But from the other side. I really like Angular, but that's what I'm most familiar with by FAR. Every time I try to do something in React, I give up and do it in Angular. Is it any easier in Angular? For me it is. But again - that's only because Angular has been my moneymaker for the past 5 years and React I have only dabbled in. I'm sure to a developer who has never worked with either one, they both have equal levels of tedium/nonsense. I will say this - and I know it holds true for Angular, and seems like it does for React/Redux, tho one of the more experienced React devs can confirm: EMBRACE whatever framework you choose. FULLY. Open up them lovin' arms and give it a big old hug. I say this because the only people I have seen struggle with either framework are the ones who are like "well I'm just gonna do this little thing in JQuery/Underscore/whatever because that's what I know." I'm here to tell you: that way lies madness. Both React and Angular are pretty opinionated about how you do things. But I can't think of a single instance when it simply wasn't possible to find a framework-specific way to do X, no matter what X is. So if you're going in - go ALL in. Trust me. Even tiny little things like: "I'm just gonna use jQuery to add a class to this button. It'll be fine." Nope. Don't do it. You shouldn't ever have to fight against the framework you are using - but understand there is a vast difference between "fighting" and "refusing to learn/sticking with what you already know because reasons". I will leave it to Thermopyle to chime in re: React.
|
# ? Sep 25, 2017 13:15 |
|
That kinda makes me curious. Has anyone ever HAD to switch because of a new job and ended up changing their opinion on whatever framework? I'm not going out of my way to find angular jobs, but I'm not really sure how easily I'd adjust if my job went from React to Angular.
|
# ? Sep 25, 2017 13:25 |
|
The technology you use is irrelevant. A framework or language or whatever is a tool, not a way of life.
|
# ? Sep 25, 2017 14:36 |
|
HaB posted:I will leave it to Thermopyle to chime in re: React. Ditto. Once or twice I've went through a lot of work of making a jQuery plugin work but that was a lot of pain and I had determined that reimplementing it in React would be even more pain. Grump posted:That kinda makes me curious. Has anyone ever HAD to switch because of a new job and ended up changing their opinion on whatever framework? This would be a weird thing to do. Just learn the framework. Well, that was my first reaction, but then I started thinking...if my job switched to PHP (yeah, not a framework, but whatever), I'd start looking for a new job, so there's some level of friction that I'm not willing to put up with. On the frontend I'd use Angular or Vue or React or whatever other modern framework I'm not thinking of, but I'd really start thinking about looking for a new job if I had to use something from 5 or 10 years ago.
|
# ? Sep 25, 2017 17:29 |
|
Angular is an opinionated framework in a sea of unopinionated libraries that you're expected to cobble together yourself and impose your own opinion. Some of the front-end developers I've worked with are bad at forming and imposing opinions. Redux is an incomplete concept crucially missing functional staples of better languages, and is touted as the go-to way to manage state in React, which is probably frustrating to a lot of people. Immutable state isn't the panacea it's made out to be. Apps built with Immutable.js and Redux have plenty of errors - I've seen many stemming from trying to embrace immutability, overusing thunks, and creating complex middleware. Blinkz0rz posted:The technology you use is irrelevant. A framework or language or whatever is a tool, not a way of life. Quoted for truth. I switched from .NET MVC -> React/Redux -> Groovy/Ratpack. Many, many of the concepts are the same, it's just a matter of learning where the new buttons on your tools are. No tool is perfect. Thermopyle posted:I'd really start thinking about looking for a new job if I had to use something from 5 or 10 years ago. luchadornado fucked around with this message at 17:50 on Sep 25, 2017 |
# ? Sep 25, 2017 17:46 |
|
Helicity posted:Angular is an opinionated framework in a sea of unopinionated libraries that you're expected to cobble together yourself and impose your own opinion. Some of the front-end developers I've worked with are bad at forming and imposing opinions. Truth. Helicity posted:Redux is an incomplete concept crucially missing functional staples of better languages, and is touted as the go-to way to manage state in React, which is probably frustrating to a lot of people. Redux is incomplete in the sense that React is incomplete. Helicity posted:Immutable state isn't the panacea it's made out to be. Apps built with Immutable.js and Redux have plenty of errors - I've seen many stemming from trying to embrace immutability, overusing thunks, and creating complex middleware. I'm not sure that immutableness is made out to be a panacea by anyone worth listening to (I guess thats a no true scotsman fallacy, but then again I'm not sure how exactly to respond to the comment about it not being the panacea it's made out to be). Immutable state does not eliminate bugs, just like static typing does not eliminate bugs. You can use all technologies incorrectly. Immutable state is just another tool like static typing that has to be used in the correct way to realize its benefits. It's not like you can slap an immutable state library into your application and go "woop bugs fixed".
|
# ? Sep 25, 2017 17:51 |
|
Thermopyle posted:Redux is incomplete in the sense that React is incomplete. I'm not disagreeing, but I wanted to clarify. This is just my experience in the Minneapolis software community. Most of us will at least agree that mutable state can cause weird, hard to triage bugs. But you can program more defensively and do some triage and move on. I've seen a lot of great code that mutates things - from a performance aspect, sometimes you want to mutate the original because clones are expensive! I've met a subset of people, and I'd probably put their numbers in the dozens, who think immutability solves way more problems. Nearly all of them are front-end developers that have drunk the Kool-Aid. They don't consider the ROI they get, and they will go to great lengths to preserve immutability in their applications, even to the detriment of other things. It feels cargo cultish. I'd put immutability towards the bottom of the pile of things I consider helpful in preventing bugs *across the board*. In certain use cases, when I see that state will be problematic, I'll make more efforts to address it. My beef with Redux is that there was poor documentation for years, it still encourages a ton of boilerplate, what I consider a harmful misdirection to thunks instead of middleware, and the language doesn't really support the things it needs to be simple and intuitive. Javascript with baked in immutable data structures would be much, much better. If someone came out with a version of Redux with baked in immutability and a reduction in boilerplate, I think it would be huge.
|
# ? Sep 25, 2017 18:03 |
|
Maybe someone can bring me some clarity here. I'm looking to try out using ReactJS in some internal projects. The current stack is SQL Server --> ASP.NET application --> HTML/JS/jQuery. I develop in Visual Studio. We host through IIS. Let's say I want to start using React. Should I be planning to turn my existing ASP.NET app into a web API? Instead of serving pages, just serve data and consume that via Fetch ajax requests into React/Redux and render my page based on state? What is the code editor(s) of choice for React / JS driven front-ends? Visual Studio's tooling seems to be a little lacking.
|
# ? Sep 25, 2017 22:16 |
|
Ruggan posted:Maybe someone can bring me some clarity here. I'm looking to try out using ReactJS in some internal projects. The current stack is SQL Server --> ASP.NET application --> HTML/JS/jQuery. I develop in Visual Studio. We host through IIS. Most people I know consider that to be the best practice. Check out VSCode for the html/js stuff.
|
# ? Sep 25, 2017 22:24 |
|
Ruggan posted:Maybe someone can bring me some clarity here. I'm looking to try out using ReactJS in some internal projects. The current stack is SQL Server --> ASP.NET application --> HTML/JS/jQuery. I develop in Visual Studio. We host through IIS. That is probably the ideal way, but there's certainly nothing wrong with starting smaller. Take a form or a widget of some sort and re-implement it in React. React doesn't really care where its data comes from, you just have to make it accessible to it. That can be as simple as dropping a big global JS object into your templates with the data it needs. I prefer Webstorm for frontend web dev.
|
# ? Sep 25, 2017 22:27 |
|
Thermopyle posted:That can be as simple as dropping a big global JS object into your templates with the data it needs. Amusing anecdote, before I had learned about redux, this is how I stored state in a couple personal projects.
|
# ? Sep 25, 2017 22:56 |
|
I had a mouseover event instead of mouseenter and I didn't notice because in Vuex it had 0 performance overhead. Having access to `this.$store` `this.$getters` `this.$route` `this.$socket` etc etc all the time is great. When I wanna update something in the store I just change it. I don't need `mapStateToProps` or `mapDispatchToProps`. The only "problem" per say is that you cannot do key assignment. code:
code:
|
# ? Sep 25, 2017 23:40 |
|
Nolgthorn posted:I had a mouseover event instead of mouseenter and I didn't notice because in Vuex it had 0 performance overhead. Yes, mutable state is easier when your project is small. Heck, its even easier when your project is bigger. Much like not having static types is easier.
|
# ? Sep 25, 2017 23:55 |
|
Erm ok. If the web API is hosted on IIS and depends on windows authentication, how do I pass that from my react app to IIS?
|
# ? Sep 26, 2017 00:07 |
|
You gotta set the header manually. https://coderseye.com/2007/how-to-do-http-basic-auth-in-ajax.html * get base64.js code:
|
# ? Sep 26, 2017 00:37 |
|
Nolgthorn posted:You gotta set the header manually. Yeah, that makes sense, except I'm not sure where to get the user and password, unless I'm expected to ask the user which I don't want to do. In the .NET world, I can detect the browsing user's windows login in a controller and use that to control security. For instance, at my company, I can get data on that user based on windows login and determine if they're a manager, then use that to grant or deny access to certain things. This all happens under the hood with Active Directory and to the end user it's seamless. If I'm abstracting this away into a Web API, I need some way to pass that info to the API from my app (via fetch I presume) and I want to be able to do this automatically - no login screen or anything. So it needs to be passthrough authentication or something like that. Is there a fetch setting that will pass windows auth through to a web API?
|
# ? Sep 26, 2017 02:41 |
|
|
# ? Jun 10, 2024 11:50 |
|
Ruggan posted:Yeah, that makes sense, except I'm not sure where to get the user and password, unless I'm expected to ask the user which I don't want to do. If your backend API supports Windows auth, the browser will take care of it without any extra code on the frontend
|
# ? Sep 26, 2017 02:48 |