Live data from Hacker News

Microsoft Fast Design

fast.design

191–200 of 216 posts

Re: Microsoft Fast Design

#191
Does FAST checkbox component have some sort of delay built in?

Compared to regular vanilla checkbox it seems to respond slower(100-200ms delay perhaps).

This is on slowish 4G connection but that shouldn't matter.

Re: Microsoft Fast Design

#194
For a non developer like me,

Is it any different from Ant Design (https://ant.design/)?

Also, almost every company I worked with (> 500 employees), eventually built their own UI components. And in every company, developers seldom use these, always customize or use something else.

Which brings the question - Why do we invest (internally) and open source components? Whats the value?

Re: Microsoft Fast Design

#197
post #97
post #74

Have >3 years of experience working with web components full time. 1) Their templating library has a learning curve. It's not quite like svelte, nor like JSX. If you have templates as strings that aren't typechecked, it makes it really hard to work on large code bases where the components are built by someone else and you're the consumer. I remember breaking powerbi.com due to missing > in an angular template that en…

> the 3rd big gotcha of web components. Attributes are strings. You have to serialize and deserialize from strings. Sure you can listen to when they change via attributeChangedCallback and get immutability for free because of serialization, but that comes at a perf cost. for deeply nested objects, you have to serialize and deserialize from json. In practice, most libraries built around web components only use attribu…

Yep that’s why said it’s a gotcha. As a team you have to decide the attribute/prop tradeoff and stick to it in a consistent way.

By using attrs, they show up in dom explorer, so it’s neat, don’t need another devtool. attributeChangedCallback will only be called when the attribute changes.

For props, it’s a bit more work since HTMLElement itself has a ton of built in props, using a setter means anytime something sets, it will he called, even if the property value isn’t different. the worst thing is when you end up overriding an internal prop and weird things happen.

Re: Microsoft Fast Design

#198

Earlier quoted context omitted.

That's just an illustration of how it can be done otherwise. The only non-standard thing there is that CSS glue construct: selector { aspect: Func url(script.js); } It tells that as soon as element matching that selector will appear in the DOM it will have Func() called (from script.js). No complex abstractions are required. "to share internal web component libraries within my own company, never mind some other 3rd p…

I meant creating a web component based widget library and sharing that for use on anything from desktop GUIs to web sites. Sciter’s approach is pretty much the same approach used by web components (combining css/html/js to a single reuseable element). Unfortunately it isn’t 100% compliant with browser based web components and hence Sciter based widget libraries can not be used for web sites or vice versa.

Again, that's not about Sciter but rather discussion of Web Components idea in general.

Essentially WebComponent is the way of associating some JS class with custom DOM elements.

At the nutshell, WebComponents is just this one JS function:

    customElements.define('hello-world', HelloWorld);
But it is quite limited as you see - a) only custom elements and b) you need to load some JS file in order to initialize bindings.

That element->JS code binding could be done by CSS with much greater flexibility:

    /* custom element */
    hello-world { aspect: HelloWorld url(hello-world.js); }

    /* existing element */
    span.hello-world { aspect: HelloWorld url(hello-world.js); }

    /* existing element, conditionally */
    a[href^="http"] { aspect: HelloWorld url(hello-world.js); }
Yet note that, in case of CSS bindings, hello-world.js will be loaded only if your document will have matching elements - better componentization I would say.

Re: Microsoft Fast Design

#199
post #180

Earlier quoted context omitted.

What makes you say web components are slow or have an unstable API?

It's slow and un usable , not unstable. The one benefit of WC is that it's going to be stable for the next hundred years, just like still works in 2020. It's unusable because of all the boilerplate it requires and doesn't provide the most important thing of all which is data binding. So you have to bring in some other support code to do data binding such as the Rx/Observables or Redux patterns, but since this can't b…

You'd be surprised but in general this

    element.html = "...";
is faster then

    ReactDOM.render(vdom,dom);
at least for initial DOM tree population.

There are many reasons for that. `element.html =` is implemented as single update transaction, JS function call is significantly more expensive then HTML parsing of single element, etc.

Post reply on HN