« first day (2552 days earlier)      last day (2379 days later) » 

3:00 PM
This is pretty interesting. I just kind of.. have ubuntu running on my windows system
 
It also sucks for pretty much everything I tried to use it thus far
 
@Cereal but it can't handle file permissions
and some JS packages just hang
I keep trying to switch to ubuntu on windows and it just doesn't work
 
Yes, yes, everything sucks
 
It's hell out there
 
3:02 PM
@Cereal I second that
 
well that's true, but unrelated
 
if he's successful, maybe MS can hire that italian surgeon who is going to do a head transplant
 
I wonder if I can install awesome on this and finally have a proper tiling window manager on windows
 
@Cereal vcxsrv is cool af
 
@Cereal can it take over the whole screen?
 
3:09 PM
It's working over all 3 of my screens actually
awesome works!
aaaa
 
@KendallFrey almost there
5-10 more tabs and I lose icons
 
You mean they just suddenly disappear?
 
Jez
Could someone help me with Promises?
0
Q: Recursive promise not working

JezI'm playing around with promises to try and recursively walk a nested array structure. Here is my test code: const Promise = require("Bluebird"); let allPaths = [ "foo", "bar", [ "baz", "bazzz", "bazzzzz", "xxx", [ "never" ...

I'm not sure whether I should be using the new Promise constructor or whether it is an antipattern.
 
            return new Promise(function(resolve) {
                console.log("PROCESSING NEW LEVEL");
                return Promise.each(
                    path,
                    processThisPath
                );
            });
that is redundant
just return the inner Promise.each
 
Jez
but how do i do the console.log?
 
3:15 PM
and the first promise probably isn't needed either.
 
Jez
i don't want to run the console.log immediately. i want to run it in the promise callback
i'm pretending console.log is expensive i/o work
 
It stops when you never call resolve in the new Promise(function(resolve) { console.log("PROCESSING NEW LEVEL"); … })Bergi 4 hours ago
 
Jez
@KendallFrey yeah but now i don't know whether to even create the new Promise
 
function processThisPath(path) {
	if( typeof path === 'string' ) {
		return Promise.resolve(path);
	}
	return Promise.each(path, processThisPath);
}
maybe I'm missing something, but wouldn't this work?
 
Jez
where is the console.log?
 
3:16 PM
add them in where you need them
 
Jez
as i said, i dont want to run it immediately, i wanna run it in the callback
 
@Jez The outer constructor looks okay to me
 
Jez
what outer constructor?
 
The Promise constructor
 
Jez
hmm
 
3:18 PM
Your code has two
 
Jez
i thought i wasn't meant to create that
 
Did you read the link about the antipattern?
Also it's been explained to you in the comments
you certainly have multiple already-existing promises inside that new Promise call. The obvious one is the inner new Promise, the other is the return value of Promise.each. You should simply write function processThisPath(path) { if (…) return Promise.resolve(…); else return Promise.each(paths, processThisPath); }Bergi 3 hours ago
See @rlemon's code for a better structure
 
you made me add the logs.
I feel like a blood bank
 
Jez
Kendall: yes there are already-existing promises, but they already exist in the calling code.
they are not passed in.
hence my function still has to create a promise
it is not referencing an async library.
 
no, it needs to return one
 
3:20 PM
s/blood/wank/
 
Jez
yes but doesnt it need to create the promise to return it?
 
no
 
Jez
how does it return it?
 
well, Promise.resolve I guess does
but you don't need to run the constructor
 
Jez
right
 
3:21 PM
@Jez You have to create a Promise for the processing, sure. But the point is you don't need to handle the nested processing inside that Promise constructor.
 
5 mins ago, by rlemon
function processThisPath(path) {
	if( typeof path === 'string' ) {
		return Promise.resolve(path);
	}
	return Promise.each(path, processThisPath);
}
should suffice
 
Jez
Kendall: so it's a kind of dummy promise
 
how so?
 
Jez
it's doing nothing other than saying "resolve"
 
I assume you need to do some kind of async processing
If you don't, why are you using Promise?
 
Jez
3:22 PM
kendall: yes but that needn't involve a library, it can all be Js code
 
ohhi
 
user1596138
So anyone on React 0.16 yet?
 
yes
 
