« first day (2051 days earlier)      last day (3120 days later) » 

18:00
@FilipDupanović own AST? da fuck?
@bitten because not all es6 features are implemented to modern browsers yet so you have to transpile the ones that haven't.
yea, @FilipDupanović is full of shit
@bitten because brownsers don't care about the beaty of es6, so you just transpile to what works on oll the browsers you care about
the benefit is that the code YOU edit it es6. who cares what you send to the browser to ececute
you are frigging telling me webpack didn't use the standard mozilla spidermonkey AST which literally every other project uses?
@Luggage true
18:02
man, my typing sucks. I'm not gonna bother to correct all that..
it doesn't support ES6 modules, so you have to wrap it with a bunch of nonsense
@FilipDupanović github.com/babel/babel-loader <- solves all problems
it supports AMD or CommonJS modules
raw!jade-html what was the meaning behind putting ! there again?
@FilipDupanović acorn uses the standard AST...
18:02
@Luggage if you are writing ES6 code then you don't need babel
@shriek chaining two loaders. jade and raw
@FilipDupanović stop trolling
if you write ES6, you don't need Babel
loaders are equivalent to plugins?
i was also surprised that in node i had to put "use strict" erywhere
are you having a stroke?
loaders take a file and do somethign to it. It might be 'compile' it, or just return the raw contents
or a url to it
18:05
@Luggage thanks. well it seems like this is beyond what i need to do.. hehe. but interesting!
@FilipDupanović do you mean "if you write es5 you don't need babel."?
@bitten; because module spec specifies so. From what I've been reading you'll need use strict; to be able to use modules and other new things in es6
@shriek oh okay, i didn't realise it was an es6 spec
mb
@Luggage if you write, read and distribute ES6, you don't need Babel
well, when you add distribute to that statement it finally makes some sense
18:07
@FilipDupanović we were talking about client side es6, which in these cases you do?
In 2018, maybe.
i think that's where the confusion came from
gulp has a webpack plugin
webpack has a babel plugin
babel has babel-presets
babel-presets are a bunch of babel-plugins
babel-plugins are just JS code which can have dependencies of their own from npm registry
all true
s/true/mess/
18:08
a mess I am at home in
@bitten yes, I require client features that already put you way past releases that added ES6 support
@AwalGarg it's turtles all the way down.
evenin
@shriek hehe
@Luggage don't you feel webpack more configy rather than code to you? I think that's probably what bothers me the most.
18:11
^ config file matrix
you make a discworld reference to one of the people not named Luggage? :)
and lot so regexes too.
@shriek i've seen some people's config where they build that config object in a more functional way
Hmm... it is actually not that bad:
- Firefox and Edge support ES6 modules today.
- We also have AMD working since forever.
- 80% of the requests made today are made over HTTP2 where bundling is not required.
- 93% of content is served with gzip which eliminates minification needs of most projects.
- All major browsers support >80% of ES6 features as of today
Within an year or so, we can cut down most of the tooling.
but.. yes.. i'me really just registering some loaders. My code has the structure, not the config
I like gulp, too, which is all code. Both styles are OK when done well.
18:13
Yeah, true. Only reason I'd prefer gulp over npm scripts is that it's debuggable.
my webpack config is pretty ugly. You can do much simpler.
i have lots of shims and plugins
Yeah, I think the sheer amount of information in one file is a bit intimidating for beginners.
A much simple one that just sets up babel and some basics: gist.github.com/luggage66/1430db646a207427ee2a71172226db4b
@Luggage and therein lies the problem with Webpack, because you can't write ES6 and distribute ES6; in at least, you need Babel to transform ES6 modules to CommonJS modules and that just gives to wonderful lines like these babeljs.io/docs/plugins/transform-es2015-modules-commonjs
sure you can, just use babel.
if you don't tell it to make es5, it won't
18:16
@shriek shear amount of information, that you have to sift through to start using gulp/grunt/webpack/anything_else, is intimidating even for professionals
@tereško yup I'm not arguing on that but separating concerns will actually help you go through the code better and understand what's happening.
sorry, I fail to see the immediate connection here
Also, just putting it out there, there's github.com/AgentME/browserify-hmr for browserify users too.
18:19
build systems are NOT about "separating concerns"
So just throw everything in one file and call it a day?
I think you dont really know what "separating concerns" means
separation of concerns is a more sophisticated topic than just using a tool to concatenate multiple files.
yeah so sophisticated there is a wiki page abo... nvm.
18:21
@AwalGarg you seem more drunk
wish I was
well .. I am out of wine now
time to install windows and write javascript
only to see the bsod tomorrow
first I have to figure out if even have a bootable usb stick
I have heard windows' new bsod screen is prettier with big blue squares?
18:24
@Luggage I'd like to try something with less plumbing, for development
@AwalGarg as in opposite to a single blue square?
@tereško yeah
tiles or whatever they call it now
just find a nice minimal boilerplate and fork.
It rarely bkue screens anymore..
... she said
nothing too complex that you couldn't dig through and understand it if you had to
18:26
@tereško I was using that term loosely. Organizing is what I should have went with.
But it still sucks. Even more so now
you can't take all the plumbing away from Webpack
@littlepootis yeah why show pretty things to the user.
Time to slep im dying bye
for once, i agree with @FilipDupanović
18:27
Also, @Luggage where are the input and output for css in gist.github.com/luggage66/1430db646a207427ee2a71172226db4b
Webpack feels like you have to go from C -> LLVM -> asm.js
@shriek I just put this in my code:
import style from './style.main.scss';
Good heavens.
and the loaders, loaders: ["style", "css", "sass"] do three things: turn scss into css, resolve reference in css to other files, and then load the styl into the page
it's so intoxicating, but yeah, once you put that in you have to use Webpack
18:29
You need js to use css now?
so I chose that behavior
@shriek it's richer than that
you don't need, no, you can tell webpag to just returna url instead
and then just in your html: <link rel="./style.main.scss" /> or however you do that
Ahh. Okay, so not losing faith on this yet.
Is it faith or fate?
It's faith.
you choose how you want the resolve a refernce to a css file depending on how you wan tto write your code
18:31
"hope"
me.. I stay in all JS, now. no more html
That's the one thing I can do away with.
but webpack can do the same task for html files
you'll need an html-loader, i believe
I'm actually looking forward for postcss.
In that case having css in js would make sense.
But not importing straight up css.
when i import it, it just, live, makes a <link> element int he ead and load it that way
the css is a dependency for my app startup, just like other JS is.
again, because I configured it that way, the "style" loader mentioned on line 18
i could, say, use raw-loader and get a string containing the css, or the file-loader and have the css placed in the output folder and a url returned. Then I could use it in an html template.
18:35
Okay, what's raw-loader again. Wasn't there raw loader for jade too?
Is it like source-maps?
import someTemplate from './someTemplate.jade'; // raw-loader makes this return a string variable with the html in it.
and jade-html-loader makes turns .jade into html
read .jade file -> transform to html -> return as a string. that's "raw!jade-html"
Oh..so sort of like stringifying -> parse -> transform -> output.
well, if you know gulp, it's like piping through mutliple transforms, i guess
well, not really..
"raw!jade-html" I keep reading that as raw, (not) jade-html.
Bad choice of symbol there.
it could have been loaders: [ "raw", "jade-html" ], i think
they used it because it's url-like. ? for options, etc
and ! was free to use.. i guess
18:40
See, that makes more sense..then I can think of it iterating through array and transforming.
the reason the string form is allowed, it you can use it in code to apply more loaders:
import x from 'raw!./myModule.js'; //will return the text of the file instead of the  executed code
loaders: ['raw', 'jade-html'], loader: ['raw-loader', 'jade-html-loader'], loaders: 'raw!jade-html or loaders: 'raw-loader!jade-html-loader'
ohai room o/
howdy
and you can do it straight up in you modules and inline the loaders using special Webpack syntax!
18:43
indeed.
it makes food taste better.
I see. So, if I were to move away from webpack to other build tools then I'd have to modify my code, right?
although, Webpack loader syntax shouldn't be inlined, it's even officially discouraged methinks, because otherwise you're totally stuck with having to use Webpack to compile your sources
@FilipDupanović you just answered my question.
or my doubt rather..okay, no inlining then.
you may need a little modifying, but webpack helps you keep clean JS files so..
my use of import style from './style.css'; would be one of thing I may need to refactor if I left webpack
but I don't think that's a big deal.
yeah, just gotta make sure that small thing here and there don't pile up to be big ones.
18:47
keep them in a few files only.
files dealing with app start-up or resource access
I need to get some food before I starve to death.
When I encounter one of the choices I wonder if I will regret, I just contain it. It's been easy to re-do it later if and when I decide to
rgr
Do chat bookmarks load for you people?
Not the overview, but bookmark detail pages
@PeeHaa no. I get the issue page with a cat debugging it. so it should be fixed soon
Yeah same here. Asshole cat screwing up the site
19:03
@Luggage no, you don't need to do that, I think
is anyone else here using SASS?
!!google webpack
no @CapricaSix?
@PeeHaa you are about week behind me
╯°□°)╯┻━┻
19:06
!!help
@PeeHaa Information on interacting with me can be found at this page
also, I scared up more wine
@PeeHaa cap's here, but google command (and many other ones based on it) would not work anymore
@tereško Oh :P
can anyone recommend a small, basic, non spec es6 map implementation?
19:06
@AwalGarg Why not?
@AwalGarg WTF. There is was an API???
@PeeHaa how do you think all irc bots worked? they all have stopped working too now, btw.
the day it happened, pretty much every channel on freenode's and oftc's top 10 had a user complaining about their bot not working every 10 minutes
19:08
Real men don't use APis. They parse HTML!
yeah, some irc bots are doing that too now. it is difficult for cap because she runs in the browser with SOP
oh lol. Seems like we've made a good call :P
@AwalGarg Oh right. She still not headless :(
@Mosho npmjs.com/browse/keyword/lodash-modularized Lodash per-method packages
@FizzyTea I recently submitted a pull request to a project with no tests. My pull request was an empty tests directory and when he asked what that was for, and I said 'tests'. "But there's no tests?" "So write them?" ....merged, but still hasn't written any...
@PeeHaa who had thought PHP would do something better than JS :P
19:09
@Luggage lodash doesn't have a Map implementation
reactjs is not compatible with windows phone
I thought somebody was working on it a while back?
hehe @AwalGarg
what? I assumed it would..
it renders fucking nothing
@Victor windows phone is dead anyways
19:10
@PeeHaa I was. then I lost motivation. It is still there if you wanna take it forward
not in romania
aparrently
@Victor that... shouldn't be React
sorry?
19:10
@Luggage he is talking about the map data structure, not FP's map
ohhhhh
@FilipDupanović ?
@Mosho why non-spec and why not write your own? (assuming you don't need week refs support)
@AwalGarg Neh was tempted at some point, but then decided to do it in php from scratch instead
NIH FTW!
19:12
@Mosho in that case, core-js has a Map implementation, that you can include standalone: github.com/zloirock/core-js
quite small
and it's what babel uses
@Victor most likely you threw some exception while rendering the main component and your seeing a white screen or something
@PeeHaa that's much better because you got to play with amphp and we have an example PHP7 async-ish codebase now :)
@Victor you need to connect it to a debugger and inspect the error
@FilipDupanović I am seeing a white screen, but it works on every other phone I have (iphone, android)
I should get something like this to keep my passwords in:
19:14
@AwalGarg True. It was/is a great test bed for async/amp php stuff.
.. but with a better picture
@Victor it's not React.js, it's probably your code that's not compatible with the client on Windows Phone
@FilipDupanović oh I get it now
I don't even think I can debug something with internet explorer on windows phone...
@Victor i.e. call Object.assign() anywhere in your component tree and you will break the rendering on some releases
omg really?
that's what I'm doing all over the place
19:16
?
maybe, I'm not familiar how MS releases the client for Windows Phone, that was just an example
I will get a polyfill
but I still have to refactor all my code, because the polyfill does not define the assign method in the Object's prototype
if you use Babel, then there is a transform plugin
I use babel, yeah
tell me
19:20
wish me luck
the babel es6 preset + babel-runtime for the polyfills will do it all.
{
    "presets": [ "es2015" ],
    "plugins": [ "transform-runtime" ]
}
really? let me check that
just es2015 preset will..
Yup.
Been doing it for years
19:22
can you please inspect the list of plugins and tell me where do you see transform-object-assign?
tht object.assign transform is an alternative to es6.
@Luggage for the past year
object.assign is art of es6 and it's in the es6 preset. it work. i use it.
because that's probably around last summer when Object.assign landed into the clients you use, so you didn't notice that it's not getting transformed in your output
Nope.
I support back to IE9
19:23
hahahahahahahahahaha
oh sorry:P
FWIW at least you event list was very useful @AwalGarg
@Luggage we can confirm quickly that, by default, Babel does nothing to transform Object.assign
@PeeHaa sure thing. It has proved to be useful in some of my userscripts and the chat client I am writing as well. almost comes at the top of my browsing history going to github
please tell me what buttons you managed to push to get it transformed
why would use a compile time transform for object.assign if it could be polyfilled?
now THAT is what the transform-runtime does
19:27
babel doesn't really care about runtime perf as much as it does for spec compliance and good looking code
@FilipDupanović babel-runtime supplies the polyfil and that's not an optin there
But you are right, it's not part of the es2015 preset.
though we usually set {polyfill: false} on transform-runtime because Babel doesn't do feature checks
@FilipDupanović imgur.com/zbNATr8.png
babel-runtime is the key.
the reason you'd want transform-runtime today is because your client doesn't support generators or you want to use ES7 async/await
or in may case, polyfills for Ie9
19:31
mmh, it's not just olden IE
@FilipDupanović DUDE, YOU'RE A GENIUS
the last FF long-term support release which ended this month didn't have Object.assign() either and it's the FF version you get pre-installed in some environments for headless testing
that was the problem and it works with the babel plugin now
@Victor for telling you to connect your phone with a debugger?
nope. for telling me about object.assign
it was the problem. unfortunately, as I though, the debugging on wp8 and ie is a pain in the ass
19:37
how does encapsulation improve testability in javascript?
tough question
@ray9209 confines the scope of a piece of code. it is obvious which functions change state, interface to it is obvious, easy to make sure every function works without missing things
if you go all the way, you can provide hook points to plug in mocks, for testing network errors etc
it is less obvious where to put that with a bunch of scattered code
@doug65536 have a link to a blog post/article that explains it more thoroughly with examples?
Software testability is the degree to which a software artifact (i.e. a software system, software module, requirements- or design document) supports testing in a given test context. If the testability of the software artifact is high, then finding faults in the system (if it has any) by means of testing is easier. Testability is not an intrinsic property of a software artifact and can not be measured directly (such as software size). Instead testability is an extrinsic property which results from interdependency of the software to be tested and the test goals, test methods used, and test resources...
In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A programmer typically creates a mock object to test the behavior of some other object, in much the same way that a car designer uses a crash test dummy to simulate the dynamic behavior of a human in vehicle impacts. == Reasons for use == In a unit test, mock objects can simulate the behavior of complex, real objects and are therefore useful when a real object is impractical or impossible to incorporate into a unit test. If an actual object has any of the followin...
you're a mock object.
19:44
so, for example, a highly testable piece of code that does ajax requests could have a hook point where you can plugin a mock network layer, and feed it errors etc. you tell the mock what to simulate and it makes that happen
then a unit test can make sure the error is handled correctly
(^not to argue the point, but I think we should use service workers for that today)
you're a service worker. :)
there are lots of ways to implement it. general idea is having ways of forcing errors to happen to verify all the paths that never happen. that is testability
encapsulation helps because the code is grouped together and it is more obvious how to test it. encapsulation is not required for testability
you want tests that do one tiny little thing. the less a test does, the better. encapsulation helps make it possible to do that
@doug65536 agreed! it's about using all the available namespacing and reuse tools to maintain sanity in the codebase
you dont have to fire up some giant bunch of dependencies
dependencies are unavoidable, so fully testable code will provide a way to plug in "fake" dependencies (mocks)
you don't have to go all out like that though. if you just have unit tests, that is vastly better than nothing
if you can afford it, it is luxurious to have mocks and all that. you can work on the code with high confidence that the tests are thorough
it is so nice to touch code, run tests, get failure in highly focused test, bug becomes totally obvious, fix is instant, done
20:05
I prefer my 'deploy', go to lunch, check voicemail process.
@doug65536 or generally speaking, if other circumstances haven't forced you to externalize static dependencies to make them configurable, tests sure will
1 message moved to Trash can
@ray9209 Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
:30829527 for example, if you have an object with a getData function that uses ajax i.e.

var App = {
...
getData: function(options) {
    var ajax = options.ajax || $.ajax;
    ajax({url: ......});
},
...
};

you can do tests with a mock ajax function that you can send in the options parameter allowing you to do tests without bothering the server?
you can come up with some simple problematic examples
ok, great...
who's next? Stalin, bro, u there?
20:35
@towc LOL
dying here
:))))
Ekn
Ekn
lol
@ray9209 foo () { return self.indexedDB.open('mydb', 1); } is problematic in so many ways: the dependency won't be available all on platforms, yet you can't substitute it; the connection parameters are static, so if you develop and test on the same host you'll taint the database; 1 here seems to re-define a value that exists elsewhere, so now you have to remember to update it in two places
user4584267
Hey can someone help me fix a little issue with my code
@Tobi 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.
@taco It's a start!
@Tobi no
user4584267
LOL.
user4584267
21:15
Succint
user4584267
i luve it m9
user4584267
Ok so basically im making this script to record mouse movements
:p
user4584267
A date is create on first move
user4584267
and subsequent moves are recorded with the time passed from the start date
user4584267
21:17
i want gaps larger than 3 seconds, between mouse moves, to be reduced to 3 seconds.
user4584267
so if the user stops moving for an hour the review doesnt last an hour, but 4 seconds or so.
user4584267
its kinda complicated
user4584267
its like
user4584267
its in JS
user4584267
start = new Date()
user4584267
21:18
last-move = (new Date()-start)
user4584267
then i tried to add some logic
user4584267
if(new Date()-s-l > 3000){
return l+=3000;
}
user4584267
if(new Date()-start-last_move > 3000){
return l+=3000;
}
user4584267
but then
user4584267
it jumps straight up
user4584267
21:20
in steps of 3000
user4584267
it doesnt take off 3000
user4584267
milliseconds
user4584267
i tried
Try writing in a complete sentence. I can't read that mess.
user4584267
s = new Date()-l
user4584267
21:21
this is d intnet ma9
user4584267
start = new Date() - last_move
user4584267
god im so confused.
no wonder.
user4584267
Does anyone get what im trying to get at.
user4584267
Ok ill rephrase
user4584267
21:24
The script records mouse moves and places into object with millisecond timing, and mouse co-ordinates.
user4584267
in the format {"200-m":[100,300]}
I don't think you can subtract dates directly like that.
user4584267
you can
user4584267
try
user4584267
n = new Date()
user4584267
21:26
then say "new Date() - n " and u will get the time passed since that date
user4584267
Well; thanks for the help!
user4584267
I realllly wanted to push this project to my portfolio
user4584267
its my first PHP one
user4584267
and i submitted my Portfolio to a bunch of employers
21:32
var movements = [
    { time: new Date(), coords: [0, 0] }
];
function recordMovement(coords) {
    var lastMovement = movements[movements.length - 1];
    movements.push({
        time: Math.max(new Date() - lastMovement.time, 3000),
        coords: coords
    });
}
like that?
that stores time offsets.. or.. something. not sure, I didn't really test
er.. no..
var movements = [
    { realTime: new Date(), timeOffset: 0, coords: [0, 0] }
];
function recordMovement(coords) {
    var lastMovement = movements[movements.length - 1];
    movements.push({
        realTime: new Date(),
        timeOffset: Math.min(new Date() - lastMovement.realTime, 3000),
        coords: coords
    });
}
Math.min
right
user4584267
what does that do
user4584267
annotate
no one can ever know..
21:49
I have one crazy pink strawberry flower
You keep your plants in a cage? You make me sick.
:) I can show you more
user4584267
can u post that on here
22:15
@rlemon That's not very dank
22:26
@rlemon inb4 white strawberry
22:43
I'm building a bench. I love having a garage and tools.
How long ago did you make it @rlemon
The bench?
the flower bed
Started a few hours ago. Would be done already but finishing nail gun died.
Ahh. Those strawberry's started from small $1 plants. Built that planter last weekend.
They've done well since
or garden bed. whateva. Make sure to use screws not nails. It'll probably swell
22:45
That isn't my main garden. Hold on.
o
@rlemon are you a hobbit
Do you have a hobbit pipe and plant all day
Baking soda. I got baking soda
are programmers knowledge workers or white-collar workers?
@rlemon is this yours?
I just found out aromatics like catnip keep mosquitos away, plus it'll keep my cats away from the other plant beds (supposedly)
22:52
these are really nice rlemon
really adds to my want of a garden
Momocon is intown. Saw Luigi earlier with a big tittied Koopa :|
That tomato plant is called Super Girl :d

« first day (2051 days earlier)      last day (3120 days later) »