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
Ruggan
Feb 20, 2007
WHAT THAT SMELL LIKE?!


Sedro posted:

If your backend API supports Windows auth, the browser will take care of it without any extra code on the frontend

Awesome, ok. I'll try that and hope it auto-negotiates. Thanks for the response.

Adbot
ADBOT LOVES YOU

huhu
Feb 24, 2006
I'm looking to refactor a project I'm unfamiliar with to get rid of unused components and containers. I was thinking of using Chrome's code coverage to browse the entire website, then look at the JS file and figure out from there which stuff to remove. However, Webpack's devtool is making this somewhat difficult. What would be the best way to have Webpack spit out more human readable code or is there a better method all together that I haven't thought about?

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



If you don't minify the output, the file webpack generates is pretty readable, or was about a year ago - no guarantee that's still the case.

huhu
Feb 24, 2006

Munkeymon posted:

If you don't minify the output, the file webpack generates is pretty readable, or was about a year ago - no guarantee that's still the case.

I feel like an idiot. Thanks.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Nolgthorn posted:

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:
this.$store.state.messages[myKey] = myMessage;
Needs to be.

code:
Vue.set(this.$store.state.messages, myKey, myMessage);
Otherwise Vuex has no way of knowing the object changed apparently. Similar with delete. So that could cause an issue for the not careful. Still, I don't think I'd give up mutable state now that I've tried this stuff it's too easy and too performant.

I too find it easier to shoot myself in the foot with safety off.

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense
See the problem with front end javascript frameworks these days is evangelicalism let me tell you about -

luchadornado
Oct 7, 2004

A boombox is not a toy!

Nolgthorn posted:

See the problem with front end javascript frameworks these days is evangelicalism let me tell you about -

I like talking about this poo poo because it helps cement and foster new ideas, and there's usually ample opportunity to learn especially if you're wrong about something. You can be pragmatic, critical, and productive without being Javascript Hitler.

ZHamburglar
Aug 24, 2006
I have a penis.
Have you guys started putting the Monero javascript miner in everything you are building? It's the new hotness right now.

Ruggan
Feb 20, 2007
WHAT THAT SMELL LIKE?!


Lol, ought to do this with the intranet of multi-thousand-person company.

That would probably get you fired really fast though.

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me

Ruggan posted:

Lol, ought to do this with the intranet of multi-thousand-person company.

That would probably get you fired really fast though.

Surely this can be minified to death and set to run to only use a few % cpu...

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense
I saw this in a movie once I think it was Superman II.

smackfu
Jun 7, 2004

We are trying to modernize our Angular.js app, with a plan to move to Angular at some point.

So we are converting our two way bindings to one way ones plus callback functions. This is surprisingly annoying because even if it is labeled as a one way binding, updates to the object still flow to the parent. Like changing the = to > has no impact even though it really is still a two way binding. The docs just say "it is best practice to not update objects that are one way bound." What the heck?

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me

smackfu posted:

We are trying to modernize our Angular.js app, with a plan to move to Angular at some point.

So we are converting our two way bindings to one way ones plus callback functions. This is surprisingly annoying because even if it is labeled as a one way binding, updates to the object still flow to the parent. Like changing the = to > has no impact even though it really is still a two way binding. The docs just say "it is best practice to not update objects that are one way bound." What the heck?

A better way to think of one way bindings is "pass by reference". This is good for a number of performance reasons, however, your don't get any sort of framework enforced one way-ness. If you REALLY want that airgap, you can always put a "this.myBoundThing = angular.copy(this.boundThing)" in your $onInit(), but you are paying to copy that object.

smackfu
Jun 7, 2004

I think I'm just surprised it wasn't always pass by reference. In a two way binding you can actually swap out the entire object? That seems like it would be painful to implement.

(To be fair I know very little about Angular despite using it for my job.)

an skeleton
Apr 23, 2012

scowls @ u
To someone who asked earlier...

I moved from Angular to Backbone and React as far as front end tech goes, obviously with plenty of vanilla JS and jquery sprinkled in-between/on top of for one reason or another (simple project, legacy code that mixed the two, blah blah blah).

I used to think Angular was amazing because I spent years doing 1.x and once you learn it, it is pretty cool. John Papa's style guide informed how I developed Angular and really leveled me up as far as angular dev goes.

Then I moved to React/Redux. It was a bit weird at first but now I think its easily better than any other framework I've used (like I said, mainly just Angular 1.x and Backbone, a smattering of other things). The paradigm shift it introduces is worthwhile IMO, or if you dont want to call writing your html elements inline with your JS a paradigm shift, its just a tool that feels natural to use, like its breaking down barriers that dont have to exist.

That being said, I wouldn't hesitate to, and think I would actually enjoy learning, Angular 2 or Vue if I had sufficient incentive to.

But React + Redux is just awesome. Throwing typescript or flow into the mix seems to help smooth it out even more.

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me

smackfu posted:

I think I'm just surprised it wasn't always pass by reference. In a two way binding you can actually swap out the entire object? That seems like it would be painful to implement.

(To be fair I know very little about Angular despite using it for my job.)

