Live data from Hacker News

RE:DOM – Tiny DOM library

redom.js.org

81–84 of 84 posts

Re: RE:DOM – Tiny DOM library

#81

Let's see: website consists in its entirety of two not-very-illuminating code samples. The documentation on github consists of the phrase "Documentation is a bit lacking yet, please check out the source for now." I feel like at this point, when there are so many, so so many, javascript frameworks to choose from, if you're going to build yet another one you need to take the time to explain why it exists. What are the…

To be honest, I just wanted feedback about the experimental approach.. It's only version 0.0.x

Re: RE:DOM – Tiny DOM library

#82

Earlier quoted context omitted.

Toggling visibility (and other stuff) is best done by changing classes on the element.

I think you should consider the trade-off. If you toggle visibility with CSS, you still have to put everything in the DOM. Sometimes, putting things in DOM can be very expensive. Consider a date picker, a fairly complicated thing with many sub-elements. If you have to put thousands of date pickers in the dom, that's going to take a lot of time. Especially if the user only sees one if they click on an event to edit it…

Why not create one and move it around as necessary? I'm pretty sure that's what most date picker libraries do. Although you'd probably be moving it's location with js.

Re: RE:DOM – Tiny DOM library

#83
post #29

Earlier quoted context omitted.

el.email = Object.assign(document.createElement('input'),{type:'email'});

el.email = { document.createElement('input'), ...{ type: 'email' }}

I know about the spread operator, but I'm pretty sure that's invalid. `var foo = { document.createElement('input') };` doesn't work, spread or no spread after it.

Re: RE:DOM – Tiny DOM library

#84
post #83

Earlier quoted context omitted.

el.email = { document.createElement('input'), ...{ type: 'email' }}

I know about the spread operator, but I'm pretty sure that's invalid. `var foo = { document.createElement('input') };` doesn't work, spread or no spread after it.

Ow man.. I saw the Object.assign example and thought i don't like it because it requires an extra polyfill. I can just use a spread and let babel handle it.

If anything it should be `var email = {...document.createElement('input'), type: 'email'}`

But that would result in `Object.assign({}, document.createElement('input'), { type: 'email' })`

Got 4 up votes though..

Post reply on HN