Dynamically-loading WebComponent Assembly UI Framework

Overview

Golgi: Dynamically-loading WebComponent Assembly Framework

Rob Tweed [email protected]
14 February 2022, M/Gateway Developments Ltd http://www.mgateway.com

Twitter: @rtweed

Google Group for discussions, support, advice etc: http://groups.google.co.uk/group/enterprise-web-developer-community

What is Golgi?

Golgi (pronounced Gol-jee) is a new approach to browser-based User Interface (UI) development that makes use of the latest Web Technologies, in particular WebComponents, ES6 Modules, Proxies and MutuationObserver.

Golgi allows you to build UIs using WebComponents as composable units, abstracted as XML/XHTML tags and delivered progressively on-demand, without the need for a time-consuming bundling/compilation step, and without the need for Node.js, WebPack or large, complex build chains during development or deployment.

Just develop and go, edit and go!

Try It Out!

Run this live example, demonstrating how Golgi turns the SB Admin theme into an actual framework that you can quickly and easily customise to meet your needs.

You can also try out this live example, demonstrating the RealWorld Conduit front-end, implemented as a single-page application using Golgi.

NOTE: You must use a modern browser that supports WebComponents to run these examples!

See the ./examples folder for the actual Golgi source code files that run the live examples.

About Golgi

Golgi can only be used where you know that the very latest browsers are in use, but if they are, then it provides one of the fastest and leanest frameworks for UI development, since it makes use of the built-in capabilities of the browser, avoiding the need to download large bundled JavaScript framework files. Golgi itself a mere 38Kb in size in its uncompressed source version, and just 15Kb if you use the minimised version, and is literally all that is needed to make everything work!

Golgi can be used with many other standard UI frameworks such as Bootstrap 5, Chart.js etc. Of course, if you make use of these, their JavaScript and CSS resource files must be downloaded into your application. However, Golgi allows such resources to be downloaded on demand and only when needed, resulting in very short application load and start times. You'll see this happening in the live example.

Unlike many of the UI frameworks that are currently in vogue, Golgi does not require or make use of bundling (eg using WebPack etc). Your JavaScript files and WebComponents that define a Golgi application are dynamically loaded, on demand, as ES6 Modules. Avoiding a separate compilation/bundling step speeds up application development considerably, and doesn't require the creation and configuration of a complex build chain. All you need to get up and running is the tiny Golgi JavaScript file, and everything else is done by the Web Technology built into modern browsers.

Why Is It Named Golgi?

The Golgi Apparatus (or Golgi Body) exists in every living cell, and its purpose is to package proteins into membrane-bound vesicles inside the cell, before the vesicles are sent to their destination. Proteins are constructed from simpler building blocks called Amino Acids.

The analogy is that WebComponents provide the basic building-blocks for what we call Assemblies, and the Golgi framework allows you to fetch, configure and send these Assemblies to their correct destination within the UI layout.

Golgi In A Nutshell

Golgi is very much an atomic design methodology:

  • The basic building blocks are Golgi Components. These are WebComponents that you package as ES6 Modules. They can be as simple or as complex as you like, but typically they are simple and small. Many may represent just a single HTML tag. By being defined as WebComponents, you can define methods and properties that are relevant to the purpose of the tag or set of tags within the Component.

  • Golgi Assemblies are your "proteins", built from Golgi Components, and visualised by the develper as nested XML/XHTML tags, each of which represents a Golgi Component.
    Golgi Assemblies can optionally configure each instance of its constituent Golgi Components, adding state values and optional methods that are invoked when each constituent Golgi Component is rendered. Golgi Assemblies are also packaged as ES6 Modules, allowing Golgi to dynamically import and load them on demand. When a Golgi Assembly is loaded, its constituent Golgi Component modules are dynamically imported, loaded and rendered.

  • Within Golgi Assemblies, you can optionally define mappings for data binding, automatically invoking Golgi Component setState() methods when specified paths within Golgi's state object are set or changed.

  • You can optionally specify Mutation Observers within Golgi Components, allowing dynamic behaviour to be defined in response to specified changes in the rendered Component.

In Golgi Components, you can decide whether or not to make use of the ShadowDOM that WebComponents provide. For most of the time you'll find that you won't actually use ShadowDOM, for reasons that will become clear later. This may surprise a lot of people, since the general impression is that ShadowDOM is an essential part of WebComponents: it's actually not. ShadowDOM is entirely optional, and understanding that makes all sorts of things possible with WebComponents, as Golgi demonstrates.

From these simple building blocks, anything is then possible!

Installation

Just copy the golgi.js or golgi.min.js file to a directory accessible by your web server and you're ready to go.

Alternatively, to quickly try it out without installing anything, just import the golgi.js or golgi.min.js file directly from this repository using the URL:

Tutorial

Follow this tutorial to quickly learn how to use Golgi.

Further Documentation to follow

....

License

Copyright (c) 2022 M/Gateway Developments Ltd,
Redhill, Surrey UK.
All rights reserved.

http://www.mgateway.com
Email: [email protected]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0                           

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and
limitations under the License.