user1596138
The new error handling is kind of insane, isn't it?
 
user1596138
I might not understand it
 
3:23 PM
hmm...
 
how mental is this?
 
i haven't thrown any errors recently
 
> As technology gains the ability to achieve more and more objectives far more efficiently than before, we will soon start seeing a technocracy, in which the power to change lives for the best will be in the hands of the people who can make it happen in the best way known
 
user1596138
It seems that previously recoverable errors now completely destroy the application, even using the error boundaries?
 
user1596138
As in. A render that hits an uncaught error didn't used to completely rek React
 
3:23 PM
@KendallFrey wait what? so the comments already answered all of this
 
yeah i haven't really explored it's error handling
 
😒 ✋
 
user1596138
Now it does. No matter what. In my understanding. Are we just not allowed to code errors :D
 
user1596138
cc @Loktar
 
user1596138
But I think we're actually out ahead on this one lmao
 
user1596138
3:24 PM
@KevinB Do you use it in a production application?
 
user1596138
We are suddenly losing the entire application due to edge cases that used to be nbd
 
the new react error "handling" is nice, however the way they handle errors otherwise now is super shitty
 
Jez
@rlemon i'm just trying to get my head around the way the Promise works internally. so my code calls Promise.resolve(). that creates a promise, and i return it. that promise does nothing other than signal that my code has completed?
 
just destroying the entire tree lol
 
user1596138
@Loktar but even if you "handle" it it just unmounts the component in my understanding
 
3:25 PM
right
yeah you can't even render children
 
user1596138
It used to just fail that render, do it again on next update
 
it wont allow that
 
user1596138
So it used to be recoverable
 
yeah this sucks
 
user1596138
This is really fucked up IMHO lol
 
3:26 PM
> In the past, JavaScript errors inside components used to corrupt React’s internal state and cause it to emit cryptic errors on next renders. These errors were always caused by an earlier error in the application code, but React did not provide a way to handle them gracefully in components, and could not recover from them.
lol... only if the error was related to rendering
 
@towc I think that's just an instance of "the powerful will use their power". I see no reason to believe it will be exclusively about a socially driven technocracy
 
@Jhoverit yes, but so far it's been mostly static content and simple forms
nothing that could really throw errors other than connectivity problems, and that's handled through catches and what not
 
Time to move to Vue I guess
2
 
@Jez In this case, yeah, it's pretty pointless if your code is already synchronous.
 
who said anything about socially?
@Loktar YOU KNOW IT
 
3:27 PM
Incoming vue towc
 
@towc As in, "for the good of the people"
 
lol
 
@Cereal you're too slow
 
@Jez console.log( Promise.resolve(1) ); you'll see it returns a promise, resolved, with the value 1
 
I suggest you to use the inb4 meme
 
3:27 PM
@towc -cracy, as in government, is a social thing
 
