How do you do HTML include files? Is there a generally accepted, conventional method?

This page summarizes the projects mentioned and recommended in the original post on /r/webdev

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • Express

    Fast, unopinionated, minimalist web framework for node.

  • npm + Node.js + Express + ejs.

  • html-include-element

    Easily include external HTML into your pages.

  • This is what's html-include-element does. Many other libs do that. It works pretty well, as far as I can see in my hobby project, but you've got to be cautious with the imported html elements lifecycle, which is not tied to the events of the main window.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • vite

    Next generation frontend tooling. It's fast!

  • Granted, for simple apps it doesn’t make sense so make your user download a 200kb JS file to use a todo list app. That is when I would consider vanillaJS an option. If you’re interested, vite is a command line tool which makes setting up vanillaJS projects super simple, I personally use it all the time.

  • Svelte

    Cybernetically enhanced web apps

  • Another option which I only recently came across is a framework called svelte. Unlike React, there’s no client side runtime. Svelte compiles your app to vanillaJS before you deploy it, so you get the speed benefits of vanillaJS, but also the benefits of using a framework (components, reactive state, modularity etc).

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts