|
| 1 | +<!DOCTYPE HTML><script Modulo src="/static/js/Modulo.js" -src="/static/"></script><cms-MarkdownPage><script type=md>--- |
| 2 | +title: Update + Beta Info |
| 3 | +devlog: 2025-01 |
| 4 | +--- |
| 5 | + |
| 6 | + |
| 7 | +I'm happy to announce the release of Alpha 0.0.74, which documents and fixes some |
| 8 | +much needed tweaks to Alpha 73, while still keeping it all under 2000 lines of code. |
| 9 | +These are essential to continue to move to _Include_-focused architecture. |
| 10 | + |
| 11 | + |
| 12 | +## Alpha 74 |
| 13 | + |
| 14 | + |
| 15 | +### Alpha 74 New Feature |
| 16 | + |
| 17 | +The big new feature from the last release is the _Include_ definition. |
| 18 | + |
| 19 | +Previously, we only focused on it being used to include LINK |
| 20 | + |
| 21 | +Not only that, but it supports a "NPM-light" sort of usage as well, that allows |
| 22 | +you to quickly include JS and CSS, instantly accessing many NPM packages. |
| 23 | + |
| 24 | +### New behavior: Blocking by default. |
| 25 | + |
| 26 | +New behavior: _Includes_ are now blocking by default. To disable this behavior, use `async`. |
| 27 | + |
| 28 | +By default, _Include_ blocks loading. This means that _Configuration_ scripts can freely reference |
| 29 | +things loaded. This can be disabled with the `-async:=true` setting. See below: |
| 30 | + |
| 31 | +``` |
| 32 | +<Include -async:=true> |
| 33 | + <script src="https://cdn.jsdelivr.net/npm/ [email protected]/dist/quill.js">/script> |
| 34 | +</Include> |
| 35 | +<script Configuration> |
| 36 | + console.log(window.Quill) // will be undefined |
| 37 | +/script> |
| 38 | +``` |
| 39 | + |
| 40 | +However, without `-async`, the _Include_ becomes blocking. So, the following would work as intended: |
| 41 | + |
| 42 | +``` |
| 43 | +<Include> <!-- defaults to -async:=false --> |
| 44 | + <script src="https://cdn.jsdelivr.net/npm/ [email protected]/dist/quill.js">/script> |
| 45 | +</Include> |
| 46 | +<script Configuration> |
| 47 | + // Modulo will pause everything until the quill script's onload event fires |
| 48 | + console.log(window.Quill) // Will be defined, since the script is loaded |
| 49 | +/script> |
| 50 | +``` |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | +### New settings: `-load-mode` and Component includes |
| 55 | + |
| 56 | +### Example 1: Un-bundled include |
| 57 | + |
| 58 | +By default, `-load-mode="bundled"`. However, you can set it to `-load-mode="lazy"` to make it only |
| 59 | +load later. |
| 60 | + |
| 61 | +``` |
| 62 | +<Include -load-mode="lazy"> |
| 63 | + <link href="https://cdn.jsdelivr.net/npm/ [email protected]/dist/quill.snow.css" rel="stylesheet" /> |
| 64 | + <script src="https://cdn.jsdelivr.net/npm/ [email protected]/dist/quill.js">/script> |
| 65 | +</Include> |
| 66 | +<script Configuration> |
| 67 | + console.log(window.Quill) // Will be defined, but when built, will not be in bundle (will be separate tag) |
| 68 | +/script> |
| 69 | +``` |
| 70 | + |
| 71 | + |
| 72 | +### Example 2: Component includes |
| 73 | + |
| 74 | +Includes can now be embedded in `<Component>` as well: |
| 75 | + |
| 76 | +``` |
| 77 | +<Component> |
| 78 | + <Include -load-mode="lazy"> |
| 79 | + <link href="https://cdn.jsdelivr.net/npm/ [email protected]/dist/quill.snow.css" rel="stylesheet" /> |
| 80 | + <script src="https://cdn.jsdelivr.net/npm/ [email protected]/dist/quill.js">/script> |
| 81 | + </Include> |
| 82 | +</Component> |
| 83 | +``` |
| 84 | + |
| 85 | +This is super useful when combined with load-modes, since then you can have certain JavaScript or CSS only |
| 86 | +load when a component first appears. |
| 87 | + |
| 88 | +### New settings: `-server` for package management |
| 89 | + |
| 90 | + |
| 91 | +Use `-server="..."` - use for packages from NPM. Thus, _Include_ can be used kind of like |
| 92 | +a simple `package.json`-type version locking system. See the following: |
| 93 | + |
| 94 | +``` |
| 95 | +<Include |
| 96 | + -server="unpkg.com" |
| 97 | + my-package="3.2.5" |
| 98 | + my-other-package="5.2.3" |
| 99 | +></Include> |
| 100 | +``` |
| 101 | + |
| 102 | + |
| 103 | + |
| 104 | + |
| 105 | +## Modulo Beta Teaser - Coming soon! |
| 106 | + |
| 107 | +These last releases represent some of the last big feature additions until the Modulo |
| 108 | +beta, `Modulo.js v0.1.0`! In the mean time, check out the following early work in |
| 109 | +progress "teasers" of what's in store: |
| 110 | + |
| 111 | +### Coming soon: Modulo Studio |
| 112 | + |
| 113 | +The embedded, mini-editor is getting a major remix with the Modulo JS Beta |
| 114 | +release. This enables all Modulo users to take advantage of it's |
| 115 | +ultra-minimalist structure, as an easy-to-use "glue" to combine editors, |
| 116 | +previewers and in-browser emulators, and more. This creates an ultra-simple set |
| 117 | +of building-blocks for IDEs, embedded editors, and even graphical WYZIWIG |
| 118 | +editors. |
| 119 | + |
| 120 | +For example, a simple website editor IDE might be assembled as such: |
| 121 | + |
| 122 | +``` |
| 123 | +<Component name="WebEditor"> |
| 124 | + <!-- Include some core editor HTML and CSS --> |
| 125 | + <Template -src="./parts/EditorBase.html"></Template> |
| 126 | + <Style -src="./parts/EditorBase.css"></Style> |
| 127 | + |
| 128 | + <!-- Include the Virtual Browser part, which enables a preview --> |
| 129 | + <VBrowser></VBrowser> |
| 130 | + |
| 131 | + <!-- Load a sample website into the virtual browser --> |
| 132 | + <Template |
| 133 | + -file="index.html" |
| 134 | + -name="index_template" |
| 135 | + -default-view |
| 136 | + -default-edit> |
| 137 | + <h1>Hello web world!</h1> |
| 138 | + <p>Edit me...</p> |
| 139 | + </Template> |
| 140 | + |
| 141 | + <!-- Define menus, buttons, etc --> |
| 142 | + <Template |
| 143 | + -button="run" |
| 144 | + -button-emoji="⟳" |
| 145 | + -button-click="vbrowser.refresh" |
| 146 | + -name="run_button_template" |
| 147 | + ><!-- (a "re-run" button) --></Template> |
| 148 | +</Component> |
| 149 | +``` |
| 150 | + |
| 151 | +WIP teaser: |
| 152 | +<https://modulo.codeberg.page/studio.html> |
| 153 | + |
| 154 | + |
| 155 | + |
| 156 | +### Coming soon: New, clean Modulo repo |
| 157 | + |
| 158 | +The Modulo [beta branch](https://codeberg.org/modulo/modulo) is being developed |
| 159 | +on Codeberg. Once complete, this minimalist repo structure will become the |
| 160 | +main repo, and the GitHub repo will be deprecated. |
| 161 | + |
| 162 | + |
| 163 | + |
| 164 | +### Coming soon: Modulo in the Wild |
| 165 | + |
| 166 | +The Modulo JS framework, despite still being only "alpha", has now been used to |
| 167 | +power everything from tiny app projects to building out multi-media experiences |
| 168 | +with thousands of users a day. It's time we start showcasing what the (tiny) |
| 169 | +Modulo community has been up to! There are _dozens_ of us! _Dozens!_ |
0 commit comments