@Neoares Bully :(
 
no different that returning a promise then immediately resolving it.
 
which is shorter
 
nothing in that makes sense without society
 
user1596138
@Loktar XD
 
3:28 PM
awesome
 
Jez
@rlemon sure, that's returning a value. but the code could be used purely for its side-effects. in that case, the promise is merely indicating that the code has run?
 
@rlemon ps battle?
 
Jez
i suppose it's like return;
 
> We debated this decision, but in our experience it is worse to leave corrupted UI in place than to completely remove it. For example, in a product like Messenger leaving the broken UI visible could lead to somebody sending a message to the wrong person. Similarly, it is worse for a payments app to display a wrong amount than to render nothing.
This change means that as you migrate to React 16, you will likely uncover existing crashes in your application that have been unnoticed before. Adding error boundaries lets you provide better user experience when something goes wrong.
 
@Jez no clue what you're trying to say
 
3:28 PM
O.o
they should have made the error like ridiculous
but not unmounted
 
@Jez Yeah, but again, no point for synchronous code
 
Jez
@rlemon you're returning a Promise. the only reason to do that is so the calling code can figure out when your code has completed
 
@Neoares nope, real
 
they introduced error boundaries the same time they decide to unmount the application
they should have deprecated it, and react 17 would fully unmount
 
user1596138
@Loktar So a business decision overflowed into a framework
 
3:29 PM
such a big change.
 
@KendallFrey well, my argument is that more and more people like Musk seem to become more and more powerful. Musk is powerful because he does what the people actually need, imo. It becomes a virtuous spiral where the people who understand how to make something are able to make something better than others, so the people around them will support them, if they have the right intention
 
user1596138
Wut do we even do lmao
 
@Jez And the only reason you'd need to use a Promise is if your code is async. Otherwise, simply returning means you're done.
 
just fix the errors as they come up I guess
 
trying to come up with yet another bold claim for the uni application
 
3:30 PM
and wrap any scary components in error boundaries
going back to work chat
 
"Musk is powerful because he does what the people actually need, imo." I strongly doubt this.
 
I think this is kind of interesting, but I'm not sure how to not make it sound like I'm mad for power or money
 
Jez
@KendallFrey yeah but in this case i am simulating async work. the console.log would be expensive work.
so it would be done async.
 
@Jez async work is not the same as expensive
 
@rlemon how do you know it's real?
 
Jez
3:31 PM
if you run expensive work in a synchronous way the thread will become unresponsive
 
@Neoares you can tell by the way it is
 
!ps batle != real
 
@Jez Yeah, and Promises don't change threads or anything
 
@rlemon well, it's looks very fake to me
 
@KendallFrey well, the way I see it, he finds real issues that can get a lot of investment. To back this up, many people think he's some sort of benefactor, but it seems somewhat obvious that it's just a great business model
 
3:31 PM
If you want a second thread, you'll need web workers
 
@Neoares you need to look closer at the pixels.
 
Jez
i dont want a second thread, i want to run expensive work asynchronously :-)
 
@rlemon the background
 
yea?
it's a photo shoot with a kid and the kid slipped out of their hands
 
to get money, do what makes people want to throw money and power at you
 
3:32 PM
@Jez Don't you mean you want to run expensive work in a way that won't block the main thread?
 
money is easier than power
 
Jez
@KendallFrey say you had a GUI to keep updated. am i right in thinking that, by putting the expensive processing work inside a promise, you could keep the GUI responsive?
yes
 
To do that, you need to use a second thread.
 
Jez
why wouldn't it stay responsive if you ran it asynchronously?
 
just like before it was "the person who can bundle toghether the largest and most armed group of people was on top", now it's going more towards "the person who knows how to deal best with the problems people care about"
 
3:33 PM
because it still can't break mid-function
 
Because it would still be running on the main thread
 
Jez
hmm
it could break between functions though
 
you can asynchronously schedule a function, but the runtime still can't break up a function and pause midway through
 
user1596138
> To address this problem, React 16 uses a more resilient error-handling strategy.
 
user1596138
!!define resilient
 
3:34 PM
@Jez it can, and if you can break your work into small chunks, that works. But that's usually more difficult than using a second thread.
 
user1596138
> able to withstand or recover quickly from difficult conditions.
 
user1596138
ANd React's new strategy is
 
user1596138
> Die immediately on any error
 
user1596138
So. Someone missed vocab lol
 
It discards exceptions
 
3:35 PM
now it's all still based on promises, but with technology reaching certain points, now it can be based on actually solving the problems
 
oh
 
Jez
@ssube as for a second thread, i thought you couldn't do that in Node. only a second process.
 
meh, mobx-react already died immediately to any error
 
I have some JavScript working in my fiddle but not on my page, fiddle: jsfiddle.net/ewebster/q913rnzk/13 page: dotnetdesigner.com/Library
 
lmfao
@Jhoverit @hsimah @HatterisMad
 
3:35 PM
old :)
 
@Jez you can do both
 
user1596138
@SterlingArcher you see the kid trying to do that that rolled his civic
 
WELL THEN
 
user1596138
Like last week
 
@Jhoverit dude no way lol
 
3:36 PM
@SterlingArcher is the scare the red car coming from the right?
 
user1596138
It was funny
 
@Jhoverit but they just added error boundaries
 
Jez
@ssube if you have multiple cores, can multiple threads utilize them? or do you need multiple processes?
 
@towc say what now
 
threads can be on another core.
 
3:37 PM
thy youtube video
 
@Jez again, both. Node is multithreaded to begin with.
 
user1596138
@Shmiddty Yea and when you hit one it unmounts
 
