Coder Social home page Coder Social logo

Comments (4)

developit avatar developit commented on June 13, 2024 1

I understand that for some use-cases, the library size is less important. However, there are potential performance reasons to use htm without transpiling in production - including some interesting tradeoffs for JS parsing time. At 400-500 bytes, those tradeoffs are often worthwhile. A 10kb implementation with pretty warnings and english messages would likely invalidate that.

from htm.

developit avatar developit commented on June 13, 2024

This is something we gave up when moving from using the browser's HTML parser to a custom parser in 2.0. The tradeoffs of being able to run directly in Node.js and reducing the library size were good, but we have heard from a few people that some of the niceties of HTML like this would be pleasant to have back.

I'm not sure how feasible it is to implement void elements, since its a whitelist. Perhaps we could move validation into something like an editor plugin?

from htm.

DavidBruant avatar DavidBruant commented on June 13, 2024

reducing the library size

I just realized that i don't understand why a small library size would be a goal of this library

My understanding is that for most libraries, the size of the library is a necessary cost to be paid for the functionnality it offers

However, for htm, if i understand correctly, babel-plugin-htm reduces the footprint of the library to literally zero regardless of its original size
So with an easy-to-setup opt-in, users can have maximum functionnality of the library (and even smaller runtime cost!) at the cost of zero bytes

Under these circumstances, i see using the htm library in the browser as a transitional path to the Babel plugin rather than something that has to stay forever (which is usually the case for libraries). In this context, keeping the library size small does not seem that relevant any longer

from htm.

developit avatar developit commented on June 13, 2024

Just an addendum: I think it would be both possible and reasonable to add extended parser error messages to babel-plugin-htm, since it doesn't get loaded at runtime.

from htm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.