@webqit/webflo 0.11.9 → 0.11.12
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 +25 -25
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -566,7 +566,7 @@ But, we can also access the route in a way that gets the data rendered into the
|
|
|
566
566
|
Now, for Single Page Applications, subsequent navigations, after the initial page load, just ask for the data on destination URLs and perform [Client-Side Rendering](#client-and-server-side-rendering) on the same running document. Navigation is sleek and instant!
|
|
567
567
|
|
|
568
568
|
> **Note**
|
|
569
|
-
> <br>Unless disabled, [SPA Routing](#
|
|
569
|
+
> <br>Unless disabled, [SPA Routing](#spa-routing) is automatically built into your app's JS bundle from the `npm run generate` command. So, it just works!
|
|
570
570
|
|
|
571
571
|
With no extra work, your application can function as either a *Multi Page App (MPA)* or a *Single Page App (SPA)*!
|
|
572
572
|
|
|
@@ -1258,13 +1258,13 @@ Unless disabled in config, it is factored-in at build time for the application c
|
|
|
1258
1258
|
+ If navigation is initiated from a form element that has the `target` attribute, navigation is allowed to work the default way - regardless of the first rule above.
|
|
1259
1259
|
|
|
1260
1260
|
<details>
|
|
1261
|
-
<summary>Default
|
|
1262
|
-
|
|
1263
|
-
> File: `.webqit/webflo/client.json` | Command: `webflo config client spa_navigation=TRUE`
|
|
1261
|
+
<summary>Config (Default)</summary>
|
|
1264
1262
|
|
|
1265
1263
|
```json
|
|
1266
1264
|
{ "spa_navigation": true }
|
|
1267
1265
|
```
|
|
1266
|
+
|
|
1267
|
+
> File: `.webqit/webflo/client.json` | Command: `webflo config client spa_navigation=TRUE`
|
|
1268
1268
|
</details>
|
|
1269
1269
|
|
|
1270
1270
|
##### SPA State
|
|
@@ -1406,13 +1406,13 @@ One more thing: HTML forms can only accept two HTTP methods on their `method` at
|
|
|
1406
1406
|
Webflo client-side applications are intended to provide an app-like-first experience. So unless disabled in config, a [Service Worker](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) is built as part of your application on running the `npm run generate` command. You may define [route handlers in the `/worker` directory](#handler-functions-and-layout) of your application, and these will be built into the service worker to handle Same-Origin requests of the application. Where there are no *worker* handlers, or where these forward incoming requests, requests are fetched, either from the cache, or from the network, depending on the fetching strategy built into the Service Worker.
|
|
1407
1407
|
|
|
1408
1408
|
<details>
|
|
1409
|
-
<summary>Default
|
|
1410
|
-
|
|
1411
|
-
> File: `.webqit/webflo/client.json` | Command: `webflo config client enable_service_worker=TRUE`
|
|
1409
|
+
<summary>Config (Default)</summary>
|
|
1412
1410
|
|
|
1413
1411
|
```json
|
|
1414
|
-
{ "
|
|
1412
|
+
{ "service_worker_support": true }
|
|
1415
1413
|
```
|
|
1414
|
+
|
|
1415
|
+
> File: `.webqit/webflo/client.json` | Command: `webflo config client service_worker_support=TRUE`
|
|
1416
1416
|
</details>
|
|
1417
1417
|
|
|
1418
1418
|
##### Fetching Strategy
|
|
@@ -1420,9 +1420,7 @@ Webflo client-side applications are intended to provide an app-like-first experi
|
|
|
1420
1420
|
+ **Network First** - This strategy tells the Service Worker to always attempt fetching from the network first for given resources, before fetching from the cache. On every successful network fetch, a copy of the response is saved to the cache for next time. (This is good for resources that need to be fresh to the user on a "best effort" basis.) Unless changed, this is Webflo's default fetching strategy. When not the default strategy, a list of specific URLs that should be fetched this way can be configured.
|
|
1421
1421
|
|
|
1422
1422
|
<details>
|
|
1423
|
-
<summary>Default
|
|
1424
|
-
|
|
1425
|
-
> File: `.webqit/webflo/client.json` | Command: `webflo config client default_fetching_strategy=network-first`
|
|
1423
|
+
<summary>Config (Default)</summary>
|
|
1426
1424
|
|
|
1427
1425
|
```json
|
|
1428
1426
|
{ "default_fetching_strategy": "network-first" }
|
|
@@ -1433,14 +1431,14 @@ Webflo client-side applications are intended to provide an app-like-first experi
|
|
|
1433
1431
|
```json
|
|
1434
1432
|
{ "network_first_urls": [ "/logo.png" ] }
|
|
1435
1433
|
```
|
|
1434
|
+
|
|
1435
|
+
> File: `.webqit/webflo/worker.json` | Command: `webflo config worker default_fetching_strategy=network-first`
|
|
1436
1436
|
</details>
|
|
1437
1437
|
|
|
1438
1438
|
+ **Cache First** - This strategy tells the Service Worker to always attempt fetching from the cache first for given resources, before fetching from the network. After serving a cached response, or where not found in cache, a network fetch happens and a copy of the response is saved to the cache for next time. (This is good for resources that do not critially need to be fresh to the user.) When not the default strategy, a list of specific URLs that should be fetched this way can be configured.
|
|
1439
1439
|
|
|
1440
1440
|
<details>
|
|
1441
|
-
<summary>
|
|
1442
|
-
|
|
1443
|
-
> File: `.webqit/webflo/client.json` | Command: `webflo config client default_fetching_strategy=cache-first`
|
|
1441
|
+
<summary>Config (Alternative)</summary>
|
|
1444
1442
|
|
|
1445
1443
|
```json
|
|
1446
1444
|
{ "default_fetching_strategy": "cache-first" }
|
|
@@ -1451,14 +1449,14 @@ Webflo client-side applications are intended to provide an app-like-first experi
|
|
|
1451
1449
|
```json
|
|
1452
1450
|
{ "cache_first_urls": [ "/logo.png" ] }
|
|
1453
1451
|
```
|
|
1452
|
+
|
|
1453
|
+
> File: `.webqit/webflo/worker.json` | Command: `webflo config worker default_fetching_strategy=cache-first`
|
|
1454
1454
|
</details>
|
|
1455
1455
|
|
|
1456
1456
|
+ **Network Only** - This strategy tells the Service Worker to always fetch given resources from the network only. They are simply not available when offline. (This is good for resources that critially need to be fresh to the user.) When not the default strategy, a list of specific URLs that should be fetched this way can be configured.
|
|
1457
1457
|
|
|
1458
1458
|
<details>
|
|
1459
|
-
<summary>
|
|
1460
|
-
|
|
1461
|
-
> File: `.webqit/webflo/client.json` | Command: `webflo config client default_fetching_strategy=network-only`
|
|
1459
|
+
<summary>Config (Alternative)</summary>
|
|
1462
1460
|
|
|
1463
1461
|
```json
|
|
1464
1462
|
{ "default_fetching_strategy": "network-only" }
|
|
@@ -1469,14 +1467,14 @@ Webflo client-side applications are intended to provide an app-like-first experi
|
|
|
1469
1467
|
```json
|
|
1470
1468
|
{ "network_only_urls": [ "/logo.png" ] }
|
|
1471
1469
|
```
|
|
1470
|
+
|
|
1471
|
+
> File: `.webqit/webflo/worker.json` | Command: `webflo config worker default_fetching_strategy=network-only`
|
|
1472
1472
|
</details>
|
|
1473
1473
|
|
|
1474
1474
|
+ **Cache Only** - This strategy tells the Service Worker to always fetch given resources from the cache only. (This is good for resources that do not change often.) When not the default strategy, a list of specific URLs that should be fetched this way can be configured. The listed resources are pre-cached ahead of when they'll be needed - and are served from the cache each time. (Pre-caching happens on the one-time `install` event of the Service Worker.)
|
|
1475
1475
|
|
|
1476
1476
|
<details>
|
|
1477
|
-
<summary>
|
|
1478
|
-
|
|
1479
|
-
> File: `.webqit/webflo/client.json` | Command: `webflo config client default_fetching_strategy=cache-only`
|
|
1477
|
+
<summary>Config (Alternative)</summary>
|
|
1480
1478
|
|
|
1481
1479
|
```json
|
|
1482
1480
|
{ "default_fetching_strategy": "cache-only" }
|
|
@@ -1487,6 +1485,8 @@ Webflo client-side applications are intended to provide an app-like-first experi
|
|
|
1487
1485
|
```json
|
|
1488
1486
|
{ "cache_only_urls": [ "/logo.png" ] }
|
|
1489
1487
|
```
|
|
1488
|
+
|
|
1489
|
+
> File: `.webqit/webflo/worker.json` | Command: `webflo config worker default_fetching_strategy=cache-only`
|
|
1490
1490
|
</details>
|
|
1491
1491
|
|
|
1492
1492
|
In all cases above, the convention for specifying URLs for a strategy accepts [URL patterns](https://developer.mozilla.org/en-US/docs/Web/API/URLPattern) - against which URLs can be matched on the fly. For example, to place all files in an `/image` directory (and subdirectories) on the *Cache First* strategy, the pattern `/image/*` can be used. To place all `.svg` files in an `/icons` directory (including subdirectories) on the *Cache Only* strategy, the pattern `/icons/*.svg` can be used. (Specifically for the *Cache Only* strategy, patterns are resolved at Service Worker build-time, and each pattern must match, at least, a file.)
|
|
@@ -1718,17 +1718,17 @@ Webflo applications are often built on/with the following technologies.
|
|
|
1718
1718
|
Webflo natively supports OOHTML in full! But it is also possible to switch this to none, or to partial support - when specific features aren't needed anywhere in your application. Server-side and client-side support for OOHTML exist independently. This is good when, for example, your application places more importance on SSR, and less on CSR, in which case a reduced support for OOHTML can reduce the overall client JS bundle size.
|
|
1719
1719
|
|
|
1720
1720
|
<details>
|
|
1721
|
-
<summary>Default
|
|
1722
|
-
|
|
1723
|
-
> File: `.webqit/webflo/client.json` | Command: `webflo config client oohtml_support=full`
|
|
1724
|
-
|
|
1725
|
-
> File: `.webqit/webflo/client.json` | Command: `webflo config server oohtml_support=full`
|
|
1721
|
+
<summary>Config (Default)</summary>
|
|
1726
1722
|
|
|
1727
1723
|
```json
|
|
1728
1724
|
{ "oohtml_support": "full" }
|
|
1729
1725
|
```
|
|
1730
1726
|
|
|
1731
1727
|
*Values: `full`, `namespacing`, `scripting`, `templating`, `none` - See [details at OOHTML SSR](https://github.com/webqit/oohtml-ssr#options)*
|
|
1728
|
+
|
|
1729
|
+
> File: `.webqit/webflo/client.json` | Command: `webflo config client oohtml_support=full`
|
|
1730
|
+
|
|
1731
|
+
> File: `.webqit/webflo/server.json` | Command: `webflo config server oohtml_support=full`
|
|
1732
1732
|
</details>
|
|
1733
1733
|
|
|
1734
1734
|
|