« first day (2889 days earlier)      last day (2052 days later) » 

7:01 PM
 Object {
      "2018-09-12": Object {
i dont need the second object in there
 
Then don't put it there
 
If I go to the networks tab and everything has returned 200 with no (pending) requests, where else can I look to see what might be preventing window's load event from firing?
 
Thanks guys for the help, that has got me my answer back to the drawing board :-)
 
7:18 PM
What is the difference between the document and the DOM?
Specifically, on this page: mdn onload it says the load event fires when "all of the objects in the document are in the DOM"
 
?
 
anyone in DC?
I'll be here a couple more hours
 
I recall archer is in DC
 
7:21 PM
@Vap0r Could be wrong, but the document is the instance using the DOM or is the current reference to the DOM object? DISCLAIMER this is a guess
 
it's all on mdn
 
^yep
 
my link shows DOM, rlemon's shows document
 
and both should interlink
 
neither are important to your problem i think
 
7:21 PM
@SterlingArcher you in DC right?
I'm here for a couple more hours
 
@Vap0r that means all elements on the page have been parsed into the DOM Tree.
but in the case of .onload it also waits for all resources to finish downloading
 
The timeline should have everything you need to see what is delaying the load event.
 
that's a defining feature of it
 
the timeline in the network tab
teh page i'm looking at for example gets delayed by downloading a 3mb image
speaking of... why the hell is there a 3mb image on this page
 
If an error is raised at "something", it will go all the way down to foo().catch() right? - I cant wrap my head around my code, it has gotten so complex with all these nested and chained promises. Im getting unhandled promises everywhere.
const foo() = {
	promises = [].map(x => {
		return new Promise({x=>{
			something.catch(throw err)
		  }
	  })
	})
	return Promise.all(promises)
}

foo().catch(err => console.log(err, 'DO WE CATCH IT HERE?'))
 
7:26 PM
@rlemon yeah, in my case my network tab shows all resources loaded. So I'm assuming that for some reason something in the document is not parsed into the dom
 
@William yeah I'm good bud sorry
 
meaning I'm not cool enough for you :D
that's cool I guess
 
Do you know how the introduction of an async piece of code could cause this?
 
In the bottom you have when the relevant events were raised
DOMContentLoaded is the blue bar, onload is the red bar
They can't not be raised at some point, because y'know, at some point things stopped loading
Whether due to naturally stopping, or erorring out because of timeouts, ...
 
to be fair asking now is rather last minute
but I have only been here 1 day so didn't have much time to work with
 
7:34 PM
@Zirak I know this seems like user error or a misunderstanding, but I promise that is exactly the case I'm describing.
 
ok
 
@MadaraUchiha you mean if they are a repeat offender or you mean fire them right away?
 
So you refresh the page, check the network tab, and no events are raised
 
It only happens in Chrome 69, btw
 
@Rick Yes.
 
7:35 PM
so there would be some type of warning
 
hi I have a question about this react-native component..it says it is a deck swiper so I see I just need to pass images to it....but on render only one image is displayed. Do I need to handle the image transitions?
http://docs.nativebase.io/Components.html#deckswiper-def-headref

I've pretty much set mine up the same as the docs but noo swipey

https://gist.github.com/BrianJVarley/6066e4a29d234c2de40e14bf7d69f601
 
Also the loading icon is still spinning right now for that same request
 
Which resource hasn't finished? Find the request that's stuck
If you can't find anything obvious, binary search your code (delete half, refresh, see if it replicates, etc)
 
What do you mean by request that's stuck?
 
A request that hasn't completed yet
 
7:39 PM
Because every request in the network tab has a 200 status, and displays the time it took to fetch
 
1 min ago, by Zirak
If you can't find anything obvious, binary search your code (delete half, refresh, see if it replicates, etc)
 
@Zirak how would binary search code?
 
See the text in parentheses
 
Delete half of the references? Because I'm able to get it to work by removing the async attribute from one script tag, but I don't think that's it.
Also why would it only happen in chrome 69 and not chrome 68 or another browser?
 
O that seems obvious I was thinking of something much more elaborate.
You're probably using a deprecated feature
or you're doing something really stupid
I vote for the latter
 
7:52 PM
@Zirak i.imgur.com/wWWvwzG.jpg shows the entire list of network requests and that they all completed loading.
But the page has not loaded
 
Can you create a MCVE?
 
Yeah I know what it is, I'm not sure if I can. I don't quite know what's causing the issue. I just found out that DOMContentLoaded is never called either
 
if you have two nested for loops is there a way to continue to the outer loop without using a label or a function?
 
Force the inner loop's condition to be false
 
so use a global to commuincate between the two
since I want it to continue where it last left off
 
8:13 PM
hi
var array = ['a','b']

var array2 = [1,2,3];

var x = array.push.apply(array,array2);
why is x is getting value 5?
 
length of the array
 
I was expecting it getting array reference
yeah I can see that Grandpa Rick
 
why would you expect the reference
that is what push gives you
 
oh
 
@Zirak I don't think I can perform an MCVE because I notice that if I do things to increase the performance in regards to load time of the application that the issue goes away
Plus the place where the window event listener is added that isn't fired is in the middle of a 72,000 line long JS file
 
8:17 PM
also it's more helpfull that you get the length back than a reference to the object
 
Which codepen won't allow me to load up
 
yeah I guess so
 
how do you write 72,000 lines of broken js and now know it
 
72,000!
 
now that's worth firing someone for
 
8:19 PM
my pikachu level
 
@Rick it's ASPx JS code, so it's part of a control set (in this case devexpress)
 
I don't get that, and I don't need to.
 
You're pretty snarky for somebody who embraces ignorance with welcoming arms.
Don't you think your development as a programmer might go better if you didn't act that way?
 
well, he is Rick
;)
 
