@webqit/webflo 0.11.20 → 0.11.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -20
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,41 +7,75 @@
|
|
|
7
7
|
|
|
8
8
|
<!-- /BADGES -->
|
|
9
9
|
|
|
10
|
-
Webflo is a universal *web*, *mobile*, and *API backend* framework built to solve for the underrated `.html` + `.css` + `.js` stack! This has been written
|
|
10
|
+
Webflo is a universal *web*, *mobile*, and *API backend* framework built to solve for the underrated `.html` + `.css` + `.js` stack! This has been written to facilitate working and thinking in vanilla HTML, CSS and JavaScript - for building more authentic, web-native applications!
|
|
11
11
|
|
|
12
|
-
Ok, we've put all of that up for a straight read!
|
|
12
|
+
Ok, we've put all of that up for a 10min straight read!
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
## The Catch...
|
|
15
|
+
|
|
16
|
+
The overall motivation for Webflo is to facilitate *web-native* development; to be the cool framework that draws on native web platform features - including new fascinating features we're proposing as standards! So, it gets a little bit "futuristic"! You thus have to be excited about taking a plunge to happily meet Webflo!
|
|
17
|
+
|
|
18
|
+
## The Wins...
|
|
19
|
+
|
|
20
|
+
Much of what eludes the web today...
|
|
21
|
+
|
|
22
|
+
+ An overarching HTML-first thinking!
|
|
23
|
+
+ The build-less, vanilla advantage!
|
|
24
|
+
+ (Futuristic) Native reactivity!
|
|
25
|
+
+ (Futuristic) Minimalist-JS philosophy!
|
|
26
|
+
+ Universal-everything!
|
|
16
27
|
|
|
17
|
-
|
|
28
|
+
(Details just ahead!)
|
|
29
|
+
|
|
30
|
+
## Documentation
|
|
31
|
+
|
|
32
|
+
All of Webflo in a 10-min read!
|
|
18
33
|
|
|
19
34
|
+ [Overview](#overview)
|
|
20
35
|
+ [Installation](#installation)
|
|
21
36
|
+ [Concepts](#concepts)
|
|
37
|
+
+ [Handler Functions and Layout](#handler-functions-and-layout)
|
|
38
|
+
+ [Step Functions and Workflows](#step-functions-and-workflows)
|
|
39
|
+
+ [Pages, Layout and Templating](#pages-layout-and-templating)
|
|
40
|
+
+ [Client and Server-Side Rendering](#client-and-server-side-rendering)
|
|
41
|
+
+ [Requests and Responses](#requests-and-responses)
|
|
22
42
|
+ [Webflo Applications](#webflo-applications)
|
|
43
|
+
+ [Client-Side Applications](#client-side-applications)
|
|
44
|
+
+ [Progressive Web Apps](#progressive-web-apps)
|
|
45
|
+
+ [API Backends](#api-backends)
|
|
46
|
+
+ [Static Sites](#static-sites)
|
|
23
47
|
+ [Webflo Config](#webflo-config)
|
|
24
|
-
+ [
|
|
48
|
+
+ [Webflo Tooling](#webflo-tooling)
|
|
49
|
+
+ [OOHTML](#oohtml)
|
|
50
|
+
+ [OOHTML SSR](#oohtml-ssr)
|
|
51
|
+
+ [OOHTML CLI](#oohtml-cli)
|
|
52
|
+
+ [The Observer API](#the-observer-api)
|
|
25
53
|
+ [Getting Started](#getting-started)
|
|
26
54
|
+ [Getting Involved](#getting-involved)
|
|
27
55
|
|
|
28
56
|
## Overview
|
|
29
57
|
|
|
30
58
|
<details>
|
|
31
|
-
<summary><b>Build <i>anything</i></b> - from as basic as a static <code>index.html</code> page to as rich as a universal app that's either a <i>Multi Page Application (MPA)</i>, <i>Single Page Application (SPA)</i>, or a hybrid of
|
|
59
|
+
<summary><b>Build <i>anything</i></b> - from as basic as a static <code>index.html</code> page to as rich as a universal app that's either a <i>Multi Page Application (MPA)</i>, <i>Single Page Application (SPA)</i>, or a hybrid of both, implementing <i>Server Side Rendering (SSR)</i>, <i>Client Side Rendering (CSR)</i>, or a hybrid of both, offline and <i>PWA</i> capabilities, etc. - this time, <i>without loosing the vanilla advantage</i>!
|
|
32
60
|
</summary>
|
|
33
61
|
|
|
34
62
|
Here's a glimpse of your Webflo app.
|
|
35
63
|
|
|
36
|
-
For when your application
|
|
64
|
+
For when your application is a static site, or has static files to serve.
|
|
37
65
|
+ The `public` directory for static files.
|
|
38
|
-
+ The `server` directory for server-side routing. (i.e. dynamic request handling on the server - in the case of Multi Page Applications, API backends, etc.)
|
|
39
66
|
|
|
40
67
|
```shell
|
|
41
68
|
my-app
|
|
42
|
-
├── server/index.js
|
|
43
69
|
└── public/logo.png
|
|
44
70
|
```
|
|
71
|
+
|
|
72
|
+
For when your application has a Server side.
|
|
73
|
+
+ The `server` directory for server-side routing. (i.e. dynamic request handling on the server - in the case of Multi Page Applications, API backends, etc.)
|
|
74
|
+
|
|
75
|
+
```shell
|
|
76
|
+
my-app
|
|
77
|
+
└── server/index.js
|
|
78
|
+
```
|
|
45
79
|
|
|
46
80
|
And a typical `index.js` route handler has the following anatomy.
|
|
47
81
|
|
|
@@ -100,7 +134,7 @@ For when your application has a Client side.
|
|
|
100
134
|
└── worker/index.js
|
|
101
135
|
```
|
|
102
136
|
|
|
103
|
-
And in both cases, a typical `index.js` route handler has the following anatomy.
|
|
137
|
+
And in both cases, a typical `index.js` route handler has the following anatomy. (Same with server-side handlers.)
|
|
104
138
|
|
|
105
139
|
```js
|
|
106
140
|
/**
|
|
@@ -385,7 +419,7 @@ export default function(event, context, next) {
|
|
|
385
419
|
}
|
|
386
420
|
```
|
|
387
421
|
|
|
388
|
-
|
|
422
|
+
We get a step-based workflow that helps to decomplicate routing and lets us scale horizontally as our application grows larger.
|
|
389
423
|
|
|
390
424
|
<details>
|
|
391
425
|
<summary>More details...</summary>
|
|
@@ -525,7 +559,7 @@ So, above, should our handler receive static file requests like `http://localhos
|
|
|
525
559
|
|
|
526
560
|
```shell
|
|
527
561
|
my-app
|
|
528
|
-
├── server/index.js ------------------------- http://localhost:3000, http://localhost:3000/
|
|
562
|
+
├── server/index.js ------------------------- http://localhost:3000, http://localhost:3000/products, http://localhost:3000/products/stickers, etc
|
|
529
563
|
└── public/logo.png ------------------------- http://localhost:3000/logo.png
|
|
530
564
|
```
|
|
531
565
|
|
|
@@ -567,7 +601,7 @@ Now we get the following handler-to-URL mapping for our application:
|
|
|
567
601
|
```shell
|
|
568
602
|
my-app
|
|
569
603
|
├── worker/index.js ------------------------- http://localhost:3000/about, http://localhost:3000/logo.png
|
|
570
|
-
├── server/index.js ------------------------- http://localhost:3000, http://localhost:3000/
|
|
604
|
+
├── server/index.js ------------------------- http://localhost:3000, http://localhost:3000/products, http://localhost:3000/products/stickers, etc
|
|
571
605
|
└── public/logo.png ------------------------- http://localhost:3000/logo.png
|
|
572
606
|
```
|
|
573
607
|
|
|
@@ -606,7 +640,7 @@ Our overall handler-to-URL mapping for this application now becomes:
|
|
|
606
640
|
my-app
|
|
607
641
|
├── client/index.js ------------------------- http://localhost:3000/login
|
|
608
642
|
├── worker/index.js ------------------------- http://localhost:3000/about, http://localhost:3000/logo.png
|
|
609
|
-
├── server/index.js ------------------------- http://localhost:3000, http://localhost:3000/
|
|
643
|
+
├── server/index.js ------------------------- http://localhost:3000, http://localhost:3000/products, http://localhost:3000/products/stickers, etc
|
|
610
644
|
└── public/logo.png ------------------------- http://localhost:3000/logo.png
|
|
611
645
|
```
|
|
612
646
|
|
|
@@ -692,7 +726,7 @@ In a Multi Page Application (with an individual-page architecture), each page is
|
|
|
692
726
|
my-app
|
|
693
727
|
└── public
|
|
694
728
|
├── about/index.html ------------------------- <!DOCTYPE html>
|
|
695
|
-
├──
|
|
729
|
+
├── products/index.html ---------------------- <!DOCTYPE html>
|
|
696
730
|
├── index.html ------------------------------- <!DOCTYPE html>
|
|
697
731
|
├── header.html ------------------------------ <header></header> <!-- To appear at top of each index.html page -->
|
|
698
732
|
└── footer.html ------------------------------ <footer></footer> <!-- To appear at bottom of each index.html page -->
|
|
@@ -704,7 +738,7 @@ In a Single Page Application, each page is the same `index.html` document, and i
|
|
|
704
738
|
my-app
|
|
705
739
|
└── public
|
|
706
740
|
├── about/main.html -------------------------- <main></main> <!-- To appear at main area of index.html -->
|
|
707
|
-
├──
|
|
741
|
+
├── products/main.html ----------------------- <main></main> <!-- To appear at main area of index.html -->
|
|
708
742
|
├── main.html -------------------------------- <main></main> <!-- To appear at main area of index.html -->
|
|
709
743
|
└── index.html ------------------------------- <!DOCTYPE html>
|
|
710
744
|
```
|
|
@@ -876,7 +910,7 @@ It's all a *layout* thing, so a hybrid of the two architectures above is possibl
|
|
|
876
910
|
my-app
|
|
877
911
|
└── public
|
|
878
912
|
├── about/index.html ------------------------- <!DOCTYPE html> <!-- Document root 1 -->
|
|
879
|
-
├──
|
|
913
|
+
├── products
|
|
880
914
|
│ ├── free/main.html --------------------------- <main></main> <!-- To appear at main area of document root 2 -->
|
|
881
915
|
│ ├── paid/main.html --------------------------- <main></main> <!-- To appear at main area of document root 2 -->
|
|
882
916
|
│ ├── main.html -------------------------------- <main></main> <!-- To appear at main area of document root 2 -->
|
|
@@ -886,7 +920,7 @@ my-app
|
|
|
886
920
|
└── footer.html ------------------------------ <footer></footer> <!-- To appear at bottom of each document root -->
|
|
887
921
|
```
|
|
888
922
|
|
|
889
|
-
The above gives us three document roots: `/index.html`, `/about/index.html`, `/
|
|
923
|
+
The above gives us three document roots: `/index.html`, `/about/index.html`, `/products/index.html`. The `/products` route doubles as a Single Page Application such that visiting the `/products` route loads the document root `/products/index.html` and lets Webflo SPA routing determine which of `/products/main.html`, `/products/free/main.html`, `/products/paid/main.html` is imported on a given URL.
|
|
890
924
|
|
|
891
925
|
Webflo ensures that only the amount of JavaScript for a document root is actually loaded! So, above, a common JavaScript build is shared across the three document roots alongside an often tiny root-specific build.
|
|
892
926
|
|
|
@@ -1973,10 +2007,15 @@ A simple tool, like [`staticgen`](https://github.com/tj/staticgen), or the basic
|
|
|
1973
2007
|
|
|
1974
2008
|
Webflo comes *convention-first*! But it is entirely configurable for when you need it! The easiest way to do this is to run the command `webflo config` and follow the walkthrough. To simply get an overview, use the command `webflo config help`, and all commands and their description are shown.
|
|
1975
2009
|
|
|
1976
|
-
##
|
|
2010
|
+
## Webflo Tooling
|
|
1977
2011
|
|
|
1978
2012
|
Webflo applications are often built on/with the following technologies.
|
|
1979
2013
|
|
|
2014
|
+
+ [OOHTML](#oohtml)
|
|
2015
|
+
+ [OOHTML SSR](#oohtml-ssr)
|
|
2016
|
+
+ [OOHTML CLI](#oohtml-cli)
|
|
2017
|
+
+ [The Observer API](#the-observer-api)
|
|
2018
|
+
|
|
1980
2019
|
### OOHTML
|
|
1981
2020
|
|
|
1982
2021
|
[OOHTML](https://github.com/webqit/oohtml) is a proposed set of new features for HTML that makes it fun to hand-author your HTML documents! Within OOHTML are [HTML Modules](https://github.com/webqit/oohtml#html-modules) and [HTML Imports](https://github.com/webqit/oohtml#html-imports), [Reactive Scripts](https://github.com/webqit/oohtml#subscript) and more!
|