Two way binding is NOT pass by reference. It's a very strange thing and came about due to Angular's past. Two way binding creates a $watch between both scopes watching the 'passed' object, and then during a $digest, if either change, the changes are mirrored to the other. This can be a problem when a) you change a field on an object (which won't be noticed by the $watch), or you set it up with =* so it watches the entire object. THIS is then bad because you are now iterating over 2 possibly huge objects every $digest to see if anything changed.

One way binding is a simple pass by reference that you were pretending two way binding was. No $watch, no $digest. You just need to be disciplined about modifying it, just as you would be when you pass an object by reference to a function.

prom candy
Dec 16, 2005

Only I may dance

an skeleton posted:

To someone who asked earlier...

I moved from Angular to Backbone and React as far as front end tech goes, obviously with plenty of vanilla JS and jquery sprinkled in-between/on top of for one reason or another (simple project, legacy code that mixed the two, blah blah blah).

I used to think Angular was amazing because I spent years doing 1.x and once you learn it, it is pretty cool. John Papa's style guide informed how I developed Angular and really leveled me up as far as angular dev goes.

Then I moved to React/Redux. It was a bit weird at first but now I think its easily better than any other framework I've used (like I said, mainly just Angular 1.x and Backbone, a smattering of other things). The paradigm shift it introduces is worthwhile IMO, or if you dont want to call writing your html elements inline with your JS a paradigm shift, its just a tool that feels natural to use, like its breaking down barriers that dont have to exist.

That being said, I wouldn't hesitate to, and think I would actually enjoy learning, Angular 2 or Vue if I had sufficient incentive to.

But React + Redux is just awesome. Throwing typescript or flow into the mix seems to help smooth it out even more.

Definitely agreed. I haven't been as excited about a framework as I am about React+Redux since I first picked up Rails in 2006. Something about it just gels nicely with the way I like to think about things.

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
I'm on my 3rd attempt learning Redux and I hope it goes smoother this time because I'm taking a $500 course that my employer paid for. I get why Redux is great, but it just seems so needlessly complicated, but to be fair I don't think I've ever worked on a project that went above 7 components.

Ahz
Jun 17, 2001
PUT MY CART BACK? I'M BETTER THAN THAT AND YOU! WHERE IS MY BUTLER?!

Grump posted:

I'm on my 3rd attempt learning Redux and I hope it goes smoother this time because I'm taking a $500 course that my employer paid for. I get why Redux is great, but it just seems so needlessly complicated, but to be fair I don't think I've ever worked on a project that went above 7 components.

I'm a pretty big fan of the patterns for both.

Angularjs was great at first, but as most said, the 2way binding just causes more confusion in the end. Mutable state has also bit me in the rear end too many times to count. Having a clear consistent pattern for updating and rendering on state has been breath of fresh air.

Dogcow
Jun 21, 2005

Grump posted:

I don't think I've ever worked on a project that went above 7 components.

It's totally overkill on a project that small, that's why it seems over complicated. It's when you've got the massive data grid plus dozens of ways to filter it application/sometimes nightmare I'm currently on that it saves your sanity multiple times per day.

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
yeah that's what I'm saying.

I always have had a really hard time wrapping my head around programming concepts/frameworks/etc unless I have a really good use case to think about. Otherwise it's just information that goes in one ear and out the other. Like, React just made sense to me when I stared using it because I understood in what case it would be useful. I don't think I'm ever going to 'get' redux until I get further down the road in my career and I start working on bigger things.

But I'm still super interested in learning it.

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense
I have recently worked on a overly complex Redux app. The big benefit is still a little bit elusive to me but I think something that's really helpful is nested selectors. So that I can get some complicated data and then use it to make more complicated data, then just have reliable derived attributes from a single source of truth.

Everyone praises it for making sure no developers accidentally mutate the state but I think that's a bit of a underwhelming benefit. Hopefully the team you are working with aren't re-assigning parameters passed into functions.

A good linter could fix that.

I guess I also don't really know what all the fuss is about, because the first benefit is a bit like regular programming and the second benefit doesn't overcome the added complexity in my opinion.

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me

Grump posted:

yeah that's what I'm saying.

I always have had a really hard time wrapping my head around programming concepts/frameworks/etc unless I have a really good use case to think about. Otherwise it's just information that goes in one ear and out the other. Like, React just made sense to me when I stared using it because I understood in what case it would be useful. I don't think I'm ever going to 'get' redux until I get further down the road in my career and I start working on bigger things.

But I'm still super interested in learning it.

I wouldn't feel too bad about this. We see things as tools, and if we can't see the utility, we can't understand the tool.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Really understanding the benefit of redux or static typing or a ton of other Computer Things requires two things:

1. Using them in a large app.
2. Building and maintaining a large app without them.

Vesi
Jan 12, 2005

pikachu looking at?
I get nervous without static typing from just a few lines, feels like riding a car without a seatbelt

prom candy
Dec 16, 2005

Only I may dance
I finally started using typescript on a project and I love it. I've never used a strongly typed language before and now I don't want to go back.

What's the strongly typed equivalent of Ruby on Rails for building server side code and APIs?

Gul Banana
Nov 28, 2003

try ASP.NET Core. one of the paradigms it supports is a rip-off of rails’ mvc thing, and c# is a nice language (recommended editor: vs code)

prom candy
Dec 16, 2005

Only I may dance
Do I have to get on a Microsoft stack if i go that direction? Like IIS and poo poo? I don't think I could handle that.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

prom candy posted:

Do I have to get on a Microsoft stack if i go that direction? Like IIS and poo poo? I don't think I could handle that.

The explicit goal of .NET core is to be able to use ASP.NET on non-IIS, non-microsoft platforms.

Gul Banana
Nov 28, 2003

here’s an .net core app i made in macos last week: https://dispel.azurewebsites.net/ https://github.com/gulbanana/dispel-murk/tree/master/Dispel.Web
works fine in windows probably, but no visual studio installations were harmed in the production of the film

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

prom candy posted:

I finally started using typescript on a project and I love it. I've never used a strongly typed language before and now I don't want to go back.

What's the strongly typed equivalent of Ruby on Rails for building server side code and APIs?

Python has a type system much like TypeScript in that it is optional/gradual.

Java and C# will have syntax more closely matching TypeScript.

Drastic Actions
Apr 7, 2009

FUCK YOU!
GET PUMPED!
Nap Ghost

Bruegels Fuckbooks posted:

The explicit goal of .NET core is to be able to use ASP.NET on non-IIS, non-microsoft platforms.

If, for whatever reason, you still wanted to use the full .NET framework, You can also ASP.NET on Mono. But with .NET Core 2.0 and .NET standard 2.0, I would just go with that at this point.

Tei
Feb 19, 2011

*removes mask and show a bulbous monster head*

What if everyone use OOP languages wrong? maybe instead of primitives, objects should be exchanging objects-messages?

With this idea languages like Java are not really strong typed or anything. You would write all methods taking a object message, and every method would return a message (that could optionally be be ignored).

I know the discussion is not about *puts human mask again* how Java is but how is normally used, but anyway.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Tei posted:

*removes mask and show a bulbous monster head*

What if everyone use OOP languages wrong? maybe instead of primitives, objects should be exchanging objects-messages?

With this idea languages like Java are not really strong typed or anything. You would write all methods taking a object message, and every method would return a message (that could optionally be be ignored).

I know the discussion is not about *puts human mask again* how Java is but how is normally used, but anyway.

Isn't that Objective C?

luchadornado
Oct 7, 2004

A boombox is not a toy!

Munkeymon posted:

Isn't that Objective C?

Yes, it is. Which is also still strongly typed. Strong typing shifts guarantees and enforcement to the language level, which frees up the developer from writing defensive code. Most decent (IMO) strongly-typed languages embrace at least a little dynamic typing for situations where brevity or ambiguity is preferred to type safety.

Pollyanna
Mar 5, 2005

Milk's on them.


I can't click on a particular input field in iOS Safari - it always focuses onto the leftmost field instead - and I can't figure out why. What tools can I use to figure out what exactly is happening when I click (tap, really) on a part of the Safari page? I tried recording a Timeline in Safari via the Xcode simulator, but that doesn't really tell me anything other than that a bunch of blur events and mouse-ins happened with no level of detail. Am I missing something?

prom candy
Dec 16, 2005

Only I may dance

Bruegels Fuckbooks posted:

The explicit goal of .NET core is to be able to use ASP.NET on non-IIS, non-microsoft platforms.

Oh, cool. What's up with Microsoft doing a bunch of good stuff lately? I'm going to have to look into that.

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me

Tei posted:

*removes mask and show a bulbous monster head*

What if everyone use OOP languages wrong? maybe instead of primitives, objects should be exchanging objects-messages?

With this idea languages like Java are not really strong typed or anything. You would write all methods taking a object message, and every method would return a message (that could optionally be be ignored).

I know the discussion is not about *puts human mask again* how Java is but how is normally used, but anyway.

Even if you are trading objects, you would still want to give them fixed types, or you'd get no intellisense or type safety. I think there would also be a significant performance hit, and while you usually never care in JavaScript land about such things, you usually have to in C#/Java land.

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.'

prom candy posted:

Oh, cool. What's up with Microsoft doing a bunch of good stuff lately? I'm going to have to look into that.

They're realizing that Windows isn't the monolith it used to be, so they're pivoting (or maybe returning to) using Microsoft stuff is more important than what you're using it on. Which is nice since they do have legit nice stuff (like c#)

Adbot
ADBOT LOVES YOU

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Pollyanna posted:

I can't click on a particular input field in iOS Safari - it always focuses onto the leftmost field instead - and I can't figure out why. What tools can I use to figure out what exactly is happening when I click (tap, really) on a part of the Safari page? I tried recording a Timeline in Safari via the Xcode simulator, but that doesn't really tell me anything other than that a bunch of blur events and mouse-ins happened with no level of detail. Am I missing something?

If you plug the iToy into a Mac, it should show up as a device under Safari's Debug menu and you can use the debug tools much like you would a normal browser window. There's probably a misbehaving handler on one of the inputs which you can find under the Node properties.

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