user1596138
You cannot in any scenario whatsoever recover from an exception now.
 
@SterlingArcher clearly he's driving backwards, because otherwise the car would be rolling out of the turn.
 
you don't have direct access to the threads outside of the various worker classes
 
3:37 PM
@Jhoverit and allows you to mount something else.
 
user1596138
You can just shut down that branch and lower of the app lmao
 
@Jhoverit before, the whole app would go haywire
 
Jez
so how do you spawn a new thread in Node?
 
...
 
@towc oh yeah, with gopro objects are closer than it appears
 
3:38 PM
that's googleable
 
that's a paddlin'
 
Jez
"A single instance of Node.js runs in a single thread. To take advantage of multi-core systems the user will sometimes want to launch a cluster of Node.js processes to handle the load."
 
oh, makes sense
 
@Jez You don't, you use a separate process
 
Jez
erm so you do need a new process
 
3:38 PM
really didn't look impressive at all on camera, have to say :/
 
Jez
as i said
lol
 
there are a few thread/worker options
cluster is generally more reliable
 
user1596138
@Shmiddty Nope. I know what it would do before.
 
@towc I mean, it was my fault either way
 
user1596138
It would just keep working lol
 
3:39 PM
and node is still multi-threaded behind the scenes
 
I changed lanes too close to an intersection
 
classic sterling
 
I don't want it to be more impressive lol
 
user1596138
Idk what kind of batshit internal state errors people were having
 
user1596138
I'm talking about uncaughts, simple ones
 
user1596138
3:39 PM
Say. You try to call a method of undefined.
 
honestly though, I've never had an exception in my react code
 
can JavaScript and jQuery be used to crawl the contents of .pdfs?
 
@SterlingArcher but but I subscribed to see blood and explosions. Where's the gore sterling? WHERE'S THE GORE?
 
@Jhoverit are you using proptypes?
 
user1596138
3:40 PM
@Shmiddty Yea
 
user1596138
Lmfao
 
sorry :P
 
so why would you ever get a method of undefined?
 
lol I hope I never post a bloody video
 
user1596138
Ever coded before @Shmiddty?
 
3:41 PM
@SterlingArcher doesn't have to be your own
 
@SterlingArcher never go to the UK
 
nope, never
 
user1596138
;P
 
user1596138
Shit happens
 
@SterlingArcher In the british sense or the literal sense? :P
 
user1596138
3:41 PM
PropTypes dont stop you from passing the wrong thing
 
@rlemon I'd probably be robbed by a scooter gang
 
user1596138
Just help you know that you did
 
@KendallFrey too late
 
@towc man, some pedestrians justask for it
 
proptypes are almost worthless
 
user1596138
3:41 PM
So. Obviously. It's a thing that happens.
 
@KendallFrey literal, you waffle lol
 
@SterlingArcher no, you'd be making bloody videos
 
they are good as a dev to see what a component expects...
 
god dammit jordan
 
but they just warn otherwise
 
3:41 PM
bloody jordan
 
user2620028
@SterlingArcher shit dude that thing is on two wheels lol
 
They don't throw errors lmao
 
@rlemon gotta tailor your jokes for the audience ;)
 
user1596138
Well there's isRequired
 
@Jhoverit so, what, you've got people just using components without knowing what they do?
 
user1596138
3:42 PM
But still
 
@KendallFrey the chat doesn't let me make pictographs
 
user1596138
@Shmiddty I've got components that take data from APIs.
 
@rlemon wham
 
PropTypes.func.isRequired
 
user1596138
You think I type out every prop to every component somehow
 
3:42 PM
@Shmiddty wont error.
 
user1596138
Tf lmao
 
Proptypes aren't a magic bullet lmao
 
lmao
 
if you have an error in the render Proptypes don't magically solve that
 
user1596138
What would that make any better? Now you know. And the error is in the user's browser in Texas while you're in Nebraska
 
3:43 PM
they prevent a component rendering if they proptypes aren't right
 
user1596138
Sweeeeeet
 
@Shmiddty no.
 
I'm nervous as fuck for my final interview
 
Proptypes will just throw a warning
 
@SterlingArcher get high
 
3:43 PM
oh damn, good luck
 
I studied all weekend and I feel like I know nothing more than I did
 
