Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 28 13:00

    dependabot[bot] on npm_and_yarn

    (compare)

  • Nov 28 13:00
    dependabot[bot] closed #468
  • Nov 28 13:00
    dependabot[bot] commented #468
  • Nov 28 13:00
    dependabot[bot] review_requested #472
  • Nov 28 13:00
    dependabot[bot] labeled #472
  • Nov 28 13:00
    dependabot[bot] opened #472
  • Nov 28 13:00

    dependabot[bot] on npm_and_yarn

    Bump rollup from 2.79.0 to 3.5.… (compare)

  • Nov 25 13:00

    dependabot[bot] on npm_and_yarn

    (compare)

  • Nov 25 13:00
    dependabot[bot] closed #454
  • Nov 25 13:00
    dependabot[bot] commented #454
  • Nov 25 13:00
    dependabot[bot] labeled #471
  • Nov 25 13:00
    dependabot[bot] review_requested #471
  • Nov 25 13:00

    dependabot[bot] on npm_and_yarn

    Bump terser from 5.15.0 to 5.16… (compare)

  • Nov 25 13:00
    dependabot[bot] opened #471
  • Nov 22 13:02

    dependabot[bot] on npm_and_yarn

    (compare)

  • Nov 22 13:02
    dependabot[bot] closed #466
  • Nov 22 13:02
    dependabot[bot] commented #466
  • Nov 22 13:02
    dependabot[bot] labeled #468
  • Nov 22 13:02
    dependabot[bot] review_requested #468
  • Nov 22 13:02

    dependabot[bot] on npm_and_yarn

    Bump rollup from 2.79.0 to 3.4.… (compare)

Mikko Ahlroth
@Nicd
just got another graph for Code::Stats frontpage done in RE:DOM
it's going to look sweet!
Juha Lindstedt
@pakastin
Cool! 🤘😎
Mikko Ahlroth
@Nicd
btw what's the changelog for 3.9.0?
there's nothing on GitHub
Juha Lindstedt
@pakastin
Oh, this: redom/redom@1b6bdd0
😄
small Router fix
However it changed the logic of router update, so that’s why it’s minor and not patch
Juha Lindstedt
@pakastin
There was a bug with setChildren + text node, which is now fixed in v3.10.3
MrSorcus
@MrSorcus
:clap:
Juha Lindstedt
@pakastin
💪
MrSorcus
@MrSorcus
Oh, i can't see this smile. Looks that i have no something fonts... SAD
Juha Lindstedt
@pakastin
Oh, it was just this https://emojipedia.org/flexed-biceps/
😄
Juha Lindstedt
@pakastin
v3.10.4 = minification with Google Closure Compiler:
https://redom.js.org/redom.min.js
MrSorcus
@MrSorcus
Sounds good :-)
Juha Lindstedt
@pakastin
Not revolutionary smaller, but I’ve always considered uglifyjs a big hacky..
redom.es.js is still minified with Butternut, because it knows how to minify modules
Google Closure Compiler made ~200% size compared to Butternut
MrSorcus
@MrSorcus
=-O
Juha Lindstedt
@pakastin
Butternut is optimized for ES6-minification, GCC is for ES5
MrSorcus
@MrSorcus
I love ES6 more than ES5. ES6 looks more humanity. :-D
GCC doesn't support ES6? I mean that works like babel?
Juha Lindstedt
@pakastin
The compression is better than Babili and closure-compiler-js (in standard compilation mode — you can get better results with Closure in advanced mode, but only by writing your code in a very particular way).
https://github.com/Rich-Harris/butternut/
Juha Lindstedt
@pakastin
MrSorcus
@MrSorcus
Cool :+1:
MrSorcus
@MrSorcus
Maybe add this code into Redom repo (examples)?
Juha Lindstedt
@pakastin
There’s not much RE:DOM in that though 😄
But yeah, maybe should..
Tomer Igal
@tomerigal
@pakastin Hi :smile: what you say about adding support for component instance creation from el function?
something in the form of el(Component, {style: { color: 'red' }});
that bring the ability to pass style and attribute with same api as any html element
Juha Lindstedt
@pakastin
That actually works already
Juha Lindstedt
@pakastin

You can also use:

el(’.parent’, parent => [
  el(’.child’)
]);

😉

Juha Lindstedt
@pakastin
Oh sorry, actually that only works in my future test branch..sorry I remembered I already added that update
I mean middleware works, however it doesn’t use the returned elements/options/text as further arguments
Tomer Igal
@tomerigal

But what about components?
Example:
RE:DOM today:

class Lightbox{
  constructor(props, ...childs){
    const style = Object.assign({color:"red"}, props.style || {});

    this.el = el("div.lightbox", {style}, childs);
  }
}

const app = () => {
  return el("div",
            new Lightbox({ style:{color:"green"} },
                         el("h2", "Lightbox h1")
                        )
         )
}

mount(document.body, app());

With el:

class Lightbox{
  constructor(props, ...childs){
    const style = Object.assign({color:"red"}, props.style || {});

    this.el = el("div.lightbox", {style}, childs);
  }
}

const app = () => {
  return el("div",
            /* new Lightbox... */ el(Lightbox, { style:{color: "green"} }, 
                el("h2", "Lightbox h1")
             )
         )
}

mount(document.body, app());
And it will give better support with the JSX transformer
Juha Lindstedt
@pakastin
I recall FRZR used to support that. I think I can add it back..
Mikko Ahlroth
@Nicd
when creating an el, I can do this: el('li', ['Some text', var, 'more text'])
can I change that dynamically? I tried with setChildren and it exploded due to call stack size exceeded
Mikko Ahlroth
@Nicd
I worked around it for now by constructing the whole element again: unmount(parent, elem); elem = el('li', this._getChildElems()); mount(parent, elem);
because if I did setChildren(elem, this.getChildElems()); it recursed forever and died
Juha Lindstedt
@pakastin
I don't quite get what do you mean?
you can also do el('li', 'Some text', var, 'more text') btw.. ;)
setChildren only allows Nodes or components as children, not Strings..
What are you trying to do?
you can do for example setChildren(elem, ['some text', var, 'more text'].map(text))..
import { text } from 'redom' I mean..
Juha Lindstedt
@pakastin
import { text } from 'redom';
...
setChildren(elem, ['some text', var, 'more text'].map(text));