« first day (2614 days earlier)      last day (2559 days later) » 

21:00
a regular map has a key (let's assume string) and value, it hols a reference to the value to ensure .get(key) returns the same thing every time, preventing the value from being garbage collected.
and some more entries in the same way.., you either have to manually delete all entries or wait until "someObject" gets dereferenced?
a weak map has a key and value, but it does not hold a reference, so the collector can take the value away from it. Thus, .get and friends may not return the same thing every time, and you can't enumerate references that may have been collected.
what are you saying? In the above example, it will always return <hugeDataBlock> on WM.get( someObject )
thinking about it, plotting it at (0,0) is basically the only thing that makes sense
21:02
as that is the origin of all those vectors
I'm just watching some memory allocation timelines of my code and it seems some memory doesn't get released properly. Not sure if this timeline works properly with WeakMaps or if there is really a problem
unless the leaking objects are keys, the weak map can't cause leaks
it exists to prevent them
the collector is also smart enough to handle loops, afaik, so items in the map referring to each other should be collected as well
if you go like WM = null you should definitely be on the save side?
and as it looks like... hls.js is leaking mem too like a lot @BenjaminGruenbaum Just watching the Chrome allocation timeline, if you playback a hls video, the colored blue lines never disappear
@ndugger LibElement needs to be a valid constructor, so you need to register it first
then you can inherit from it from the proxy
@rlemon unfortunately, that created a <lib-element/> element instead of a <my-element>
which is not the desired behaviour
I'll look at the Q you linked
21:15
but then again... running facebook, yahoo, google and anything... if I can trust that Chrome memory allocation timeline... EVERYTHING leaks AF
wth Chrome, either everybody sucks or the tool is way off
why not <cons-element/>
I'd really prefer somehow browsers become aware enoguh to do
class SomeElement extends HTMLElement {
}
something.register('custom-element', SomeElement);
would actually work :P
@ShrekOverflow Actually, exactly that does work
@ShrekOverflow window.customElements.define('custom-element', SomeElement)
That's exactly how you define a web component
21:22
@MadaraUchiha if you're up for a challenge stackoverflow.com/questions/47779762/…
I don't really understand the advantage of a proxy (which can't be polyfilled, by the way) over a decorator.
Or, for that matter, a base CustomComponent whose constructor registers it
I'm just trying to eliminate the need to write @Component.register over every component's class that you write
How about
@MadaraUchiha but custom elements need to extends HTMLElement, and you cannot construct them until they've been added to the registry
Aha, I see what you mean.
21:25
Which is where Proxy makes a lot of sense, but it breaks the chain of inheritance
and I don't know how to make it "resume" the extension of the base classes
so to speak
maybe you just can't
I don't know yet
Not with that attitude
I just wrote a very ugly CSS selector. Oh god.