You might also like...

Get dynamically generated your github contributor stats on your READMEs!

GitHub Readme Contributor Stats Get dynamically generated your github contributor stats on your READMEs! Features GitHub Contributor Stats Card Themes

Dec 11, 2022

Basic website that allows users to add/remove books from a list. Achieved using JavaScript objects and arrays, dynamically modifying the DOM and adding basic events.

Awesome Books Basic website that allows users to add/remove books from a list. Achieved using JavaScript objects and arrays, dynamically modifying the

Dec 20, 2022

This is a basic app that allows user add/remove books from a list of books. It was created by using JavaScript arrays and objects to dynamically modify the DOM.

Awesome-Books This application lets you compile a dynamic collection of books using JavaScript. It is a single page app. You enter your book title & a

Oct 24, 2022

A web app build with HTML, CSS, and JavaScript. It allow users to add a book title and and it's author. Content are rendered also dynamically.

Awesome books: with ES6 Description the project. Built With Major languages Frameworks Technologies used Awesome Books In this project the featured se

Nov 4, 2022

GreenWebhook is a proxy or gateway between two systems that helps reduce your carbon footprint by dynamically routing or delaying traffic so that your workloads run when and where they will cause the lowest amount of carbon emissions.

GreenWebhook is a proxy or gateway between two systems that helps reduce your carbon footprint by dynamically routing or delaying traffic so that your workloads run when and where they will cause the lowest amount of carbon emissions.

💚 Welcome to Green Webhook! 💚 Green Webhook is a proxy or gateway between two systems that intelligently chooses which endpoint to send a webhook ev

Nov 23, 2022

Multithread emulator. The wrun allows you to dynamically run a function inside a Web Worker on the client side, without the needing of a dedicated file

wrun This lib allows you to dynamically run a function inside a Web Worker on the client side, without the needing of a dedicated file. This means tha

Nov 5, 2022

Fancytree - JavaScript tree view / tree grid plugin with support for keyboard, inline editing, filtering, checkboxes, drag'n'drop, and lazy loading

Fancytree - JavaScript tree view / tree grid plugin with support for keyboard, inline editing, filtering, checkboxes, drag'n'drop, and lazy loading

Fancytree Fancytree (sequel of DynaTree 1.x) is a JavaScript tree view / tree grid plugin with support for keyboard, inline editing, filtering, checkb

Jan 9, 2023

Lightweight Loading Animation

Lightweight Loading Animation

◼️ Features: 🛠 Easy to Use 🌠 Fast & Lightweight (0.5Kb) 💪 No dependencies, built with VanillaJS 🌎 Tested in all modern browsers ◼️ Demo: https://b

Sep 1, 2022
Owner
null
Fast and lightweight dependency-free vanilla JavaScript polyfill for native lazy loading / the awesome loading='lazy'-attribute.

loading="lazy" attribute polyfill Fast and lightweight vanilla JavaScript polyfill for native lazy loading, meaning the behaviour to load elements rig

Maximilian Franzke 571 Dec 30, 2022
A Typescript assembly(ish) interpreter with a nice web UI

Assembly-Online Example Fibonacci Program MOV R0, #1 MOV R1, #1 fib: MOV R2, R0 ADD R0, R0, R1 MOV R1, R2 B print CMP R0, #40 BGT exit B fib exit: \ I

null 3 May 23, 2022
Demo running web assembly apps a terminal with blocking stdin/stdout/stderr

Python wasm-terminal Live version here: https://wasm-terminal.firebaseapp.com/ This is a small demo of running Python in the browser with a focus on i

Katie Bell 16 Nov 16, 2022
Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.

Introduction Swagger UI allows anyone — be it your development team or your end consumers — to visualize and interact with the API’s resources without

Swagger 23.2k Dec 28, 2022
A weather dashboard that features dynamically updated HTML and CSS using OpenWeather API data.

Weather Dashboard A weather dashboard that features dynamically updated HTML and CSS using OpenWeather API data. User Story AS A traveler I WANT to se

Benjamin Eidum 1 Apr 19, 2022
Obsidian-dataview-table-filter-menu - Dynamically created filter menu for dataview tables in obsidian

Dataview table Filter Menu for Obsidian Dynamically created filter menu for data

shiro 17 Sep 24, 2022
Dynamically resize, format and optimize images based on url modifiers.

Local Image Sharp Dynamically resize, format and optimize images based on url modifiers. Table of Contents ✨ Features ?? Installation ?? Usage Contrib

Strapi Community 30 Nov 29, 2022
Lightweight library service that can dynamically make periodic updates to an Instagram profile.

instagram-dynamic-profile library This library uses the instagram-private-api to automate dynamic updates to an Instagram profile such as cycling thro

null 1 Sep 21, 2022
This project will be a basic website that allows users to add/remove books from a list. The main objective is to understand how to use JavaScript objects and arrays and dynamically modify the DOM and add basic events.

Awesome-books Awesome Books This project will be a basic website that allows users to add/remove books from a list. This project is part of the Microv

Aleksandra Ujvari 10 Oct 3, 2022