« first day (2323 days earlier)      last day (2611 days later) » 

12:01 AM
@CapricaSix Thanks
 
@Mosho lol.
I have no idea why the router/location state is so funky at the website project, but it's pretty simple with react-router to run things with the old/new state.
There are hooks for props changing and route changing. They're poorly named like component lifecycle hooks but meh.
You already know that probably though, so what's the question?
 
the router has isActive
I want to use it before the route changes
so that it checks what I give it against the route I just left
 
Well, I can think of an easy ugly solution of having two routers on the same routes, one using memory history and always containing the last state of the real router.
But I really think you need to solve the x in your xy problem - the old route is old state and keeping old state around is typically not great behavior.
 
I'm not keeping it
just calling a function while it still hasn't been updated
 
What do you need it for then?
 
12:08 AM
my state and routes are decoupled
I do not want the route components to call actions with react's hooks
I do want to listen, in a store, to route changes
and setup/teardown what I need when the route changes
 
Router state is state. You shouldn't use route components to call actions - just use functions.
 
while the route component is agnostic
 
Wait, what? You want the store to listen to route changes?
How is that a concern for the store? It's a concern for the router.
Wait, what? You want the store to listen to route changes?
 
fetching data, for example
 
Making the store aware of the router is the most coupling I've ever heard of between a router and a store.
 
12:10 AM
the store does that, and changing the route triggers it
 
Right, and the code that does the actual triggering should be in the router and not the store.
 
a router-store
whatever you want to call it
 
The router is the only one aware of both the components and the store
 
what is the router?
 
You can call every router a 'router-store' - a router is just a state manager..
 
12:11 AM
yeah, then lets do that
 
I dunno, riotjs looks better
 
I just have a class that listens to react-router and history
that's what I mean by store
 
Right, you can put the route in a store but then don't use ReactRouter - just put the route in the store and use history.
What part does the react-router play?
 
the components, nesting
redirects
 
You are turning explicit coupling into implicit coupling...
You have two routers that share the same state implicitly.
This is more work and coupling than you have in the Angular 1 router :P
 
12:14 AM
yeah, I hate it too
 
Then why not just use the express router, have that tell the store to fetch data and return the react component with the store passed?
 
react-router does a little more than manage your state
 
Does anyone else see Ben's avatar as a gravatar?
 
I have no idea why, I see it as an avatar. I also saw myself in the promise tag as a gravatar.
 
I use my own router that I initially wrote for Node, but it's super agnostic.
 
12:15 AM
@Mosho I don't think I agree.
 
it gives you those components
 
route-recognizer + history + mobx object for the state (pendingRoute, currentRoute, etc)
 
like IndexRoute
 
I see me, Ben, and ThiefMaster all with generated avatars
 
@Mosho yeah, ew.
 
12:16 AM
I think gravatar is having a fit
 
and I said a little more
and the nesting
 
Yeah, I dislike React Router.
If you like the nesting use junctions, at least it does the nesting right.
Nesting that doesn't compose like in react-router is pretty useless IMO.
 
and the hooks
like onEnter
 
I want to like it, but after setting it up to try it (v3 and b4), the declarative routes in JSX is just a gimmick and brings nothing to the table.
 
I'm the OG react-router hater
there is no need to sell me on it
 
mpm
12:18 AM
hi folks! what the best validation library for nodejs? simple but efficient ?
 
I could use it and be reasonably content, it's just not 'special'.
 
@Mosho with a really ugly API, especially given onEnter is all you actually need.
 
but getting rid of it at this point is probably not going to happen
 
@mpm depends what "best" means
 
@Luggage right, except confusion.
@Mosho we're switching it, probably.
 
12:19 AM
it's just not a priority
 
Right, but then again neither is making the store listen to it.
 
swapping out your router shouldn't even be TOO much work.
 
it already listens to it
and it works well
 
Except changing it would actually solve your problem unlike making the store implicitly coupled.
 
mpm
@KendallFrey well I just want to validate some objects, the ususal stuff , length min , max, this prop not empty, that property within this array , ...
If it supports localisation for error messages it's a bonus ;)
 
12:19 AM
other than this problem I'm having right now, it's working really well
 
@Mosho it doesn't work well at TipRanks (listening to location changes and updating the state), that's part of why we're switching the router.
(and the flux, probably, but that's a lot more work)
 
yeah, I learned from those mistakes with the router :P
 
@Mosho it might work, but I just don't see why you'd couple your data to the store. It sounds like a mistake to me.
 
@mpm What problem are you trying to solve by introducing a new library to your codebase?
 
You're duplicating state.
Derive state, don't put it in two places.
If you want the store to start fetching data when the route changes - you can put that logic in the router since it is in charge of well... route changes.
Don't make a second store router and have it listen and initiate just those fetches.
 
mpm
12:21 AM
@KendallFrey I just don't to have to write 50 validators, if it looks like I wont need it, I will remove the dependency. I'm just prototyping . So any idea about a good validation package?
 
@mpm validate what?
 
@BenjaminGruenbaum I used to do something like that
listening to history
 
I've never used a library just for validation. I use if blocks.
 
but that came with its own set of annoying problems
 
But since I don't actually know what problem you're trying to solve, I can't provide any solution.
 
12:23 AM
@Mosho jesus christ no don't do that.
Don't listen to history.
just use a decent router.
 
and the way I have this app set up means I need the router to exist in the context of my stores
 
the history package (used by react-router, too) provides most of the heavy lifting of knowing when to change routes/state with async cancellable route changes, too.
 
mpm
@BenjaminGruenbaum validate properties on js objects, emails, string length, property not empty , match this or that regexp ... with localisation support if possible but not mandatory
 
Then you have more code to do your data loading
 
@BenjaminGruenbaum right, but if I listen to history you have listenBefore
 
12:24 AM
@mpm That's something you can do with simple conditionals in your code.
 
which is what I need right now, but I want to get it out of the router
 
I find that to be very backwards.
But ymmv and you're solving different problems now
 
it's really generally working very well
 
@mpm what would an optimal API look like?
 
I just need this one stupid hook
 
12:25 AM
lol
 
they have setRouteLeaveHook
but it's route-specific
and it's shitty in general
 
mpm
@BenjaminGruenbaum something like StringLength(object,fieldname,minlength,maxLength):Error
 
@mpm Why is that better than an if?
 
@mpm I'd probably validate it on the client and on the DB and not in Node probably. On the client html5 ships with form validation anyway.
 
mpm
12:28 AM
@KendllFrey it's like asking why anyone would use a router, one can just switch on url path
@BenjaminGruenbaum I need to validate the user data, as forms, on the server, it is not necessarily db entities.
 
@mpm A router solves the problem of complex routes that would otherwise lead to spaghetti code.
 
@mpm are you putting that data in classes?
 
mpm
@KendallFrey and a validation library can solve complex problems too, with contextual validation, localisation , ....
 
Choose a validation library that isn't browser-only. Then you can validate on the server (mandatory) and on the client (for nicer UX) with the same code.
 
OK, so now you're getting somewhere, by looking for existing solutions to specific problems.
 
mpm
12:31 AM
@BenjaminGruenbaum I don't know, I'm just asking around what people are using.
 
@mpm there are no good libraries for general validation. There are libraries for validating phone numbers, addresses etc.
 
I have been using some JSON schema, with ajv to do some validation
invariants, at least.
 
mpm
Well I didn't find anything substantial on NPM anyway, you'd think this is an fundamental thing, but apparently not. Guess i'll have to port something from Python or PHP like Zend validation.
thx
 
There are several validation libraries around.
i've used validatejs.org and didn't hate it
along with github.com/epoberezkin/ajv for JSON schema validation that I mentioned earlier
 
mpm
@Luggage thx, let me check that out.
 
12:42 AM
Anyone here ever used budo before?
I couldn't make it work properly. It somehow doesn't update my changes at all
 
 
1 hour later…
niiiiice
 
I took the stereo image and ripped apart into a SBS, and viewed it in Oculus
:)
 
lol
 
I'm working on a server which manages a Redis DB and determines messages to send at a variable interval for each group of messages.
Is it acceptable to use a bunch of timers for this?
(Node)
 
2:35 AM
can anyone tell me about the current state of hot reload in webpack 2?
 
 
2 hours later…
4:23 AM
@Allenph why not use websockets
but yeah, using timers is fine
 
0
Q: window.print() not working with large ajax response

Shijin T RI have created a function to print ajax response like bellow, $(function(){ var pageUrl = 'http://192.168.2.100/test.html'; // page contain large data as HTML format $.get(pageUrl,function(res){ var newWin=window.open('','Print-Window'); newWin.document.writeln(...

anyone have any idea about this?
 
5:06 AM
some of the web-apps I find in github uses npm as well as bower, why is that ?
 
5:17 AM
morning
 
5:28 AM
@Mr_Green
morning
 
!!cowsay Good Morning
 
 _____________
< Good Morning >
 -------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
 
Is node and nodeJS different ? (is the 1st one addressing chrome engine ?)
 
6:06 AM
Why in the ignore list there is "test" and "tests" and also .*?
thats the thing I got after bower init
 
@AlexanderChandra Welcome to the JavaScript chat! Please review the room rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
7:25 AM
var newWin=window.open('','Print-Window');
newWin.document.writeln(".........');
is there any method for catching the writeln complete or not?
 
@FlyingGambit it means those files will be ignored when someone else installs your thing
since they probably don't need to download your tests
 
7:41 AM
@AlexanderChandra answerred
 
hi
 
hello
 
@KarelG me so frustrated over doubts :(
 
@Mr_vasu Hello Vasu sir
How are you?
 
7:57 AM
o/
 
\o
 
@phenomnomnominal Wait wait, test is my project name
 
you have made your package private
 
@KarelG I did not know what it meant, so kept following the tutorial
@phenomnomnominal nvm, I tried the same with another project name it still has "test" and "tests"
basically I am trying to understand how gulp works so that I could decode and learn how our current web app uses gulp ... from gulp serve to how it loads each file and stuff
 
8:18 AM
@phenomnomnominal oi! long time no see! how are you doing?
 
@FlyingGambit test modules are usually placed in "test" folders
 
@GNi33 hey bud! I'm good! How are you?
 
fine! it's too cold around here, but other than that, I'm good ;)
 
Nice! Seen any good shows lately?
 
No, winter around here is always pretty slow with shows
 
8:22 AM
oh yeah, damn that sucks!
 
saw Blink, Vanna and Parkway Drive in California though a few months ago
 
huh
 
I went to Menzingers a few weekends ago in Sydney
 
iis it not otherwise ?
 
BLINK! you lucky bastard
 
8:22 AM
there are usually more shows during winters
wait, you're AUS ?
 
I'm in NZ
 
ah, then winter is "summer" there
 
@phenomnomnominal yeah, managed to catch the last show of their North America tour :)
Menzingers, nice :)
 
the TV providers usually release more new shows when it's cold (winter)
 
and RVIVR in sydney too, so good
@KarelG we're talking about bands :)
 
8:24 AM
i'm not following music :p
it's a black hole
sorry. ignore me
 
if there's one thing that makes life great, it's music
 
Can't even imagine life without it
@GNi33 did I tell you I went to Fest?
 
don't think so. Which Fest are we talking about exactly? :D
 
Hi guys. Noob here. I don't understand a point in this article on V8: [High-performance ES2015 and beyond](https://v8project.blogspot.fr/2017/02/high-performance-es2015-and-beyond.html).

> This meant V8’s ability to optimize an ES6 feature like for...of, which essentially has an implicit finally clause, was limited

Can somebody explain me what the author means with *"for...of, which essentially has an implicit finally clause"* ?

(related fact: I had also noticed that Babel's `for...of` results in an incredibly slow code making it often unsuable)
 
ah, but still I wouldn't follow music. because i'm unable to follow it very well
 
8:29 AM
Have a very quick question, how the heck to I get a single number into an element in jQuery? I can't find an answer that isn't over involved with other problems.
 
@Delto Welcome to the JavaScript chat! Please review the room rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
@Delto just create an element and put the number in that ? (or do you want something else)
@DenysSéguret did you have checked for..of under the hood ?
i'm intrigued
 
@KarelG I glanced at the horrible transpilation, not at the real one. I noticed the try/catch and the fact it was too slow to be usable in prod
 
@KarelG I need to change an existing number in div from 15 to 0 with jQuery.
 
I'm curious about why it would essentially have an implicit finally clause. How is it different from other loops ? For cleaning a generator ?
 
8:33 AM
Changing it into text is easy enough. But I can't seem to find out how to use jQuery to change it into a different number.
 
use var div = $('#idOfYourDiv'); div.text( div.text().replace(/15/g, 0) ); ?
 
@DenysSéguret I checked a polyfill and .... i didn't expect to see that: babeljs.io/docs/plugins/transform-es2015-for-of
 
ah yeah, I think you talked about this
how was it?
 
Hey @KarelG, what would the solution be if I didn't know the number (15 in this case)?
 
8:44 AM
just insert a variable in that regex thing instead of 15
you can create dynamic regexs by RegExp <-- click it for docs
 
@KarelG I know absolutely nothing about regex and I'm a bit tight on time. Any way you can let me know that solution? I'm quite a newbie in this area.
 
ah, if you take time in doing this, you won't have this "time consuming issue" later when facing the same problem. Invest now for the future
 
@KarelG Definitely agree. I'm working through codeschool and learning as much as I can. If it wasn't so late, and I wasn't needing to get this done tonight, I would save it for the morning.
If you don't want to provide the answer, that's okay.
But it would be helpful.
 
What to do with this question ?
-1
Q: Why does this code result in a memory leak?

KaramellIn the code below, I don't expect memory to continuously increase, but it does, according to chrome debugger. In the middle of the loop, I await 10 milliseconds which is enough for the previous timeout to finish. Yet still the memory doesn't seem to be freed. Why is that? while (true) { let...

The guy is playing with fire, obviously
 
8:51 AM
a timeout in await promise lol
 
9:10 AM
Hey @KarelG, thanks a lot! Got it all working!
This stranger owes you one. Have a nice night.
 
9:21 AM
a parser bug is causing a mem leak at Cloudflare: incident report
 
Good to know that they are transparent to their customers
 
yeah. I found the blog informative. Pls star it :D
 
There a free ⋆
Now upvote all my answers
 
9:43 AM
hey all
what's wrong with this line of code? The coffee still hasn't worn it's effect :(
if(data.length == 0) { return(); }
babel is throwing an unexpected token on the second =
 
9:54 AM
return() ...
also, in js, please use triple equator to perform comparisions: either === or !== because these are strict comparision operators
 
haha return() was epic
 
@AndreaBori Welcome to the JavaScript chat! Please review the room rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
10:43 AM
Hello All
Can anybody help me out in nodejs?
 
@KarelG I heard babel goes easy on that (?)
 
I don't know how practical it is but what is the most fastest way of calculating heights of components
anything better then --- $(window).height()
 
user3119231
o/
 
@Mathematics window.innerHeight
 
10:53 AM
Thanks, I have another question, wouldn't it be practical to guess height in percentage e.g. how much it will change from X to Y screen and then use that instead of keep calculating heights on window resize
if I make any sense
 
Guess?
 
@Mathematics How would that work ?
 
!!welcome AnkitaKashyap
 
@AnkitaKashyap Welcome to the JavaScript chat! Please review the room rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
if on 40 pixel screen element based on a calculation is let say 20px and on 80 pixel screen it is 40px

then would it be good practice to not use windows.innerHeight or whatever... in formula and just get screen size and calculate length

I just tried to make up a scenario in real scenario its bit complicated
 
11:02 AM
if you know how to work with those heights, would you not know how to get the % ?
@Thaenor what do you mean ?
 
@KarelG problem is in reality it's not as straight forward calculations and we might have some differences, is it considered good/bad practice though ?
 
the % is something constant ... I don't see what you're trying to do
 
@KarelG I am using SharePoint, we are waiting for SP to load master page etc.. then we are calculating height of elements which will go into SharePoint based on SharePoint's master page
this adds lots of delays
so I am trying to find some quick fix to get certain height as soon as possible
now I am not sure if I should use window.InnerHeight on the master page with some calculations instead of waiting for sharepoint
Different question, I want to get height of document as soon as possible how can I do so ?

should I add my script tag to master page in start or bottom of page or in another js file
I remember doing this before but on the master page end of html
 
11:31 AM
@rlemon @FlorianMargaine @KendallFrey you know what time it is!!!
 
@Loktar oh stop it now, old trick :P
 
Haha neat, PI powering a Nintendo Switch kiosk
 
@Loktar @FlorianMargaine @KendallFrey current status: 7am waking up in the mornin
 
/me listens again
 
11:51 AM
@Loktar @BenFortune @rlemon @KendallFrey @KarelG I finally completed my work, I feel like I have accomplished something. Thank you guys :D flyinggambit.co.nf
kisses to all
 
Flagged as malware, reported
 
Nope XD
 
@FlyingGambit neat
 
Thanks
 
@BenFortune the card scanner at my countries' bus line system uses linux :-)
one of those devices was malfunctioning and you could see linux core error message
 
12:05 PM
Hi guys is this the right place to ask an Angular 2 question?
 
!!welcome greatTeacherOnizuka
 
@greatTeacherOnizuka Welcome to the JavaScript chat! Please review the room rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
and yeah, just ask away, if someone knows Ang2 in here they might answer
 
Whats the best way to pass data between Angular2 routes ? e.g.
<h2>{{ HERE I WANT TO SHOW SOME STRING COMING FROM A CHILD ROUTE COMPONENT }}</h2>


<!-- TABS -->
	<div class="container">
		<div class="tab-navigation">
			<a class="col" [routerLink]="['approved']" routerLinkActive="active">Alink</a>
			<a class="col" [routerLink]="['access']" routerLinkActive="active">Blink</a>
			<a class="col" [routerLink]="['denied']" routerLinkActive="active">Clink</a>
			<a class="col" [routerLink]="['blacklist']" routerLinkActive="active">Dlink</a>
		</div>
	</div>
where the h2 is I want to pass some data
which comes from one of the child routes
e.g. each route will have a title property which has to be passed to the parent route (hope this makes sense)
would @output be a good solution?
 
Hey guys, anyone have any idea how to "center" the red box vertically between those 2 navbar parts? codepen.io/anon/pen/gmOJKj
 
12:18 PM
heh was going to suggest flex but you're manually positioning a lot in there
trapezoid, parallelogram heh
 
beginner :|
 
I want this script to execute as fast as possible
where should I put it ?
on top of masterpage ? just after doctype tag ?
<script type="text/javascript">
    var height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
  // create css tag
</script>
 
is the <caption> outdated? In tables?
 
not being listed as deprecated
 
anyone used the github api?
any ideas why you have to add the token part to the Authorization header?
ie "token GHJGFHJUKYY" instead of just "GHJGFHJUKYY"
 
12:36 PM
Hi, Could someone please help me with jquery file upload plugin
 
@SuperUberDuper Just because. "bearer" is also a common prefix
It's arbitrary and you can use whatever you want if you're using the header for you own authorization implementation
 
Is it possible to have an event that triggered after a file transferred to the server 100% but before server start processing the file
 
@Tarun The server might process the file before it is 100% uploaded
So, no
In general though, it is technically possible to emit and receive events
 
Hi does anyone know how to livestream a video in a webapp to an android device, I searched a lot but could not find something
 
@JohnDoe2 Then you probably haven't actually searched a lot
 
12:40 PM
Or I searched with the wrong terms:)
 
Your problem description suggests that you don't have a clue about any aspect of this problem
Which is really too little for such a project
 
2 more days left to go; others are weeping; who cares, I am smiling :)
terribly failed at writing an awesome poem ^
Everything sounds better in my mind
/me Googles for poem
 
Everything sounds better
in my mind
now I will Google
 
@OliverSalzburg thx
 
hey guys
can someone help me with domain nameserver dns record and so on? pleaaaaase
 
12:53 PM
@rlemon I can even make a dubstep out of your name
Infact I am singing it in my mind
DUB WUB WUB REAAALLY MON DUB WUB WUB ¸¸.•*¨*•♫
 
I've got my app on heroku
and my domain is from name.com
now I got from heroku the DNS target
crowdselfie.com.herokudns.com
 
hi, i have a problem:
 
wait my problem is bigger
 
@javadaskari we don't have doctors here
 
hi @javadaskari
 
12:56 PM
:-)
 
on heroku it says that the dns target is for CNAME
 
I use this code for scroll bottom of page:
function pageScroll() {
document.location.href="#bottom";
}
 
so on name.com (domain provider) I put that as CNAME
@javadaskari next
and then?
 
but i want to scroll automatically after load page
not after click a button
no
 
or just:
document.location.href="#bottom";
 
12:58 PM
1 message moved to Trash can
@PomeGranate Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
@PomeGranate no, i am use chrome
 
also not:

$(function(){
document.location.href="#bottom";

})
 
wait
 

« first day (2323 days earlier)      last day (2611 days later) »