@Vap0r wow
 
8:25 PM
@Rick Oh, you know it. You always know it.
 
@DavidKamer what's up?
 
@Vap0r nothing lol, just thought that was a bit far. "embraces ignorance with welcoming arms" lol, that got almost metaphysical
 
I am not a programmer. more of a wizard quite possibly a demon. but more accurately a scientist
 
@DavidKamer fair enough.
 
@Rick don't you know that the term is coder or hacker you pleb lol jk
 
8:28 PM
guys, how can I maintain the discipline to keep learning? I also find myself keep getting lost in the docs
 
@Shad reading docs is a skill, just like anything else. You'll get better at it over time and the more you do it.
 
@Shad That's a tough question. I'm in this profession because I love learning new things all the time
 
@Shad I do it by watching videos. It taps into my interpersonal nature. a nature all humans have..
 
Reading docs will help you when you need a reference, but learning new things is almost always about trying new things.
 
but it becomes overwhelming!
too much nitty grittys
 
8:30 PM
just pay attention to the main concept and just review the specifics as a side note. Don't engage people who only care about specifics because they'll make you hate the conceptual way of thinking
 
hmm
thanks @MadaraUchiha
ok david
 
Focus on the abstract. Abstract means the ability to talk in high level concepts, while ignoring implementation details.
Doing the implementation details is usually fairly simple. It's understanding the abstract concepts behind those implementation details that's trickier.
 
point noted :')
 
@MadaraUchiha that's a good way to look at it. I agree
 
@MadaraUchiha it turns out DOMContentLoaded never fires either, but the page never times out, and the spinner keeps spinning
And that's indefinite, not just like a minute or so
 
8:34 PM
That sounds like an actual bug in Chrome.
There were other problems following the release of 69
A library in webpack caused devServer to be broken, for example
 
Hey there, do you know of any good canonical/very general dupe target for questions regarding Computed Properties? A few google searches didn't yield anything too promising...
 
@LucaKiebel What about computed properties?
 
a good dupe target for questions about computed properties
 
I get that...
computed properties is a rather broad subject
What kind of questions?
Do you have an example?
 
Oh, well, along the lines of
-1
Q: Use parameter in the key object

Дмитрий ЮзенковI have something like that: add(messenger) { switch (messenger) { case 'skype': this.messengers = _.assign(this.messengers, {skype: ''}) break case 'telegram': this.messengers = _.assign(this.messengers, {telegram: ''}) break } } But are there ways to make...

generally "use this variable as the name for a key"
Problem with the dupe target proposed there, imo, is, that it's about first initializing an object and then setting a property of it
 
8:42 PM
586
Q: Is it possible to add dynamically named properties to JavaScript object?

