All Projects → PolymerLabs → Html Modules Toolkit

PolymerLabs / Html Modules Toolkit

Licence: bsd-3-clause
Transforming HTML standards of the future into JavaScript standards of the past

Programming Languages

typescript
32286 projects
declarative
70 projects

Projects that are alternatives of or similar to Html Modules Toolkit

Pax
The fastest JavaScript bundler in the galaxy.
Stars: ✭ 2,626 (+5735.56%)
Mutual labels:  build-tool, modules
Patterns Library
AXA CH UI components library. Please share, comment, create issues and work with us!
Stars: ✭ 63 (+40%)
Mutual labels:  polyfill, webcomponents
github-wc-polyfill
Ensure that all GitHub and GitLab scripts required for UXP and SeaMonkey are loaded correctly
Stars: ✭ 87 (+93.33%)
Mutual labels:  polyfill, webcomponents
Parcel
The zero configuration build tool for the web. 📦🚀
Stars: ✭ 39,670 (+88055.56%)
Mutual labels:  build-tool, modules
Phaser Node Kit
Rapid Game Development with PhaserJS and Node for Modern Browsers
Stars: ✭ 39 (-13.33%)
Mutual labels:  build-tool, modules
smart-custom-element
Smart a lightweight web component library that provides capabilities for web components, such as data binding, using es6 native class inheritance. This library is focused for providing the developer the ability to write robust and native web components without the need of dependencies and an overhead of a framework.
Stars: ✭ 17 (-62.22%)
Mutual labels:  polyfill, webcomponents
Resize Observer
Polyfills the ResizeObserver API.
Stars: ✭ 540 (+1100%)
Mutual labels:  polyfill, webcomponents
Change By Example
Finds a function that transforms a given object into another given object.
Stars: ✭ 32 (-28.89%)
Mutual labels:  transform
Forgemodbuilder
Build, setup, update and refresh your modding environment!
Stars: ✭ 37 (-17.78%)
Mutual labels:  build-tool
Graphql Modules
Enterprise Grade Tooling For Your GraphQL Server
Stars: ✭ 962 (+2037.78%)
Mutual labels:  modules
Es5 Polyfill
ECMAScript 5 Polyfill for IE-8
Stars: ✭ 31 (-31.11%)
Mutual labels:  polyfill
Jcnavigator
A decoupled navigator framework of jumping between modules or apps for iOS development.
Stars: ✭ 33 (-26.67%)
Mutual labels:  modules
Dnnextensions
One solution. Multiple extensions. No pain. A collection of DNN modules and other extensions.
Stars: ✭ 37 (-17.78%)
Mutual labels:  modules
Pi Builder
Extensible tool to build Arch Linux ARM for Raspberry Pi on x86_64 host using Docker
Stars: ✭ 31 (-31.11%)
Mutual labels:  build-tool
Egghead Typescript Vuejs Apps
Stars: ✭ 41 (-8.89%)
Mutual labels:  webcomponents
Athena
O2前端流程工具
Stars: ✭ 959 (+2031.11%)
Mutual labels:  build-tool
Bashful
Use a yaml file to stitch together commands and bash snippits and run them with a bit of style. Why? Because your bash script should be quiet and shy-like (...and not such a loud mouth).
Stars: ✭ 1,018 (+2162.22%)
Mutual labels:  build-tool
Panzoom
Universal pan and zoom library (DOM, SVG, Custom)
Stars: ✭ 1,003 (+2128.89%)
Mutual labels:  transform
Lwc
⚡️ LWC - A Blazing Fast, Enterprise-Grade Web Components Foundation
Stars: ✭ 974 (+2064.44%)
Mutual labels:  webcomponents
Html Sass Babel Webpack Boilerplate
Webpack 4 + Babel + ES6 + SASS + HTML Modules + Livereload
Stars: ✭ 35 (-22.22%)
Mutual labels:  modules

🚨 PROJECT STATUS: EXPERIMENTAL 🚨This product is in the Experimentation phase. Someone on the team thinks it’s an idea worth exploring, but it may not go any further than this. Use at your own risk.

🍢 HTML Modules Toolkit

Let's face it: if you publish stuff on the web, you probably noticed that it is getting harder and harder to use HTML to do it. HTML Imports failed to gain a lot of traction among browser implementors. JavaScript modules are, well, JavaScript; you can use cool tools like lit-html within JavaScript, but traditional markup just isn't on the menu.

HTML has been around for a long time. I mean, sure, just a few decades. But, that's like a million software years. It is a testament to HTML's versatility that we still use it for so many things today. The next generation of web content will need to take advantage of a new generation of HTML capabilities. HTML Modules Toolkit is a collection of tools and libraries to help web authors write their apps and content the way they were meant to be written: in highly declarative HTML. HTML Modules Toolkit unlocks the potential of future HTML standards for the projects of today.

HTML Modules

There is a nascent standard proposal called HTML Modules that could bring actual HTML into a JavaScript module graph near you. This would unlock crafting modules from HTML, and even loading other HTML-based modules from HTML documents or JavaScript modules. Importantly, HTML Modules have a lot more interest from browser implementors than HTML Imports ever did.

HTML Modules aren't standardized yet, but we have a good sense of what they might look like once they are standard and implemented by browsers.

Future HTML today

HTML Modules Toolkit intends to support workflows that incorporate future HTML standards like HTML Modules. Today, this project includes transforms for incorporating HTML Modules into build pipelines, and also middleware for using HTML Modules seamlessly inside of a dev server.

The standards that this project builds upon are still at a very early stage, so these tools should be considered to be in a similar state. We will adapt and improve these libraries to track the related standards as they continue to solidify.

Installing

npm install @polymer/html-modules-toolkit

What is included

This project includes low-level, versatile string-to-string transforms that can analyze a file in place, and produce the appropriate ES Module-compatible output.

You can import these low-level transforms into your Node.js build pipeline or dev server of choice:

import {htmlModuleToJsModuleMap} from
    '@polymer/html-modules-toolkit/lib/html-module-transform';
import {transformSpecifiersInHtmlString,transformSpecifiersInJsString} from
    '@polymer/html-modules-toolkit/lib/html-module-specifier-transform';

This project also includes higher-level wrappers of the transform for different practical use cases. The available wrappers include:

  • Webpack plugin:
    import {HtmlModulesPlugin} from
        '@polymer/html-modules-toolkit/lib/html-module-transform/webpack-plugin';
    
  • Gulp-compatible vinyl-fs transforms:
    import {HtmlModuleTransform,HtmlModuleSpecifiersTransform} from
        '@polymer/html-modules-toolkit/lib/vinyl-transform';
    
  • Express middleware:
    import {htmlModulesMiddleware} from
        '@polymer/html-modules-toolkit/lib/express-middleware';
    
  • Koa middleware:
    import {htmlModulesMiddleware} from
        '@polymer/html-modules-toolkit/lib/koa-middleware';
    

Specifier transforms

If you look closely at the above import statements, you will notice that in some cases there are separate transforms offered for converting specifiers. This transform is offered separately because it is not always needed. For example, in a dev server the server can control the Content-Type of the file being sent, and can send text/javascript even if the file has a .html file extension.

Usage examples

You can find some concrete usage examples in the examples/ directory of this project. The examples include:

Additionally, you can find a live example of the Koa middleware in action on Glitch.

Contributing

Currently we are only considering features or bugfixes related to the evolving HTML Modules standard. There is no strict spec text for this standard yet, so feature requests may be redirected to w3c/webcomponents if they seem sufficiently novel.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].