These are chat archives for mithriljs/mithril.js

4th
Sep 2019
Oscar
@osban
Sep 04 2019 08:41 UTC
@Brianhasagithub just the mapping doesn't require keys
Oscar
@osban
Sep 04 2019 08:52 UTC
@Brianhasagithub I'm thinking about something like this
Isiah Meadows
@isiahmeadows
Sep 04 2019 14:47 UTC
@CarlMungazi In case for whatever reason, someone (even if it's TC39) adds a property that starts with on, like maybe onto or something.
Carl Mungazi
@CarlMungazi
Sep 04 2019 15:50 UTC
@isiahmeadows so it guards against a third party adding property such as onsubmit or onclick to Object.prototype?
Isiah Meadows
@isiahmeadows
Sep 04 2019 15:53 UTC
Correct.
It also gives a more appropriate hint to engines.
They optimize for Object.create(null) differently.
Specifically, they avoid optimizing for shape. This matters since Mithril's source is highly polymorphic and it would result in unwanted bailouts in hot paths.
If I used something optimized for static structure like {}, that is.
Isiah Meadows
@isiahmeadows
Sep 04 2019 15:59 UTC
It's counterintuitive, but yes, it actually matters.
Carl Mungazi
@CarlMungazi
Sep 04 2019 16:17 UTC
Interesting. I’m currently doing a project where I am rebuilding parts of the frontend stack (UI framework, test library, module bundler) and I was trying to figure out how to attach events to DOM elements. Keep coming back to check Mithril’s source.
Brian Nguyen
@Brianhasagithub
Sep 04 2019 17:38 UTC

Has anybody run into an issue with TypeError: null is not an object (evaluating 'node.parentNode') ONLY on safari or iOS browsers?

I don't get that issue on chrome

Isiah Meadows
@isiahmeadows
Sep 04 2019 17:48 UTC
Could you put together a repro and file an issue? I have a Mac and an iOS device to test it on and potentially debug myself.
@Brianhasagithub :arrow_up:
Brian Nguyen
@Brianhasagithub
Sep 04 2019 17:48 UTC
gotchya ty
Isiah Meadows
@isiahmeadows
Sep 04 2019 17:48 UTC
:+1:
Oscar
@osban
Sep 04 2019 17:49 UTC
@Brianhasagithub did you see my earlier example?
Brian Nguyen
@Brianhasagithub
Sep 04 2019 17:49 UTC
I'm starting to believe it's not a mithril redraw thing and it's actually using onchange vs oninput for the input components
@osban Yes! Thank you but turns out that I need them all to have keys but got it working
since it's dynamically changing
Isiah Meadows
@isiahmeadows
Sep 04 2019 17:50 UTC
@Brianhasagithub What version are you running on?
Brian Nguyen
@Brianhasagithub
Sep 04 2019 17:50 UTC
1.16
Isiah Meadows
@isiahmeadows
Sep 04 2019 17:50 UTC
v2 checks the invariant that v1 had mostly implicit.
Brian Nguyen
@Brianhasagithub
Sep 04 2019 17:51 UTC
Noticed that in the release notes
I wish I could upgrade our version but it actually breaks our code
because of all the bad practice things that exists
Isiah Meadows
@isiahmeadows
Sep 04 2019 17:51 UTC
Oh, fair.
Oscar
@osban
Sep 04 2019 17:53 UTC
@Brianhasagithub :+1:
Brian Nguyen
@Brianhasagithub
Sep 04 2019 17:53 UTC
Thanks for the help though!
Oscar
@osban
Sep 04 2019 17:53 UTC
you're welcome :slight_smile:
Isiah Meadows
@isiahmeadows
Sep 04 2019 17:56 UTC

@Brianhasagithub BTW, you could start migrating some of that by downloading v2 as a separate module (like adding "mithril-v2": "npm:mithril@2.0.4" as a dependency) and migrating to its hyperscript, creating a wrapper that's basically this:

var v2 = require("mithril-v2")
module.exports = function m() {
    var vnode = v2.apply(undefined, arguments)
    // Re-add an internal property removed in v2
    vnode._state = undefined
    return vnode
}

That could get you the checking half, so you can phase it in incrementally.

Barney Carroll
@barneycarroll
Sep 04 2019 19:24 UTC

hmm.. on a quick glance it seems very computer sciency in the ember way..

This exactly. It's like a really crap version of @JAForbes stags

@panoply

Just had a 20 minute conversation with a potential client who wanted a React application purely based on the fact it's a "Facebook product" – Interestingly this individual knew nothing about tech. They founded a fashion brand (rather successful one too if you know clothing). When I queried as to how they had heard of React (before declining the project) they told me that they had read about it on a tech website. My ears spiked when they told me this and asked if they often read tech websites....

"Oh not at all, just an article I found on Facebook"

LOL truth

Barney Carroll
@barneycarroll
Sep 04 2019 19:33 UTC
Regarding Statex, I can completely understand the desire for this in the public domain and I am glad of it.
Isiah Meadows
@isiahmeadows
Sep 04 2019 19:34 UTC
@panoply :grimacing: re: React story
Barney Carroll
@barneycarroll
Sep 04 2019 19:34 UTC
It's a switch up from the idea that switch case statements and stores are an extensible system for state development
@isiahmeadows you're a hero for maintaining and developing Mithril
Brian Nguyen
@Brianhasagithub
Sep 04 2019 19:36 UTC
@isiahmeadows that's a great recommendation!
@isiahmeadows Thank you <3
Isiah Meadows
@isiahmeadows
Sep 04 2019 19:42 UTC
Welcome!
And thanks @barneycarroll!
Barney Carroll
@barneycarroll
Sep 04 2019 19:44 UTC
In light of recent Facebook politics it's very gratifying to be part of a community that always strives for better in ways that corporate ownership can't screw
Brian Nguyen
@Brianhasagithub
Sep 04 2019 19:45 UTC
Do any of you have suggestions on how I can easily keep track of how many mithril nodes/elements I'm creating/destroying or have at any point in time? It would be awesome to see these things but at the moment, I'm not sure how
Barney Carroll
@barneycarroll
Sep 04 2019 19:50 UTC
I like the idea @Brianhasagithub
Brian Nguyen
@Brianhasagithub
Sep 04 2019 19:57 UTC
Screen Shot 2019-09-04 at 12.56.42 PM.png
I know that chrome console tools has something that is kinda in the same spirit as what I wanted for mithril.
It's under performance monitoring