DEV Community

Discussion on: Want to write future safe code for the future web? Let me help you with Web Components

Collapse
 
pavelloz profile image
Paweł Kowalski

Html imports are dead? I was so excited to see those...

I was kind of waiting with the whole trying of webcomponents because i wanted to experience the whole package, which i think, imports are very much part of.

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀

Yeah it's a shame but after polymer I think it was realized that we didn't need to achieve web components in quite the way the spec imagined it. Remember just because it's a proposal or in spec doesn't make it a good idea. Look at js with statements, that's an awful lot like destructing.

Thread Thread
 
umerkk164 profile image
Umer K

Spec does not make it good, agreed. Except it does for learners. All learners will around the world learn the same spec, and they will be confident that they don't need to use tools of which they have no knowledge (webpack babble npm node to name a few) just to achieve basic functionality.

Thread Thread
 
adam_cyclones profile image
Adam Crockett 🌀

But I'm afraid in business these tools are mandatory in modern JavaScript.

  • Learn node to do but not limited to server side development, not that there is much to learn, it's JavaScript with an extended standard library for system up.
  • Learn Babel to ease the pain of supporting browsers of all kinds.
  • Learn npm to have your packages safely delivered to you in a manageable version safe way All those tools are doing fairly different things and all and most are cross target not just server side. This is modern JavaScript, a world where a developer can be fullstack without much of a learning curve in my opinion.
Thread Thread
 
oenonono profile image
Junk

HTML imports are an excellent idea. It was perhaps not a great specification. But keep in mind it was the fact that browsers were going to be implementing ES Modules more than issues with HTML Imports that got in the way. That some of the same problems had to be solved with both and that they covered similar use cases. There was a sentiment: first, do this with the lower level, less abstract, ES Modules and then come back to the higher level, more abstract, HTML module and import feature better informed.

Browser vendors and engineers are making the mistake of forgetting that pandering to business interests is probably not what catapulted the web to millions of users. If it had been who the web was giving priority to designing for, obsfucation, data mining, and DRM would have been big priorities built in from the start.

Thread Thread
 
adam_cyclones profile image
Adam Crockett 🌀 • Edited
import foo from './bar/baz.html'
import foo from './bar/baz.css'
import foo from './bar/baz.json' ⚰️
Enter fullscreen mode Exit fullscreen mode
<link rel="import" type="text/html"> ⚰️
Enter fullscreen mode Exit fullscreen mode

This is the state of imports as worked on right now, I believe there may be an image import also. As for my opinion, I am trying out lit-html to see what I can do with the bear 🐻 minimum.

Thread Thread
 
pavelloz profile image
Paweł Kowalski

Yeah, since some new standards now have bigcorp sponsorships, and one particular bigcorp is inventing straight up web/user-hostile platforms from monopoly position, i guess pretty soon diversity will play much bigger role.

I dont know if it was such a big deal in other countries, but in mine, everyone was switching to Firefox like crazy ~10 years ago and 46% of users are using *AdBlock.

This rebellion against a giant greedy corp. usually needs a match on gasoline, like latest moves to kill adblocks in chrome.

  • Some kind of adblock, not necessairly "AdBlock Plus".
Thread Thread
 
oenonono profile image
Junk

(I've gotten the impression that HTML Imports from the Polymer days are definitely dropped and succeeded by...HTML Modules? And some other stuff, maybe. I dunno if that's what it looks like, been too busy to take a look. But "some kind of HTML imports, not necessarily 'HTML Imports.'")