Giter Site home page Giter Site logo

fragments's Introduction

UI Fragments Catalog

Fragments

Fragments are composable UI blocks in composition through Server Side Inclusion (SSI) using Edge Side Includes (ESI) or Client Side Inclusion (CSI) using h-include.

The fragments project is a "catalog" of fragments, think "swagger for UI": what fragments are shared by this application, and how to include them.

A fragment consists of three parts: the markup, styles and behavior (js). We use the following convention:

  • fragment.css.html
  • fragment.js.html
  • fragment.html

To include using ESI, on inclusion per instance:

  <esi:include src="fragment.html"></esi:include>

The other two parts is included per "type" and could be placed in the document as you see fit:

  <esi:include src="fragment.css.html"></esi:include>
  <esi:include src="fragment.js.html"></esi:include>

Using ".html" lets the producer control versioning and cache busting.

The fragments project expects fragments to use the following url: "/fragments/fragment.html. All fragments in this path will be "scanned" and presented in the "fragment UI catalog".

A tale of two folds

ESI limits you to 64 inclusions. But when optimizing your page, you might want to mix'n'match strategies. For example using SSI above the fold and CSI below the fold. h-include lets you compose lazily and optimize below the fold.

All fragments that follow the path conventions are listed in the "fragment UI catalog" โ€“ how you compose is an implementation detail.

Baseline(s)

There might be use for a thin layer of common dependencies like css reset, fonts etc. The "fragments UI catalog" supports both a styling baseline and, if needed, a behavior baseline (js).

fragments's People

Contributors

gulfamabbas avatar gustafnk avatar perokvist avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fragments's Issues

Fragment information

Add information for each fragment. Naming conventions, size, cache times etc.

Enable baseline toggle

In each fragment frame/sandbox, enable toggle of baseline to visualize baseline dependencies.

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.