.task-picker__task:hover .task-picker__task-name::after {
Well, for starters, you don't really need to pass the name
You have component.name as component is a function.
to the decorator, that is.
I wouldn't get caught up on that part. I just did that as an example
21:30
Perhaps @Zirak knows
The more arcane parts of JS are his forte
I pinged @BenjaminGruenbaum earlier, but no word from him either
Ping me in 2 days if it doesn't get a satisfactory answer, I'll put a bounty on it.
I never thought I'd live to see a funny article from my area loudountimes.com/news/article/…
A really interesting question with some actual JS for once, can't have it go unanswered :)
I was gonna put a bounty on it, and Jordan said he was too, lol
We'll have like a 1000 pt bounty on it, boiiisss
21:31
@MadaraUchiha whoa i ahve been living under a rock
@ShrekOverflow Look at his example implementation with the decorator
That's exactly what it does, it takes the element and registers it
@MadaraUchiha I think I can greatly simplify the Q... I don't think the question is custom element specific. I think it's actually just proxying a class while maintaining the chain of inheritance... I'll play around more
I'm sure you could do some magic solution
But it won't be pretty.
I'll be ok with a magic solution, as long as it works
Create a proxy on which you set all of your custom elements
Upon set it registers the element
21:34
It still needs to extend HTMLElement, though
What, the proxy? No it wouldn't.
You don't override get, so you would still get the proper constructor from myProxy.SomeCustomElement
I guess I'm not understanding what you're saying, then
one moment
whip up a babel transform that adds that decorator and just apply it to that folder
k bae
21:37
-4
Q: Cannot get pass by I am not Robot captcha on Craigslist

badddetI am trying to find contractors for our management company and I am always looking to Craigslist. The problem started 2 days ago wherein I can't get pass by the I am not robot captcha! I tried everything, clearing cookies, reinstalling chrome, restarting our router and renew/release IP. I'm just ...

lol
pitiful
google captchas can be hard to beat
my vaping santa sweater was just shipped, yo
@SterlingArcher
some of those pictures hide cars/street signs really well
We're just doing their classification for them
21:41
@MadaraUchiha I think someone answered with a working answer! HYPE! I'm gonna test it out
Diablo2 ladder reset in a couple of hours, I'm so going to play it! Yay... being hyped for a 20 years old game, priceless!
import { kebabCase } from 'lodash';

const magic = new Proxy({}, {
    set(target, key: string, value: { new(): HTMLElement }) {
        const elementName = kebabCase(key);
        if (window.customElements.get(elementName)) return false; // already registered.
        window.customElements.define(elementName, value);
        return true;
    }
});

magic.MyElement = class MyElement extends HTMLElement {

}
@ndugger Something like this (untested)
It's TS to help me with typing it, but you can ignore the type definitions.
heh, you kebab case your type names too?
Ah, I see what you're saying. I don't think that has much different from the decorator route, though
@jAndy did they change anything?
21:43
there's no Diablo II outside of medianXL
@ndugger To be perfectly fair, I personally prefer the decorator route
It's much more explicit and much less magical.
@Shmiddty well, they in fact put some effort into cheat protecting and detecting 3rd party applications again, so it should be more fun to play without botting
@MadaraUchiha that's perfectly fair. Some dude did figure it out for me, though
It uses the Reflect object
Ah, using Reflect
which is what I started off today in chat with
I thought that was the solution, I just didn't know how to use it or of it had value
21:45
I suspect that's the answer you would have gotten from Zirak
Probably
Zirak can't reflect, he is a vampire
First off, upvotes. Kudos for the 129 rep user who answered that so well
That's impossible he loves goats
Everybody knows vampires hate goats
Chuck Norris doesn't reflect either, the mirror is just unable to create a copy
21:46
do... they?
are you sure that's not garlic?
maybe this 129 rep users wants to join us in chat and learn to hate us?
@Gheljenor well done man
@MadaraUchiha Right. I'm shocked to see a low rep user have a grasp on advanced topics. He must just be late to the SO party
tons of library devs don't have time for SO
Hey can you help me testing with enzyme?
I am getting this error: "Enzyme Internal Error: unknown composite type undefined"
21:48
@ndugger Dude's a member for 4 years
And has only 4 answers :D
Ha
I feel #blessed
Plot twist: it's Tobiq
Super genius hiding his talents
@SterlingArcher Heh, I doubt they have the mental faculties to write such coherent English, let alone JavaScript.
21:49
I think I need to give him a post-answer bounty
Oh damn, a mod burn. Those are rare
We try not to take sides.
@ndugger looks like I'm late
But when users try very hard to make us, we do.
21:50
@MadaraUchiha where do I rank on the mods "most desired" list
If I'm anything but #1 I will flip shit
honorable mention
@ndugger which browsers/platforms do support Reflect and window.customElements?
@SterlingArcher Definitely in the mods' "Dudes with most glorious beards" top 3
Top 3?! TOP 3?!?!
@jAndy I think just Chrome right now
21:51
!!riot
╯°□°)╯┻━┻
I mean I can check that myself, I just want to know it that is like production ready
!!afk poop
Only if you're supporting Chrome
@jAndy Chrome and Safari, pretty much
21:52
I wouldn't use Reflect outside of v8
it's great on node stuff, server-side where DI et al really shine
I think the advent of both React and Angular kind of slowed the adoption rate for web components
Which is a darn shame because I think they're the way to go.
The only way to do anything useful with React is to pretty much use what amounts to global variables
Or write your own fairly complicated architecture around it.
Having said that, I love React. I think it's great.
signs in relief
It's just that data/state management with the constraints React imposes isn't a solved problem yet.
that sounds contrary
Can anybody help me with enzyme for react?
21:55
It's worth noting that before React/Angular we also didn't have much to show for in terms of architecture for the web.
we were still denying MVC
@Luggage I'm picturing a deaf person just after being narrowly missed by a bus.
4 versions of jQuery and 20 jQuery plugins on the page...
damnit, I didn't notice I mistyped until now
@ssube That we are.
21:56
if this printer doesn't go faster I might have to sub-contract with Loktar
Until someone invents a new buzzword that basically means MVC except without saying it's MVC
I'm telling you, we should totally write an opinionated library, and call it react-framework
Insta-popularity
Prototype / Renderer / Logic, PRL
Especially if we call the GitHub Team "ReactGurus" or something
21:57
nah, it needs to be something more startupy
that sounds like an old java website
Not to mention w3schools which I'm not even going to link here
people use react-router in spite of reacttraining.
If you appear official, people automagically flock to you
Reactular: Who got framework in my view library?
Hence, react-framework
21:59
I don't use it. I use my redshirt router and a couple of util methods for pushing to history, etc
"Yeah, it's the framework for React, haven't you heard?"
I'm in
I assume it's TS, React, MobX, etc
@ndugger Honestly, a router isn't something you want to implement yourself.
It's just not. There are a ton of things to consider
Fuck it, go full Meteor
Asteroid

« first day (2614 days earlier)      last day (2559 days later) »