Lee DIn JavaScript, I've created an object like so: var data = { 'PropertyA': 1, 'PropertyB': 2, 'PropertyC': 3 }; Is it possible to add further properties to this object after it's initial creation if the properties name is not determined until run time? i.e. var propName = 'Property'...

 
@rlemon Ok, in there it's the 3rd answer that references CP
 
yea, which is the answer he needs
 
the current dupe also answers their question, but you'd have to link to the 2nd, or 3rd answer. That's why I am asking if there is a question specifically asked about computed properties that could be used as a future dupe :-)
 
no you don't
it's answered, it doesn't have to be the accepted answer
and you have zero control over how the OP sorts their answers
the order they are in for you is irrelevant so long as the answer exists
 
Okay then.
 
8:49 PM
Hmmm
It might be a good idea to be able to mark specific answers as duplicate targets...
 
that would be helpful
 
indeed
 
meh
 
that is, if an answer is a dupe, not the question
 
@LucaKiebel No
To say this answer here answers your question
 
8:53 PM
old SO was much more generic
one question had 19 approaches to the answer
all slightly different
it would be nice to say "ohh here's the computed property answer" and not "ohh hey, here's a generic dynamic property question. the answer is there somewhere"
 
Even maybe go as far as showing a slightly differently colored version of the linked answer on the closed dupe question page
Although I have no idea how that would work SEO-wise
 
outline it and sort it to the top
like pinned there.
 
Yeah, exactly
 
but only for that link
I'm down with that
 
Google frowns upon duplicated content though
 
8:55 PM
don't have google follow those links
 
The links aren't the problem
The content is
 
but the page doesn't change
 
You're essentially "copying" content from another post to this one.
 
?dupe-answer=12345667
just cross link it with something like that
and have that trigger a UI change on the client
 
And if I don't enter the duped question with the query param?
 
8:56 PM
then it's a classic dupe target
if that param is added, you get that answer sorted to the top with an outline
no content changes. just the display of it
 
And what would add it?
Ah
That exists though
Sort-of
You can link to an answer directly already
 
yes, you can link to an answer
 
You would get a highlight and the page would scroll appropriately
 
yes, but you can't link it in the "closed as dupe of " banner
 
maybe incorporating that with the dupe system would be enough...
 
8:58 PM
^
 
@rlemon Ah, I see what you mean
Like adding the ability to add ?dupe-answer=1234567 in the dupe dialog
 
yes
 
That's a lot of extra work though
To find the exact answer you want (especially with the rather crappy UI in the dialog)
 
well yea, I hate that dialog
 
Might be simpler to just allow for answer links
 
8:59 PM
completely useless on mobile too
when you finally find the answer, it opens it in a iframe(??) and it's the complete question / answer chain
 
