viperHTML | Isomorphic hyperHTML

 by   WebReflection JavaScript Version: 2.17.1 License: ISC

kandi X-RAY | viperHTML Summary

kandi X-RAY | viperHTML Summary

viperHTML is a JavaScript library typically used in Template Engine applications. viperHTML has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can install using 'npm i viperhtml' or download it from GitHub, npm.

Isomorphic hyperHTML
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              viperHTML has a low active ecosystem.
              It has 317 star(s) with 11 fork(s). There are 17 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 0 open issues and 22 have been closed. On average issues are closed in 71 days. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of viperHTML is 2.17.1

            kandi-Quality Quality

              viperHTML has no bugs reported.

            kandi-Security Security

              viperHTML has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              viperHTML is licensed under the ISC License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              viperHTML releases are not available. You will need to build from source code and install.
              Deployable package is available in npm.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of viperHTML
            Get all kandi verified functions for this library.

            viperHTML Key Features

            No Key Features are available at this moment for viperHTML.

            viperHTML Examples and Code Snippets

            No Code Snippets are available at this moment for viperHTML.

            Community Discussions

            QUESTION

            HyperHTML performance when re-ordering DOM Nodes
            Asked 2018-Sep-13 at 11:19

            I'm trying to understand HyperHTML and how to get the best performance out of it.

            Reading about how it works under the hood, it seems to imply that strong connections are made between a template and the DOM, which I take to mean that it requires a different mindset from VirtualDOM to optimise performance.

            I wrote some code to show sorting of N elements in a table using hyperHtml vs normalHtml. The normalHtml version just flushes the table and rebuilds the elements. They both seem similar performance-wise. Am I comparing apples with oranges here? How can I make the hyperHtml version of the code perform better?

            Code:

            ...

            ANSWER

            Answered 2018-Sep-13 at 11:19

            Update

            hyperHTML 2.14 introduced the usage of domdiff V2 which brings in petit-dom like performance with the cost of an extra 0.6K to the library, hopefully worth the change.

            The original demo also had huge problems on Safari for some weird reason, most likely related to the fact nodes are appended directly as TR to the TABLE, instead of into the table TBODY element.

            Anyway, you can now compare performance of the wired demo through this CodePen.

            Please note everything said about the old snabdom diffing also is not relevant anymore.

            It seems like you could have read a bit further than that, reaching the wire part, since you got the bind one.

            Basically, if you use an Array of strings as interpolated value, you are doing nothing different than an innerHTML like operation, with all the regular side effects:

            • every time you trash all nodes and create them from the scratch
            • every reference to any node will be lost forever
            • the amount of GC operations is higher
            • the layout is XSS prone, hence not safe

            To avoid replicating all these innerHTML gotchas and use hyperHTML properly, you need to wire items to the node these represent.

            Source https://stackoverflow.com/questions/52203055

            QUESTION

            Server Side Rendering with viperHTML
            Asked 2018-Sep-10 at 05:11

            I'm working on a Symfony application and just got SSR for JS working using https://github.com/spatie/server-side-rendering. So far I only worked with "readymade" SSR solutions for React, but currently I'm trying to use hyperHTML/viperHTML and am facing a few issues that so far I wasn't able to solve by looking at the available docs/examples.

            My current test snippet is this:

            ...

            ANSWER

            Answered 2018-Sep-10 at 05:11

            In case it helps, you can read viperHTML tests to see how components can be used.

            The thing here is that without explicitly calling render() I get no output.

            Components are meant to be used to render layout, either on the server or on the client side. This means if you pass a component instance to a hyper/viperHTML view, you don't have to worry about calling anything, it's done for you.

            Source https://stackoverflow.com/questions/52218848

            QUESTION

            hyperHTML: updating a list
            Asked 2018-Aug-24 at 23:04

            When I inspect the html elements created by the following code (using hyperHTML in Chrome, the entire list refreshes (I am assuming this based on all elements in the

              flashing purple briefly).

              ...

            ANSWER

            Answered 2018-Aug-24 at 23:04

            Sorry for the delay (I was on vacation) but the answer is simple: if you provide, as interpolation, an array of strings, you have the equivalent of an unsafe, and always new, innerHTML operation, which is both possible but not suggested.

            What you need to do, when you have real world data and items, usually as objects, is to relate each item with the piece of DOM it represent.

            This is done with wire(...) which accepts a reference, as object, and optionally an id.

            Since the reference must be weak, for memory reasons, to recreate your demo you can relate all items to a single source as list could be, and use each item value as unique id.

            Source https://stackoverflow.com/questions/51923196

            QUESTION

            Isomorphic hyperHTML components without passing in wires
            Asked 2018-Apr-05 at 06:34

            I have the following two components:

            ...

            ANSWER

            Answered 2018-Apr-05 at 06:34

            update there is now a workaround provided by the hypermorphic module.

            The ideal case scenario is that you have as dependency only viperhtml, which in turns brings in hyperhtml automatically, as you can see by the index.js file.

            At that point, the client bundler should, if capable, tree shake unused code for you but you have a very good point that's not immediately clear.

            I am also not fully sure if bundlers can be that smart, assuming that a check like typeof document === "object" would always be true and target browsers only.

            One way to try that, is to

            Source https://stackoverflow.com/questions/49638355

            QUESTION

            hyperHTML wire vs string
            Asked 2018-Mar-13 at 13:16

            I am starting to use hyperHTML have a question

            starting with

            ...

            ANSWER

            Answered 2017-Dec-17 at 15:36

            The main problem in your question is the example itself: a list of primitives, in this case numbers, used as generic element content.

            This is not a so common real-world use case, where numbers comes from data and data is weakly referenciable.

            However, if it's exactly a list of few numbers that you want inject as LI elements, hyperHTML lets you do that, and if that's all you need, just go for it.

            Now let me try to explain your question:

            Why is wire better?

            hyperHTML gives you a way to define various kind of content, including:

            1. text, which is automatically sanitized for you
            2. attributes, including events
            3. partial portions of the element that could be resolved lazily

            You might want/need to use hyperHTML features to create elements as one-off operation.

            A form, an input, a button, an image, if you want to quickly create a DOM element, you can do that via hyperHTML because it doesn't lock you in, it's rather an opt-in abstraction/library.

            That is why you could relate a specific data object to a wire, but you could also simply use wires without references: it's OK for quick prototyping or small amount of changes.

            Now let me show you few examples from that (reduced) list of features.

            Point 1: text

            If instead of plain numbers you have a list of book titles, what will your unwired code produce?

            Source https://stackoverflow.com/questions/47830075

            QUESTION

            Access DOM when using hyper.Component
            Asked 2017-Sep-14 at 09:20

            When using HyperHTMLElement it's possible to access the contents of the component by simply using this.children or this.querySelector(), since it's an element.

            But how would I achieve similar behavior when using hyper.Component?

            The hypothetical example I have in mind is from React docs: https://facebook.github.io/react/docs/refs-and-the-dom.html - I'd like to focus a specific node inside my DOM.

            I have a codepen sandbox where I'm trying to solve this: https://codepen.io/asapach/pen/oGvdBd?editors=0010

            The idea is that render() returns the same Node every time, so I could save it before returning and access it later as this.node:

            ...

            ANSWER

            Answered 2017-Sep-12 at 00:55

            This is something I've worked on in the past via https://github.com/joshgillies/hypercomponent

            The implementation is actually quite trivial.

            Source https://stackoverflow.com/questions/46165545

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install viperHTML

            You can install using 'npm i viperhtml' or download it from GitHub, npm.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • npm

            npm i viperhtml

          • CLONE
          • HTTPS

            https://github.com/WebReflection/viperHTML.git

          • CLI

            gh repo clone WebReflection/viperHTML

          • sshUrl

            git@github.com:WebReflection/viperHTML.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular JavaScript Libraries

            freeCodeCamp

            by freeCodeCamp

            vue

            by vuejs

            react

            by facebook

            bootstrap

            by twbs

            Try Top Libraries by WebReflection

            hyperHTML

            by WebReflectionHTML

            linkedom

            by WebReflectionHTML

            document-register-element

            by WebReflectionJavaScript

            dom4

            by WebReflectionJavaScript

            flatted

            by WebReflectionJavaScript