Skip to content

Commit

Permalink
Merge pull request #4 from dashborg/dev-0.3.0
Browse files Browse the repository at this point in the history
Hibiki v0.3.0 Release
  • Loading branch information
sawka authored Feb 14, 2022
2 parents cf197e9 + 6ccd7a9 commit e73e43d
Show file tree
Hide file tree
Showing 42 changed files with 2,166 additions and 790 deletions.
419 changes: 373 additions & 46 deletions LICENSE

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions NOTICE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Copyright (c) 2021-2022 Dashborg Inc

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,17 +240,11 @@ Want to learn more? Check out the [Interactive Tutorial](https://playground.hib

---

## Open Source-ish
## Open Source

The source code for Hibiki HTML is available on GitHub at at: https://github.com/dashborg/hibiki . It is licensed under a modified form of the MIT license (similar in spirit to the Confluent open source license) which allows you to use Hibiki HTML without restrictions for almost all personal or commercial projects.
The source code for Hibiki HTML is available on GitHub at at: https://github.com/dashborg/hibiki . It is licensed under the Mozilla Public License v2.0 -- https://mozilla.org/MPL/2.0/ .

You just can't create a SaaS service offering a hosted version of Hibiki HTML or one that allows 3rd party users or customers to use the Hibiki HTML language or tags to offer customizability for an existing product or service (see [LICENSE](https://github.com/dashborg/hibiki/blob/main/LICENSE)).

Note that you are always free to copy the Hibiki source and minified builds to your own server, CDN, or hosting service.

The Hibiki HTML license is *not* OSI approved.
I know this is an ideological deal-breaker for some, but if you have a purely practical concern, I'm happy
to offer a proprietary license that satisfies your legal department.
Mozilla has an excellent [FAQ](https://www.mozilla.org/en-US/MPL/2.0/FAQ/), but basically this license allows you to use Hibiki HTML in any project (personal, commercial, or open-source). The only restriction is if you modify any of the *Hibiki HTML source files* you must make the source code of those changes available.

## Credits

Expand Down
45 changes: 45 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,50 @@
# Change Log

## v0.3.0

Hibiki HTML is now licensed under the OSI approved MPL v2 (Mozilla Public License)!
More information here: https://www.mozilla.org/en-US/MPL/2.0/FAQ/

Lots of under the hood changes to make writing UI component libraries
easier and more straight-forward. Tightened up the core tag library
by removing 'h-if', 'h-withcontext', 'h-foreach', and 'h-if-break' (all of that
functionality is available via attributes or other constructs).

* 'unwrap' attribute to remove an enclosing tag and just render its children as a fragment
* allow <define-vars> to receive context as a text node
* dev builds report a version number
* custom nodes fire an internal 'init' event when first created (before rendering)
* do not throw an error when setting a read-only value (silently ignore) -- e.g. setting value in args root
* h-text will show '[noattr]' when printing noattr value instead of null
* added ChildrenVar.filter to allow filtering of children by LambdaValue expression
* added ChildrenVar.size -- returns number of children in ChildrenVar
* fixes and improved consistency for using and filtering multiple levels of children nodes
* consistent behavior of "if-break" and "define-vars" when embedded as children of custom component
* breaking: removed ChildrenVar.list (inconsisten behavior, not resolved)
* added ChildrenVar.node (first node of ChildrenVar)
* added ChilcrenVar.nodes (array of node objects)
* added innerhtml and outerhtml to node var
* updated when welcome message and usage ping to fire on library load. can be suppressed using HibikiGlobalConfig
* updated click and submit handlers to only automatically call event.preventDefault() when the href or action attributes are not present or set to "#".
* removed h-withcontext node (define-vars is more powerful)
* removed h-if, h-foreach, h-if-break. can all be accessed by adding attributes to existing nodes (or to h-fragment nodes)
* define-vars, inline context attribute renamed from 'context' to 'datacontext' (to match h-children)
* define-component, initial component data attribute renamed from 'defaults' to 'componentdata'
* added new fn:floor and fn:ceil math functions, and fn:deepcopy
* define-vars, datacontext, and componentdata blocks are now parsed once when HTML is loaded (not on demand)
* components now fire 'mount' event internally (as well as externally)
* change to grammar to allow functions (fn) to receive named parameters
* added spaceship '<=>' operator for comparison
* 'noattr == null' is now true, added 'isnoattr(expr)' to distinguish the noattr case
* added new fn:uppercase and fn:lowercase string functions
* added new fn:compare function (supports locales, sensitivity, and numeric/string comparisons)
* added new fn:sort function (uses fn:compare options) with makerefs parameter which can sort an array as references to link sorted values with originals
* add makerefs parameter to fn:slice, allowing the returned array to link to the original
* when evaluating a raw() expression, allow creation of sub-references. if raw(@v) is a refernce, now raw(@v.subfield) will also evaluate to a reference.
* bugfix: class.[class] was not being properly set to false when set to the Hibiki value false
* bugfix: and/or operators were not correctly evaluating 'noattr' as false
* bugfix: fix component defaults, define-vars, and h-withcontext, to never update mobx state

## v0.2.0

Large updates behind the scenes to make the Hibiki HTML data model more consistent.
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "hibiki",
"version": "0.2.0",
"version": "0.3.0",
"description": "Hibiki HTML",
"main": "dist/hibiki.js",
"repository": "https://github.com/sawka/hibiki",
"author": "Michael Sawka <[email protected]>",
"license": "See LICENSE in LICENSE",
"license": "MPL-2.0",
"devDependencies": {
"@babel/cli": "^7.16.0",
"@babel/core": "^7.16.0",
Expand Down
2 changes: 1 addition & 1 deletion playground/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=1200">
<title>Hibiki HTML Playground</title>
<link rel="preconnect" href="https://fonts.gstatic.com">
<script src="https://cdn.hibikihtml.com/hibiki/latest/hibiki-prod.min.js"></script>
<script src="https://cdn.hibikihtml.com/hibiki/v0.3.0/hibiki-prod.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="/playground.css">
Expand Down
2 changes: 1 addition & 1 deletion playground/libs/bulma.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<define-component name="checkbox">
<label class="checkbox">
<input type="checkbox" automerge change.handler="fire->change(@value)">
<h-children bind="@children.all"></h-children>
<h-children bind="@children"></h-children>
</label>
</define-component>

Expand Down
4 changes: 2 additions & 2 deletions playground/libs/playground.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@

<define-component name="menuitem">
<a click.handler="//@lib/switchpage(page=$args.page)" class.is-active="*$.activepage == $args.page" href="#">
<h-children bind="@children.all"></h-children>
<h-children bind="@children"></h-children>
</a>
</define-component>

<define-component name="onoff-button">
<button class="button" class.is-success="*$args.value" class.is-danger="*!$args.value"
click.handler="$args.value = !$args.value; fire->click($args.value)">
<h-children bind="@children.all"></h-children>
<h-children bind="@children"></h-children>
<span class="icon is-small ml-1">
<i if="$args.value" class="fa fa-check"></i>
<i if="!$args.value" class="fa fa-close"></i>
Expand Down
2 changes: 1 addition & 1 deletion playground/tutorial/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=1200">
<title>Hibiki HTML Tutorial</title>
<link rel="preconnect" href="https://fonts.gstatic.com">
<script src="https://cdn.hibikihtml.com/hibiki/latest/hibiki-prod.min.js"></script>
<script src="https://cdn.hibikihtml.com/hibiki/v0.3.0/hibiki-prod.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="/playground.css">
Expand Down
5 changes: 2 additions & 3 deletions playground/tutorial/t-components.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,12 @@ <h6 class="title is-6">Children</h6>
<p>
A special local variable <code>@children</code> is available inside of your component that holds
the child elements passed to your component. The <code>@children</code> variable allows for simple
filtering by tag name or <i>slot</i>, but the most common usage is to just include <i>all</i> of the
in your defined component. That is done by using the &lt;h-children&gt; tag with <code>@children.all</code>:
filtering by tag name or <i>slot</i>. You include children by using the &lt;h-children&gt; tag.
</p>
<pre>
&lt;define-component name="bulma-box">
&lt;div class="box">
&lt;h-children bind="@children.all">&lt;/h-children>
&lt;h-children bind="@children">&lt;/h-children>
&lt;/div>
&lt;/define-component>

Expand Down
2 changes: 1 addition & 1 deletion playground/tutorial/t-expr.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h4 class="title is-4">Data Expressions</h4>
<p>
When binding data, you can also use simple expressions. Hibiki HTML supports all of the standard
conditional and arithmetic operators:
<code>+, -, /, *, %, ==, !=, &gt;, &lt;, &gt;=, &lt;=, !, ||, &&</code>
<code>+, -, /, *, %, ==, !=, &gt;, &lt;, &gt;=, &lt;=, !, ||, &&, ??, &lt;=&gt;</code>
</p>
<p>
Hibiki also supports ternary conditionals:
Expand Down
2 changes: 1 addition & 1 deletion playground/tutorial/t-forms.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<div class="box">
File Input Example (creates a BLOB). Try uploading an image, and it will display inline.
<br>
<input type="file" value.bindpath="$.file">
<input class="input" type="file" value.bindpath="$.file">
<br>
$.file = {{ $.file }}
<br>
Expand Down
16 changes: 5 additions & 11 deletions playground/tutorial/t-intro.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h4 class="title is-4">Hibiki Introduction</h4>
<li><a href="#section3"><b>Backend Control</b></a>
<li><a href="#section4"><b>No Scaffolding</b></a>
<li><a href="#section5"><b>Libraries and Components</b></a>
<li><a href="#section6"><b>Open Source-<i>ish</i></b></a>
<li><a href="#section6"><b>Open Source</b></a>
<li><a href="#section7"><b>Support &amp; Help</b></a>
</ul>
<h4 class="title is-4">Easy to Get Started</h4>
Expand All @@ -31,7 +31,7 @@ <h4 class="title is-4">Easy to Get Started</h4>
<code>https://cdn.hibikihtml.com/hibiki/latest/hibiki-prod.min.js</code>
</p>
<p>
Wrap any portion of your content with a &lt;template hibiki&gt; tag and you have your first
Wrap any portion of your content with a &lt;template&nbsp;hibiki&gt; tag and you have your first
Hibiki HTML app. All plain HTML content is rendered as is, and because Hibiki HTML uses the browser's HTML parser,
it follows the same rules as standard HTML.
</p>
Expand Down Expand Up @@ -82,19 +82,13 @@ <h4 class="title is-4">Libraries and Components</h4>
importing ReactJS components.
</p>

<h4 class="title is-4">Open Source-<i>ish</i></h4>
<h4 class="title is-4">Open Source</h4>
<p>
<a class="content-anchor" name="section6"></a>
The source code for Hibiki HTML is available on GitHub at at: <a href="https://github.com/dashborg/hibiki" target="_blank">https://github.com/dashborg/hibiki</a>. It is licensed under a modified form of the MIT license (similar in spirit to the Confluent open source license) which allows you to use Hibiki HTML without restrictions for almost all personal or commercial projects.
The source code for Hibiki HTML is available on GitHub at at: <a href="https://github.com/dashborg/hibiki" target="_blank">https://github.com/dashborg/hibiki</a>. It is licensed under the OSI approved Mozilla Public License v2.0 -- <a href="https://mozilla.org/MPL/2.0/" target="_blank">https://mozilla.org/MPL/2.0/</a>.
</p>
<p>
You just can't create a SaaS service offering a hosted version of Hibiki HTML or one that uses the Hibiki HTML language to
offer 3rd party customizability for an existing product or service (see <a href="https://github.com/dashborg/hibiki/blob/main/LICENSE" target="_blank">LICENSE</a>).
</p>
<p>
The Hibiki HTML license is <i>not</i> OSI approved.
I know this is an ideological deal-breaker for some, but if you have a purely practical concern , I'm happy
to offer a proprietary license that satisfies your legal department.
Mozilla has an excellent <a href="https://www.mozilla.org/en-US/MPL/2.0/FAQ/" target="_blank">FAQ</a>, but basically this license allows you to use Hibiki HTML in any project (personal, commercial, or open-source) without triggering viral copyleft restrictions. The only restriction is if you modify any of the <i>*Hibiki HTML source files*</i> you must make the source code of those changes available.
</p>

<h4 class="title is-4">Support &amp; Help</h4>
Expand Down
2 changes: 1 addition & 1 deletion playground/tutorial/t-libraries.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ <h6 class="title is-6">Defining a Library</h6>
&lt;define-component name="checkbox">
&lt;label class="checkbox">
&lt;input type="checkbox" automerge change.handler="fire->change(@value)">
&lt;h-children bind="@children.all">&lt;/h-children>
&lt;h-children bind="@children">&lt;/h-children>
&lt;/label>
&lt;/define-component>

Expand Down
Loading

0 comments on commit e73e43d

Please sign in to comment.