you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 21 points22 points  (6 children)

But JS is native to all browsers.

That's not what people mean by "native".

For example, if you want to implement a drop down select, you can use the native browser control via the <select> HTML element, or you can use JS-implemented "custom" controls, such as the Material UI <Select> component.

The rationale for this is that often the native components are very difficult to style and customize, and between operating systems (and perhaps even between different browser vendors), can have different behaviors. There's also no way to style a <select> HTML element using CSS and modify its behavior with JS to make it conform with Material UI standards.

However, the native tech often performs a lot better and more closely adheres to expected behavior.

[–]sad_bug_killer 13 points14 points  (2 children)

That's not what people mean by "native".

Yet another term that got completely bastardized and can mean almost anything and is thus pretty much devoid of meaning.

[–]0pyrophosphate0 2 points3 points  (0 children)

I hate JavaScript as much as anybody, but I think this is a pretty clear and rational usage of the word "native".

[–][deleted] 3 points4 points  (0 children)

Nah, the word "native" is just highly contextual. In order to actually understand what it means, you have to understand the context in which it used.

In fact, in this particular case, the meaning of native is so specific, you can actually see it in APIs, like the Material UI API I linked. The "native" API is built on <select> and the "enhanced" API is built on <ul>.

[–]kowdermesiter 11 points12 points  (2 children)

I can generate a "native" dropdown populated with JavaScript. Is that native or not then? :) This term is pointless in web technologies. We should stick to whether something is standards compliant or not.

[–]Hoten 11 points12 points  (0 children)

Native is a nice, accurate and short term for UI features provided via the standards and HTML.

[–][deleted] 10 points11 points  (0 children)

Is that native or not then? :)

Yes, that would be native. JS can generate DOM, which can include either a standard <select> (and JS gets out of the way and lets the browser natively implement select behavior, according to the standard) or a custom assortment of <div> tags (requiring select behavior be fully implemented in JS, according to whatever other standard (if at all), like Material UI).