@SterlingArcher get fucked up
 
I guess my react is rusty
 
also that
 
user1596138
@Shmiddty I want to render anyway. Ofc. This is the definition of resilience
 
3:43 PM
@SterlingArcher pee on their desk, if you mark your territory before the other candidates you're a shoe in
 
@Loktar they actually do throw errors
 
Jez
@KamilSolecki i tend to use ZMQ and fork my own processes with cluster
 
> When an invalid value is provided for a prop, a warning will be shown in the JavaScript console. For performance reasons, propTypes is only checked in development mode.
 
@Jhoverit so you just have to check each value you're using in the render
 
@Mosho for a stack trace sure, but it's really a warning
 
user1596138
3:44 PM
@Shmiddty This is programming
 
but since react traditionally totally crashed and burned on error until very recently, they are called inside a try/catch
 
user1596138
SOmetimes things go wrong.
 
lol you guys are crazy
 
user1596138
This is such a worthless conversation lmao
 
@Mosho not for proptypes...
 
3:44 PM
@Loktar I just mean technically, propTypes.array or whatever does throw
 
Proptypes never stopped rendering, and still don't
the issue isn't even proptypes lmao
 
they don't
 
I mean, you'd have none of these problems if you just vued
 
it's something @Shmiddty just randomly said
 
because what calls them does it in a try/catch
 
user1596138
3:45 PM
It has nothing to do with proptypes and proptypes hve no bearing on it lmao
 
user1596138
If errors never happened we wouldn't be talkjing talking about this
 
not even sure why we're on this path, the main issue was if anything fails in a render the entire component tree dies now
 
because react always broke when errors got get thrown
 
user1596138
But they do lmao
 
I'm just nitpicking
 
3:45 PM
@rlemon fuck lol
 
user1596138
@Mosho No. It didn't. It was resilient and could push through uncaught errors that weren't react related
 
but why are things failing in render?
 
if you don't code errors, you don't need proptypes right? 😉
 
user1596138
Or QA
 
@Jhoverit any errors thrown when react is rendering will cause everything to break
again, until very recently
 
3:46 PM
i mean... would you rather the app continue working but maybe fail in unexpected ways that don't really stop the app from continuing to fail, or display an error page and/or have the page restart
 
user1596138
@Mosho Blatantly untrue.
 
Jez
@Loktar Hang on, I was planning on using JSX. does this mean JSX sucks now?
 
user1596138
My app keeps working just fine before this unmounting of the entire tree.
 
^
 
3:46 PM
@Jez you can use jsx without react
 
user1596138
You guys must not have experience with this
 
user1596138
Thanks for the opinions tho
 
@Jez nah jsx/react are fine still
 
@Jhoverit this is like
 
it was a debated decision by the react team to do it, it's not like it was something taken lightly, I just wish they would have waited and added a deprecation warning
 
3:47 PM
really really common knowledge
 
then added unmounting in 0.17
 
you are probably experiencing something else
 
in fact, you can do jsx/vue
 
again, until very recently
 
no experience because I've never had an error in render at runtime
 
user1596138
3:48 PM
@Mosho put money on it so I can waste my time proving it. Otherwise you simply don't know what you're saying.
 
0.16.something
 
@Mosho you keep saying the same thing...
like the same thing we are talking about
 
@SterlingArcher 70km/h on the air
 
@Loktar but then you have two versions with breaking changes
 
@Loktar what do you mean
 
3:48 PM
not even sure what you're saying different at this point.
 
!!giphy noice
 
user1596138
We wouldn't be talking about this if you were right lmfao
 
we fucking know the page breaks with errors lmao
that's what the discussion is
 
3:48 PM
but @Jhoverit is saying it's not true
 
user1596138
@Loktar Well before it didn't
 
user1596138
Now it does
 
see?
 
errors were recoverable before
 
user1596138
Mosho is saying nothing changed and it only breaks less now lmfaooo...
 
3:49 PM
> This change means that as you migrate to React 16, you will likely uncover existing crashes in your application that have been unnoticed before. Adding error boundaries lets you provide better user experience when something goes wrong.
From the docs even.
Really common knowledge man
 
user1596138
^ Right there. Says now things break, before things didn't
 
imo they should have been. we disagree on this idea, i don't see this going anywhere
 
