proposal-import-attributes VS yhtml

Compare proposal-import-attributes vs yhtml and see what are their differences.

proposal-import-attributes

Proposal for syntax to import ES modules with assertions (by tc39)

yhtml

Tiny html tag function for rendering Web Component templates with event binding (by dchester)
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
proposal-import-attributes yhtml
8 3
547 101
3.1% -
5.9 3.1
4 months ago 10 months ago
HTML HTML
Apache License 2.0 -
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

proposal-import-attributes

Posts with mentions or reviews of proposal-import-attributes. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-03-24.
  • Power of Partial Prerendering with Bun
    2 projects | dev.to | 24 Mar 2024
    Bun introduces the idea of Macros into JavaScript. Macros are a new paradigm that allows optimizations ahead of time just by adding an import attribute.
  • How to use import attributes in TypeScript and JavaScript
    1 project | dev.to | 9 Jan 2024
    TypeScript v5.3 builds on its JavaScript foundation by adding import attributes with the usual type safety and tooling benefits inherent to the language. You can follow the TypeScript proposal for import attributes on GitHub.
  • CSS Modules Still a Thing?
    2 projects | /r/css | 7 Dec 2023
    Yup, in vanilla that's fine, but I'm not sure whether bundlers etc are able to understand import assertions yet, as the spec is still being finalised - for example: the 'assert' keyword has now been officially changed to 'with', but only 'assert' is implemented anywhere at the moment.
  • If Web Components are so great, why am I not using them?
    12 projects | news.ycombinator.com | 2 Aug 2023
    Things like HTML (and JSON) imports in ES modules, among other things, have been waiting on some safety signalling mechanics currently named "Import Attributes". Import Attributes are currently in Stage 3 [0].

    The basic security story is that browsers never care about file extensions, they care about MIME types. A developer might add an import to a third-party HTML or JSON file somewhere and expect one "safe" behavior, but the third-party could just return a MIME type of "text/javascript" and inject an entire script and the browser is supposed to respect that MIME type.

    To keep things safe, browsers want a way to signal that an import is supposed to JSON (or HTML or CSS) rather than JS and error if it gets back something "wrong" from a server request. That's one of the proposed uses for Import Attributes to suggest expected MIME types for non-JS modules in ES module imports.

    Unfortunately, there are other proposed uses for Import Attributes (things like including hashes for integrity checks) and so there have been quite a few revisions (and multiple names) for Import Attributes trying to best support as many of the proposed uses as possible, and that has slowed progress on it a lot more than some people would wish.

    [0] https://github.com/tc39/proposal-import-attributes

  • [Showoff Saturday] Replacing Abandoned Dependencies
    2 projects | /r/webdev | 24 Jun 2023
    This was an idea that I came up with when thinking about how to handle import styles from './styles.css' with { type: 'css' } in @shgysk8zer0/rollup-import. Import assertions / import attributes are now back to stage 3, but only JSON is actually progressing. So I decided to wait until there's a stable spec.
  • Rails Frontend Bundling - Which one should I choose?
    5 projects | dev.to | 22 May 2023
  • The Cost of Convenience
    2 projects | dev.to | 4 May 2023
    None of these examples will actually work in a browser, because they are non-standard. Some of you might have correctly spotted that a browser standard exists for two of the imports pointed out in the example, namely the Import Attributes proposal (previously known as Import Assertions), but these imports in their current shape will not work natively in a browser. Many of these non-standard imports exist for good reason; they are very convenient.
  • Updates from the 95th TC39 meeting
    7 projects | dev.to | 23 Mar 2023
    import attribute: Import Assertions re-adanced to Stage-3. Proposal for syntax to import ES modules with assertions

yhtml

Posts with mentions or reviews of yhtml. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-08-02.
  • If Web Components are so great, why am I not using them?
    12 projects | news.ycombinator.com | 2 Aug 2023
    The main reason is that they're too low-level to use directly.

    They do a lot, but stop just short of being useful without something of a framework on top. I tried hard to use them directly, but found that it was untenable without sensible template interpolation, and without helpers for event binding.

    Here's my shot at the smallest possible "framework" atop Web Components that make them workable (and even enjoyable) as an application developer:

    https://github.com/dchester/yhtml

    It's just ~10 SLOC, admittedly dense, but which make a world of difference in terms of usability. With that in place, now you can write markup in a style not too dissimilar from React or Vue, like...

        ${this.count}
  • Modern SPAs without bundlers, CDNs, or Node.js
    8 projects | news.ycombinator.com | 16 Feb 2023
    I also sometimes enjoy this approach of starting from absolutely nothing.

    Instead of taking the path of starting with DOM manipulation and then going to a framework as necessary, I've kept really trying to make raw web components work, but kept finding that I wanted just a little bit more.

    I managed to get the more I wanted -- sensible template interpolation with event binding -- boiled down to a tag function in 481 bytes / 12 lines of (dense) source code, which I feel like is small enough that you can copy/paste it around and not feel to bad about it. It's here if anyone cares to look: https://github.com/dchester/yhtml

  • Bytes HTML tag function for rendering Web Component templates
    1 project | news.ycombinator.com | 18 Sep 2022

What are some alternatives?

When comparing proposal-import-attributes and yhtml you can also consider the following projects:

proposal-class-method-parameter-decorators - Decorators for ECMAScript class method and constructor parameters

fastdom - Eliminates layout thrashing by batching DOM measurement and mutation tasks

unpkg - The CDN for everything on npm

custom-elements - Using custom elements

proposal-float16array - a proposal to add float16 TypedArrays to JavaScript

img-comparison-slider - Image comparison slider. Compare images before and after. Supports React, Vue, Angular.

proposal-await-dictionary - A proposal to add Promise.ownProperties(), Promise.fromEntries() to ECMAScript

systemjs - Dynamic ES module loader

uibuilder - Typed HTML templates using TypeScript's TSX files

custom-elements-everywhere - Custom Element + Framework Interoperability Tests.

FunPizzaShop