Find answer you want (let's not pretend, we all use Google for that anyway), hit "share", copy link, back to question, close, dupe, paste, done
 
then you have to scroll passed all that crap to select it
 
@MadaraUchiha it does allow for answer links, it just looks up the question instead
 
@LucaKiebel Yeah, I mean that it would actually work though :D
 
that - of course - would have to be built first ^^
 
9:05 PM
@MadaraUchiha I think you're right that it's a bug in chrome. I think it might have something to do with threading and async stuff but how do I go about making an MVCE? In my real-world use-case we have 50k lines of HTML and a 72k line JS file, as well as multiple nested imports in an <script async type="module">/* inline js */</script> file
There seem to be 3 things that mitigate the issue:
• remove async from the inline script of type module
• Improve performance of scripts on the page
• refresh without clearing cache (this issue only pops up on first load or on hard refresh)
And the issue itself is that the loading icon on the tab never goes away, and DOMContentLoaded and window load are never fired, but somehow the page doesn't ever timeout
 
9:20 PM
I don't want to fall into premature optimizations, but does somebody knows if it is wise to check if a string.contains("something") before doing string.replace("something", "else") (the regexp actually is quite complex)? Or I simply should let the replace function run on every string the function receives?
 
0
Q: Add the ability to mark questions as "answered here" (a.k.a. duplicates of answers)

Madara Uchiha TL;DR - Make the dupe dialog accept links to answers, and when that happens, have the dupe banner added by the system to link to that specific answer, not the question. Consider the following scenario. A user asks a question. The question has already been answered by some another user on ...

I haven't mentioned the "pin it at the top" part, because I'm trying to keep it dev minimal
If it takes too much dev effort, it will definitely not happen.
 
@Frondor intuition tells me that replace will search the string like containers
 
@DavidKamer Yes, makes sense. I'll write a jsbench anyway
 
Could be using hashes tho
 
contains + replace sounds like x2 times of iterations to me
 
9:25 PM
Me too
 
@Frondor How large is the string expected to be?
If the string is small, and the regex is massive, it's probably worth it.
Else, probably not so much
 
@MadaraUchiha the whole bootstrap _variables.scss file
 
@Frondor string manipulation on code? tisk tisk.
You've been naughty!
 
Its a tool for myself :D So I'm free to make bad things
A node script for extracting bootstrap scss _variables and bootstrap.scss files from node_modules into my src/assets/scss folder and update the import paths
 
@Frondor Why not just import the files directly from node_modules?
Why copy?
 
9:30 PM
So you chose which scss module to import, like the custom build you make in the bootstrap website.
For vue projects, when you want to use bootstrap and its scss files or modify bootstrap _variables, I copy those two files
 
I still don't get why not just use import 'bootstrap/sass/whatever/bootstrap.scss'
Why all the overhead?
 
@MadaraUchiha if 2 accounts are merged will there reputation be merged too?
 
All the oposite, so I can prevent bootstrap/sass/whatever/bootstrap.scss from importing components I wont use on my design
like modals, or navbars
https://github.com/twbs/bootstrap/blob/v4-dev/scss/bootstrap.scss comment all the modules you wont use, and slim a bit your css bundle. So you extract that file to the source folder, delete or comment the css components you wont use, and update the paths to point to each component in the `node_modules` dir.
I find myself doing that task every time I scaffold a new project, so I'm creating a node script for that
Probably there's some package that may allow me to load a scss file, edit its content and save it back. But I was just playing around without dependencies
 
I want to convert an object that has Files in it into base64 string to save to the database
how do I approach?
 
@ShakilAhmed That is a terrifyingly bad idea.
For several reasons
 
9:41 PM
@mada
 
@bsap Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
sure
 
1. Database indices generally work poorly on binary data (yes, even base64 encoded binary data)
2. base64 encoding inflates the size of the data by approx 33%
3. Files are not data, they are files, they may contain data, but they are not data themselves. They do not belong in a database.
 
@MadaraUchiha I understand, but that's the requirement now -_-
 
Save the files to disk, not to the database, and store the file path where you would normally store the file.
It's a dumb requirement that would cost you hours, and your company money.
 
9:44 PM
how do I save the file to disk on browser?
 
I... what?
Now I'm confused.
What kind of database were you thinking if you're thinking of the browser?
 
localstorage
not a database actually
I'm building something that will persist the changes to the browser
including the images uploaded
 
And where would you get said file from?
Why would you want to store uploaded images in localStorage for any length of time?
What's the purpose?
 
for example, someone uploads an image to an editor, they do not have internet access. we will save it to the localstorge so that he can resume later
 
Hmm
That's a valid enough use-case, I suppose.
Here's one possible solution: hacks.mozilla.org/2012/02/…
You should look into service workers though
They might be a better solution overall to working with offline
 
9:51 PM
1
Q: Run two javascript functions in parallel with promises

Lokesh Cherukuri(function() { function main() { call1(); call2(); } function call1() { return new Promise(() => { for (let i=0; i<100; i++) { console.log('This is call-1:', i); } }); } function call2() { return new Promise(() => { for (let i=0; i<100; i+...

where's the lacks minimal understanding close reason when you need it
 
@KevinB It's not lacks minimal understanding in my opinion
The fact that the Promise revealing constructor runs synchronously is not very intuitive at first glance.
 
@MadaraUchiha thanks man
 
@ShakilAhmed Use IndexedDB, it was meant to save blobs in the browser
localStorage isn't meant for blobs, but for strings
 
@Zirak looks cool. checking it!
 
@KevinB I only now realized that his code is not equivalent to what he has in reality.
I've closed it as needs mcve
 
10:10 PM
Thought, I am all in favor of open browsers and open web, but shouldn't browser vendors try to work with OS vendors on making the browsers sandboxed apps and vice versa?
 
hah
i can't see MS considering that, with how they keep pushing the idea that chrome and firefox aren't as secure/fast andwhatnot
 
In their current form, they probably arent
they probably are as a browser more secure than Edge though
 
why would MS help their competitors though?
it's different for linux/mac
 
On Mac, Chrome uses Carbon API which has been up for deprecation since ~2008
 
but with microsoft, they have their own browser, and chrome/firefox are direct competitors on several fronts
 
10:13 PM
Mac has Safari :)
 
yeah, but noone uses safari
 
lol
same with Edge
On iOS, Apple opened up ways to have the Chrome / FFox / Custom Browser views to some extent but that is no where close to a custom browser. MS opened the sandbox enough for iTunes and Linux Subsystem.
The advantage to MS is that most legacy apps will be able to run within sandbox
once they have that they can take it whichever way they want
right now most apps I use on Mac, Windows run unsandboxed or are outright forms of Chrome (electrons)
 
Just throwing this out here 12factor.net
 
@Zirak and ....?
I like it, I have read it a few times, am I missing something?
 
It's not related to the topic
Just throwing it out there
 
10:23 PM
Oh ok, its really goood.
Have you read ?
 
10:34 PM
> Web servers are boring and complex and hard to work with.
lul
> It can only store string data ... you could serialize everything including data types into local storage, but that’s an ugly hack.
TIL serialization is an ugly hack
 
@forresthopkinsa Depends on the purpose of said serialization
Serializing a blob to a string when there's a blob storage, is pointless, and is generally a hack to avoid tapping into an unfamiliar API
Serializing a blob to a string to pass it over the wire in a protocol that only supports ASCII ISO encoded strings, well, that's just life.
 
fair enough
this article is pretty reminiscent of that other "Stop using JWT for sessions" article
 
stop using jquery
 
@forresthopkinsa do you agree with this?
 
not using localstorage for sessions? totally
httponly cookies are the way to go
XSS is harder to protect against than CSRF
 
10:49 PM
using jwts in localstorage for sessions is stupid cos they expire, it's much better to just save the username and password in localstorage so you can get a new jwt whenever you want, no need to store
 
brilliant
 
How did I not think of this?
 
(i probably just gave shrek a massive panic attack)
 
why require a username and password?
 
What's most amazing is that neither localstorage nor JWTs expire by default XD
 
10:50 PM
@KevinB for secure
2
 
@KevinB Are you crazy? How would you secure?!
 
but who was phone????!
 
firstname and lastname
 
@KevinB I just use lastname as my password
That way I don't forget
Like literally 'lastname'
return 'promise';
 
10:53 PM
@forresthopkinsa ?
 
@MadaraUchiha !
 
what does oof even mean ?
 
@Rick Object Oriented Farming
 
20% accurate as usual,
 
11:12 PM
Still, you can take advantage of JWT facilities by splitting the token and using it like a double-submit cookie pattern. Send just the signature as an httpOnly/secure cookie and the rest over an `Authorization` header. Rebuild the token in the backend and that's it.
You still need proper and strict CSP anyway.
 
any of you worked with indexedDB before?
 
Is that still a thing?
 
@Frondor Seems like an unnecessary trouble when you can just send the cookie
 
@forresthopkinsa Well, its not if you care about performance. Generating CSRF tokens is quite an expensive operation, specially for Node apps. You save some bandwidth as well, since you'll send the token on every request + the JWT, when you could just send a single JWT
 
that's assuming that you'd use a JWT at all
 
11:23 PM
I thought you were talking about JWT
 
I'm saying, don't use localstorage or JWT, just use cookies
 
What about restful APIs consumed by javascript clients?
 
so you allow Authorization headers or cookies
I mean, you'd kinda have to allow Authorization headers anyway
every request allows an auth header and will return a cookie; cookie can be used instead on future requests
this is pretty conventional, no?
 
Anyone available to help me with a mongo/javascript problem?
 
@Bkes Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
11:31 PM
I need help solving a problem with getting an id and passing that to my backend
 
don't ask to ask
 
I'm not understanding how to pass an ID to my mongo from the front end
how can I show code?
 
is there a penalty for declaring a variable inside a for loop as opposed to hoisting and redefining in the loop?
 
Watched a few good ted-talks
 
@ShrekOverflow you are so 2013. That's was when ted-talks were all the rave. now mahh
 
11:48 PM
@Rick From 2011
@Rick Ted Talks are not meh they are being politicized beating the point
 

« first day (2889 days earlier)      last day (2052 days later) »