no, it's saying that things broke before but went unnoticed
 
user1596138
!!quote add 39554701 rly rly
 
@Jhoverit I will cherish this memory for the rest of my life
 
user1596138
3:50 PM
!!quote rly rly
 
@Shmiddty because the entire thing didn't break....
one child component throwing an error didn't destroy the entire tree
 
Jez
@KamilSolecki Does PM2 provide any mechanism for the launches processes to communicate with one another?
 
what did it do instead?
 
you could get an error in a modal for example that would cause it to be funky, until closed/unmounted
 
user1596138
They have no clue, obviously. I'm done here
 
3:51 PM
idk I hate when people just argue to argue
 
@Jez there are innumerable ways to do that, with or without cluster (or pm2's use of it)
 
You're so consistent with leaving whenever someone argues with you it's incredible
 
eh, garbage in garbage out is all I'm saying
 
like, i don't see this argument going anywhere
 
we should really drop this
 
Jez
3:51 PM
@ssube yes but it's a totally separate thing?
 
@Cereal people are consistent with arguing over anything he says
@ssube drop talking about react errors
 
This is also true
 
sure lol.
 
@Loktar no, repeatedly debating the same bit of spec
after quoting it a dozen times
 
Even on topic discussions can't be had due to peoples preconceived attitude towards certain users.
 
3:52 PM
just because a few folks don't want to read through it
it's pretty frustrating when other conversations are trying to happen
 
yeah I agree, I'm done as well I guess.
 
user1596138
@Cereal Im sitting here saying exactly what the fucking docs say. I'm being told I should know better, it's really really common knowledge. Literally getting nonsense here. The objectively proper thing to do here is to leave.
 
user1596138
So I leave. Peace lol
 
@Loktar all I'm saying is that if you error in render, react's internal state is now broken in some way
it doesn't crash your pc
some things might still work
but the same code/component from where the error was thrown will not work anymore
 
@Mosho who argued that?
The issue now is the entire component tree dies
 
3:54 PM
@Jhoverit
 
he didn't...
you guys just weren't understanding I guess idk.
 
5 mins ago, by Jhoverit
^ Right there. Says now things break, before things didn't
he did
 
blame blaming, sure
 
in so many words
not sure why you're disputing that
 
in so many words
 
he wanted to keep the argument going and it worked
 
good job folks
 
o/
 
don't go all ndugger on us
 
3:56 PM
\o
what happened
 
remove me from the github stuff too please
nah I'm not leaving
but haven't wanted to be an owner for a while, and have been less active due to attitudes on here anyway
 
what attitude lol come on
 
even on topic discussions can't be had it's silly
 
how can i simulate an unexpected error when using typescript with react to see this in action? typescript just kicks it out, :p
 
when did this become a heated argument
 
3:57 PM
shrug
 
when people asked for it to stop
 
HAMMERTIME!
 
I'm not heated, I just think it's crazy stuff like this can even get out of hand
then the arguing over the argument
it's nutty
 
Didn't seem heated to me
But I was just watching, what do I know
 
well
 
3:58 PM
6 mins ago, by ssube
we should really drop this
If another owner says that.. it's generally to stop a bigger issue
and I def agree/agreed
dropping it though for real, I don't want a big drama issue or anything
 
yeah, I was carefully uninvolved
 
or maybe ssube was expressing his opinion as an individual? :/
 
it was getting out of hand
 
> I'm too old for this shit
^ basically my thoughts lol
 
the same quote being posted and everyone accused of misreading it
 
3:59 PM
it goes wrong when someone throws out the other side with 'well i mean that's like just your opinion, you're still wrong'
 
that's going nowhere
 
noone was disagreeing with what changed
 
it was purely accusations of "you're reading it wrong"
 
we were just saying, hey guys this is sort of crazy
man our whole page dies on small errors now, that sucks
and people are like "That's old news it always did blah blah"
 
@Mosho and @Shmiddty pointed out that's how it always worked, and Jhoverit said no
 
3:59 PM
which isn't entirely true.
 
user1596138
Stahp pinging me lmao
 
in the words of a wise man
32 mins ago, by Loktar
Time to move to Vue I guess
 

« first day (2552 days earlier)      last day (2379 days later) »