Visitar URL original
just a small note: standalone bundle of htm with preact and preact/signals · Issue #239 · developit/htm · GitHub
Skip to content

just a small note: standalone bundle of htm with preact and preact/signals #239

Description

@rozek

First of all: thank you very much for this marvelous package!

For my personal needs, however, I "had" to bundle htm not only with preact but also with preact/signals - which surprisingly worked out-of-the-box.

However, I won't open a pull request as this "enhancement" does not add any new functionality but just makes the import a bit more convenient...

Of course, you may close this "issue" whenever you like.

Activity

  1. developit commented on Feb 10, 2023

    @developit
    Owner

    Hiya! I do think this would be really nice to offer, but as you mentioned it's a bit of a divergence from what the standalone entry has previously included.

    FWIW, you can grab a combined version using npm.reversehttp.com (it has a UI for getting combined bundles):

    <!DOCTYPE html>
    <body>
    <script type="module">
    import {
      html, h, useSignal, render
    } from 'https://npm.reversehttp.com/@preact/signals-core,@preact/signals,htm/preact,preact';
    
    function App() {
      const count = useSignal(0);
      return html`
        <button onClick=${() => count.value++}>
          ${count}
        </button>
      `;
    }
    
    render(h(App), document.body);
    </script>
    </body>

    Here's a demo of the above on JSFiddle:
    https://jsfiddle.net/developit/6gjqnma9/

  2. rozek commented on Feb 10, 2023

    @rozek
    Author

    Wow, that's interesting and can be quite useful from time to time!

    Thank you very much for the hint!

  3. Dmitri-Sintsov commented on Oct 8, 2024

    @Dmitri-Sintsov

    Thanks.
    Still, it would be nice to have the link to latest standalone preact+htm+signals bundle in the README.

    The more complete package with hooks would be

    https://npm.reversehttp.com/@preact/signals-core,@preact/signals,htm/preact,preact/hooks,preact

  4. Dmitri-Sintsov commented on Jun 7, 2025

    @Dmitri-Sintsov

    https://github.com/mujahidfa/preact-htm-signals-standalone

    That bundle is the outdated one. Better to use reversehttp link above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions