Skip to content

Releases: kbrsh/moon

v1.0.0-beta.7

08 Feb 20:39
Compare
Choose a tag to compare
v1.0.0-beta.7 Pre-release
Pre-release

v1.0.0-beta.5

07 Jan 04:23
Compare
Choose a tag to compare
v1.0.0-beta.5 Pre-release
Pre-release
  • 5ccfee4: v1.0.0-beta.5

  • e44f475: update links

  • 377ae05: use cached storage

  • 2ee7ae9: add storage driver

  • 4bdd7b1: no comma dangle

  • e8d6cb7: explain parser and add test case for escaped comment delimiter

  • dd8fa7f: new syntax for nodes and comments

  • 1713d3a: new license link

  • 49d38ac: add route tests

    100% coverage!

  • a9d5cce: refactor browser

  • 5c8189f: revamp parser & generator

  • a32f80f: add test for failed cleanup

  • b94ea11: add test for failed child process execution

  • e01b9a6: add test for failed download in cli

  • cf8488b: add tests for failed http request in cli

  • 9be5cc4: add tests for invalid http status codes and fix error messages

  • 8ca4505: add cli tests for basic errors

  • 50dcfc9: update comment on how view driver works

  • 67a08cf: replace ariaset & dataset with attributes

  • 1eace08: use pad instead of repeat in cli help table

  • 06521d6: refactor main build script

  • 4af1e8c: refactor release scripts

  • 834d64b: use stat over lstat

  • 0bb77dd: add cli tests for create command

  • b042095: update file size

  • 2c97a77: add basic cli tests and remove perf tests

  • 7f44bef: match package readme to descriptions

  • a04365c: remove mvl

  • b030ccb: add version property to all modules

  • a8b1c96: change order of gitignore

  • 018cd3e: update descriptions and keywords

  • 0851dd3: consistent spacing in switch statements

  • 6cc066b: consistent error messages: failure of -> failed

  • 253e22d: handle filesystem errors in cli

  • 6170ffc: handle all http errors in cli

  • c43353b: refactor router

  • 989e749: route driver

  • b842b29: refactor moon cli

  • 7b391f8: style attributes -> style properties

  • 8f528af: hoist value when creating nodes and blur without check when removing focus

  • e7a7cd9: new view patch children storage

    Children are stored in Node.MoonChildren in order to optimize access
    of the DOM (such as childNodes or firstChild/nextSibling).

  • a2ffd83: move diff equality checks to children

  • 8a63274: remove extra check from view driver and use terser

  • 1e65d81: escape unescaped string characters in text correctly

  • af10f7d: remove special diff case for text

  • 06b5d0f: generate node creation functions in a loop

  • 8bb1eb2: update perf test

  • 1d453bb: declare all view functions manually

  • 3cddda0: allow escapes in text and optimize whitespace

  • a112d53: refactor generator

    Some things can be assumed by looking at the grammar. Blocks can be
    expected in node children and node data as an expression. In these
    cases, it is now assumed that they are blocks, and they are generated
    without surrounding parentheses.

  • 981c575: new MVL, compiler, and router

    First, this change involves a refactor of some of the module structure
    of the code to be consistent.

    Next, there is a new Moon View Language (MVL). It has three types of
    nodes:

    • Node: A node that is equivalent to the contents of the
      expression within it, analogous to a variable reference.
      • <{node}#>
    • Data Node: A node that is equivalent to a function call that can call
      a function with an expression directly or attributes to represent an
      object.
      • <{node} {data}/>
      • <{node} foo="bar" bar="baz"/>
    • Data & Children Node: A node that is equivalent to a function call
      with attributes representing an object along with support for children,
      which can include text, dynamic text blocks, and other nodes.
      • <{node} foo="bar" bar="baz">Text {dynamic} <node#></>
      • <p>Hello Moon!</p>

    This means that all nodes must now be functions, so Moon.view.m is now
    an object with keys being HTML elements and a special text element
    which takes a value data property. All elements must then usually be
    imported or declared at the top of files.

    The new parser uses parser combinators and comes with better error
    reporting that displays the line of the error, the surrounding lines,
    and the exact position where something was expected. It also supports
    full JavaScript syntax along with MVL, without needing parentheses
    around nodes.

    The new generator is much simpler and only generates function calls or
    variable references as appropriate for the node type in question. It
    doesn't do any static function call optimization as the nodes can be
    dynamic at any time. This can easily be done by the developer and
    included with a reference using a normal variable reference node.

    Lastly, work on the router has started. There is a simple file structure
    set up, a basic driver that changes the route using the history API,
    and a basic Link component that creates a elements with the data
    provided. Nothing fancy for now.

  • b56a09e: fix options terminal highlighting in CLI

    The options regular expression matched anything starting with a dash.
    This makes it so that a word must start with one or two dashes and a
    word must start with an opening bracket. There must be whitespace
    separating them.

  • b055b9a: remove extra break

  • 71c13a6: improve CLI UX

    Adds CLI commands, including a help command capable of displaying help
    messages for individual commands. This will make it easier for people to
    directly install moon-cli and work with it without having to reference
    the documentation for the previous simple but obscure behavior. There
    are now three commands, moon version, moon help, and moon create.
    They all have error messages and help messages to guide users through
    the process of using them. moon create now accepts the template as an
    option rather than a positional argument, using the -t or --template
    option instead.

  • d9cb7a7: add tests for multiple HTTP requests

    The HTTP driver can send multiple concurrent requests, but can only
    receive one at a time. If JavaScript were ever to get true parallelism,
    one could use multiple HTTP drivers to account for multiple physical
    network ports that could receive complete HTTP requests at the same
    time. This adds tests for sending multiple requests and receiving them
    individually.

  • 6eb9010: make HTTP request headers optional (#260)

    Extra HTTP request headers are usually not required. This change makes
    them optional and makes it so that the HTTP driver only requires the
    url field to perform a request. This also adds tests for using default
    HTTP requests that are both successful and result in an error.

  • 9838956: make HTTP request headers optional

    Extra HTTP request headers are usually not required. This change makes
    them optional and makes it so that the HTTP driver only requires the
    url field to perform a request. This also adds tests for using default
    HTTP requests that are both successful and result in an error.

  • 3d7174e: use consistent event for moon browser XHR (#259)

    In the HTTP driver, the onload event is used rather than
    addEventListener. This PR refactors Moon Browser to use the same
    method by using onload along with an arrow function to clean up the
    event handling code that adds the listener.

  • aab846f: use consistent event for moon browser XHR

    In the HTTP driver, the onload event is used rather than
    addEventListener. This PR refactors Moon Browser to use the same
    method by using onload along with an arrow function to clean up the
    event handling code that adds the listener.

  • 855db29: add basic http tests

    This includes tests for a successful load event and an error event. It
    currently provides every single parameter, including optional ones.
    However, it does test that the request/response headers and body are
    sent properly using a mock XHR implementation.

  • b13176a: add basic http tests

    This includes tests for a successful load event and an error event. It
    currently provides every single parameter, including optional ones.
    However, it does test that the req...

Read more

v1.0.0-beta.4

09 Aug 20:05
Compare
Choose a tag to compare
v1.0.0-beta.4 Pre-release
Pre-release

v1.0.0-beta.3

09 Aug 00:32
Compare
Choose a tag to compare
v1.0.0-beta.3 Pre-release
Pre-release
  • d2d94fb: v1.0.0-beta.3

  • 623adb6: print test results prior to release

  • 5fabdcb: update cli logs

  • a42150c: preserve lines

  • 068479a: end sourcemap

  • 69dca46: begin sourcemap

  • ad18b76: remove type field from view nodes

    This removes the type field from view nodes and removes normalization
    from nodes during compilation. It prevents inconsistencies when using
    data fields in default components because they won't support the
    "class" -> "className" or "for" -> "htmlFor" transformation. Instead of
    that, the whole concept of types was removed because it was mainly to
    distinguish between components and nodes, but now it isn't needed.
    Instead, the type field is gone and the patch checks for name === "text"
    instead. Also, there are individual checks for "class" and "for" that
    set, update, or remove their corresponding properties.

  • 8165998: consistent modules

  • c7f2afc: simplify API and file structure

  • 3417a73: update comment wording

  • b9ac3ef: optimize static expressions

  • 20a5076: allow whitespace in parens for views

  • 4dc9630: allow views in nested parens

  • 392dc0d: add quote type

  • 21120f6: load all scripts in order

  • fcee45f: update package READMEs

  • 16a7af7: fix version in builds

  • 265252e: functional driver-based design

  • 88a997e: add node constructor in perf test

  • b1dc9c8: update comment

  • f9137b1: one-phase executor w/ event batching

  • fe4bc0a: make component execution preserve immutability

  • a5bcd3b: test locals against globals and existing locals

  • b9a219d: use child function for loops

  • 6c7dd9a: keep track of locals and remove need for $ sigil

  • ea86567: make function global

  • e5583f0: lex names manually and fix extra increment

  • 87e2222: store DOM node in remove property cache

  • 2dabfc1: exclude wrapper from coverage

  • ddc2007: fix static children skip & add time slicing tests

  • 0ab04ab: remove unneeded id

  • 6d63f65: add index tests

  • 8fbc9f7: clean up for element generator

  • 47a9c7d: executor fuzz tests

  • 124671c: prefer 'in' check vs undefined

  • a76be1e: build

  • c299d03: remove data property by setting to default value

  • 4945a16: fix replaceChild & removeDataSet

  • c6b5e19: finish assertions for executor tests

  • a5fc4cf: executor test suite

  • 1354e5e: allow using children data and attribute

  • 99b1e6f: execute created components, format with tabs, and use const

  • 5cc1f99: reuse static nodes

  • df0df7a: static element nodes + generator tests

  • 3ed1572: update contributing guide

  • 6b49118: don't merge default data on root components

  • 889a778: update summary

  • 00a2e6e: diff-patch executor

  • ee07a21: fix executor queue

  • 9e3d9c8: larger logo

  • b29c2b2: clean up readme

  • e009757: only require static children to prevent double optimization

  • 87fa3a3: consistent ordering

  • c260207: add moon DOM properties to node prototype

  • b746b3a: eager remove data from queue

  • 6069201: remove source from perf

  • d600a18: remove view current

  • b3af5f2: update jsdoc comment

  • e9a7ec4: append performance

  • 749adf3: remove wrong map in empty loop

  • dd31f99: use generator variable for loop iterator

  • 24c2e81: optimize object lookup

  • 8608982: consistent comments

  • 0819ef2: view = component(data, children)

  • 816f1bf: use constructors for nodes

  • 808ff50: view-patch executor

  • 0c3a1a8: update with default data

  • 16cbc7c: cleaner API

  • 7c1ae49: inline defaultObject

  • a6689e8: add event listeners when needed

  • 8dca414: compare type and name for replace node

  • 03ced07: two phase executor

  • c61e423: optimize default object

  • 1a75f8a: customize wrapper in & refactor lexer

  • 26ce80d: refactor set attribute updates

  • a8ff725: state based attribute lexer

  • af0a86e: allow nested text expressions

  • 45ad76f: allow nested objects in attributes

  • 9ab1f3c: support ariaset, dataset, and style attributes

  • c27bac3: remove *bind

  • a4a21b4: refactor lexer attribute conditions

  • 39af32c: add *bind syntax

  • 1bf16e8: consistent check for events

  • 96280ad: use className in MVL

  • c206837: prefer to use DOM properties

  • 7e4ea03: optimize event attribute check

  • 9d40f81: require event handler name and call with (event, data)

  • 5d5b889: use an object instead of an array for static nodes

  • 06cc9e3: use data instead of textContent

  • 3bacbfd: start renderer with old attributes

  • 4d0e4b3: allow for more flexible mvl with space attributes

  • 38ea007: refactor variable

  • f17f8c8: use new attribute shape in mvl

  • af9c57d: fix if clause condition duplicate bug

  • 9b4d608: identify static attributes correctly

  • 1b21a0f: add Moon.get

  • 7f9e660: remove old attributes

  • 65eaffe: only update text if changed

  • 7b0542d: escape text in lexer

  • 68925af: refactor error

  • f21f30f: require the root option if the component is "Root"

  • 099e60f: use development Moon for MVL compiler

  • 69e6eec: don't add classes to components

  • 6c320cd: enforce dot notation

  • ae20fdb: use dot notation

  • 421a473: consistent naming from type -> name

  • 6b46e79: update events

  • 5c90cc5: local static nodes for each component

  • 426714c: custom hot reloading no longer required

  • fb3098d: correct hot module reloading code

  • 4f643dc: lex before parse and use correct addClass reference

  • d09376d: executable comment build

  • 9ccab57: allow executable packages

  • 7cdab52: use cjs for mvl

  • ed92721: build transforms

  • 66dadb6: use modules for moon MVL

  • 72c9bdc: update MVL compiler for new Moon

  • 2dac090: use convention for moon cli

  • ae0fdb0: add object shorthand eslint option

  • 0cd9a4a: use hoist optimization in diff phase

  • cd5eb0d: add parser test for invalid children

  • dd0ced2: add lexer event tests

  • 1fff587: fix tests

  • 27f93c8: prefix default array loop iterator

  • 287aa85: hoist static nodes

  • acd98dc: add support for boolean attributes (fixes #238)

  • a51aced...

Read more

v1.0.0-beta.2

13 Aug 06:24
Compare
Choose a tag to compare
v1.0.0-beta.2 Pre-release
Pre-release

v1.0.0-beta.1

19 Jul 00:35
Compare
Choose a tag to compare
v1.0.0-beta.1 Pre-release
Pre-release
Read more

v0.11.0

14 Jul 16:26
Compare
Choose a tag to compare

Minor Changes

  • Add support for different input types in 'm-model' (fixes #52): e66280c
  • Allow and enforce data to be a function in components: 640b407
  • Change naming of component cache: 63ec30e
  • Support dynamic values for m-model with radio buttons: e755dd4
  • Begin adding support for dynamic event listeners, add support for arrays, objects, and numbers for 'm-for' (fixes #62): 0093de7
  • Make eventListeners dynamic (added if needed), and add advanced optimizations ⚡: aee07e3
  • Breaking: remove custom delimiters: b12b904
  • Use custom vdom 'm' instead of hyperscript: 8dec037
  • Remove merge utility: fd8aae0
  • Add support for parent-child communication through custom events: 6f88c83

Patches

  • Avoid many lookups in lexer: c5805ba
  • Make lexer more flexible and allow '<' in html: fd7c4ef
  • Add license (fixes #50): da9b6fa
  • Fix emit: 3c870ee
  • Cache attributes in codegen for model: fa90210
  • Faster way of computing dependencies for 'm-model': 1002f79
  • Support dynamic paths in model much faster: 0f4a669
  • Correctly extract dynamic path: f05e97f
  • Optimize lookups when adding event listeners: 2509ffd
  • Add more reserved globals: 0299ec7
  • Correctly have current position in state be tracked in lexer: ed10e15
  • Lex attributes faster: 167c478
  • Check if element has attributes correctly (fixes #59): 93d9f14
  • Fix spacing in generated dependency code: ebd43c2
  • Faster unmount component when replacing node: b133e86
  • Optimize prop merger for functional components, add all props by default: 2fae857
  • Allow renderloop to have a number: c8bee28
  • Allow custom keycodes to be evaluated at runtime (fixes #55): fd35e0d
  • Improve memory by defining runtime helpers once: 9fec38e
  • Improve performance by reusing counter: 0c70406
  • Make some improvements to generator rewrite: 80db683
  • Optimize optimizer, and deoptimize if there is a special directive present: b7d419e
  • Deoptimize on directives: 1710b85
  • Generate event listener code correctly: 4ca98f7
  • Add support for special directives that implement code generation for an individual property: c95d12d
  • Return output of method from callMethod, recommended by @shellvip (closes #69): ef90104
  • Remove unused function from generator: 30aa9c7
  • Ensure special directives that generate code after children don't invoke during the childrens' code generation time: d0eeaa9
  • Fix mount: 39bc539
  • Optimize adding events when parent listens to child component events: e27c520
  • Update initMethods: 736bc17
  • Account for literal values as well as normal values when using 'm-model' with literal values (fixes #60): 11ff0de
  • Allow attributes to be set conditionally (fixes #25): 5e1dc22
  • Escape HTML correctly and efficiently (fixes #83): 63a5441
  • Allow for backslashes in templates: 48791e0
  • Perf: don't use bind: 8271182

v0.10.0

20 May 05:26
Compare
Choose a tag to compare

Minor Changes

  • Remove custom prefix configuration option + make directive generation faster: 1ba2ec5
  • Improve parser by allowing custom elements that self close, but throw if there is no slash to indicate it: a645d40
  • M-if now uses an empty text node: a8056b2
  • Make mustache tags run first with precedence: d4906cc
  • Allow scoping and javascript expressions within mustaches: b3966b0
  • Add a dependency system for directives and special directives, to avoid calling a getter multiple times: 147ab02
  • Change all scoping inside of directives to be literal by default, without mustaches: 84c627c

Patches

  • Allow lexer to handle unclosed elements (fixes #35): 5c08af7
  • Allow 'el' to be a DOM element (fixes #34): 2f70afc
  • Fix string escaper: ef5ffea
  • Add warning for undefined values in development mode: 9333416
  • Allow support for booleans and object properties in mustaches: 00f33de
  • Make mask a special directive: 0430b54
  • Remove m-literal on directives (already literal by default): c408132
  • Diff event listeners (fixes #38)": 50b989f
  • Allow text to contain comments: d888a48
  • Global variables: b3bf117
  • Faster way of checking for globals: 04b37da
  • Allow options in plugins: d2b1182
  • Format browser support table: 35e2a2e
  • Clean up code generator: 2088081
  • Generate children faster: 98ac037
  • Faster code generation for m-for: 353dc8c
  • Faster code generation for m-on: d440470
  • Faster code generation for m-on and m-model: ab73cab
  • Faster code generation for directives: 2b6415b
  • Make dom props faster: e6dae96
  • Diff a component faster: e528aeb
  • Correctly add variables to scope in m-for: 4c05b2f
  • Scope dynamic keypaths in m-model correctly: f53c236
  • Remove unused regex: ac8fa56
  • Speed up child lookup: abd312d
  • Correctly diff removing children by using a seperate counter for old children: 4b919af
  • Specific case for logging/error when silent: d533fc9
  • Faster replace: 7d2f9ac
  • Keep same regex for functions: 52dfa5c
  • Warn at closing element with no matching tag: c8224d8
  • Change name of parse tree walker: b692c13
  • Better message for ignored closing tag: 3def907
  • Simplify createNodeFromVNode by using existing appendChild utility: f441791
  • Handle null children when creating nodes from vnodes: 4101a47
  • Avoid many lookups into objects (perf boost): 2f61451
  • Faster for loop when resolving keypath: 248781d
  • Specific case for traversing children in hydration: d9d880d
  • Set children when clearing in optimization by reference to retain for next diff: 858e806

v0.9.0

15 Apr 16:46
Compare
Choose a tag to compare

Minor Changes

  • ⚡ much better detection of static nodes: 6b1d0ef
  • Allow () in template modifiers: 612527a
  • Throw error if no closing delimiter for template is given: 530e142
  • Remove the pre directive completely: af6a528
  • Don't rely on shouldRender to update text during hydration and diff: f1ccd80
  • Remove m-once: d503f67
  • Simplify h function and do more work during codegen instead: fa17963
  • Flatten children during render: f5483ef
  • Generate code that flattens shallow arrays instead of doing it during runtime: 7f19ade
  • Treat vnode as source of truth for directives when diffing props: 45bcc7b
  • Remove text directive (pretty useless): b18b578
  • New header: c6b2ac0
  • Make compiler independent (not needing instance): d93a353
  • Remove initialRender property (useless): 3457f0b
  • By default, instance is destroyed (until mount): 50c58f7
  • ⚡ parser can now handle weird HTML: 4c07f70
  • Make lexer flexible, allowing unescaped HTML: e72d67c
  • Add support for custom delimiters (fixes #29): c82ac63
  • Merge methods with data: 416c10a
  • Bind all methods during initialization: fc89920
  • Allow directive to be added by m-literal: 9eaf4bc
  • M-if now generates an empty text node: 454e04f

Patches

  • Patch old vnode tree to match new one instead of creating a new tree each update: 850ea1b
  • Fix bugs when appending components: 2cdd5d9
  • Ensure no props are generated by the time beforeGenerate is called for special directives: eb9c848
  • Update reference correctly when diffing children: 5b562ed
  • Ignore null children (conditional): 0b9b870
  • Add dependencies if not already added: 5133bf2
  • Ensure slots are treated as dynamic: 9d11f0a
  • Faster way to check svg: 608a4b6
  • ⚡ faster way to check for svg: 159eee8
  • Efficient template compiler: 9d577b8
  • Memory efficient way of optimizing static nodes: e4f7c87
  • Generate regex for m-for: 721f3fe
  • Memory efficient lexer: ea9c861
  • Faster, memory efficient HTML parser: 1b9e107
  • Specific cases for slight perf boost in hydration: c05a0bc
  • Specific cases with utility functions: d6e568d
  • Avoid creating new strings every diff: 0c3dbc9
  • Generate code for directives seperate from normal attributes: 3e2687d
  • Execute directives later when diffing props: 7bd1bcf
  • More elegant solution to m-show and custom directives: 5380d31
  • Optimize checks in h function: 33e21bb
  • Check for index out of bounds (perf boost): b7431bf
  • Refactor events .on: a1121a2
  • Let off be more flexible: 862d4af
  • Refactor code generator: 8333853
  • Refactor before special directive generation: 6b1a2b0
  • Refactor special directive after generation: 5342b8a
  • More specific check: 12fd76a
  • Empty oldChildren in dom when emptying element: e9f488f
  • Make parser even more flexible: dad261c
  • Cache props when creating functional components: 34ed75e
  • Make template compiler more flexible: 838e7a2
  • Allow parser to handle cases with nested elements of same type: a135ab2
  • Allow conditionally set attributes (fixes #25): c92f581
  • Add faster versions of directives: 3cf8f66
  • Use delimiters while compiling 'm-model': 7774cc6
  • Keep reference to nextSibling during hydration: 99ac4c8
  • Add better falsy values, and fix setting attributes for xlink:href (fixes #31): 9b90318
  • Make notifying and observing faster: 8c3fe88
  • Clean up observer code: 218903e
  • Invoke setters in direct set, not by notification: 4343cf7
  • Use base for custom setters and add default setter as noop in favor of custom one: 669a3bb

v0.8.0

31 Mar 20:29
Compare
Choose a tag to compare

Minor Changes

  • Add dependency tracking and caching for computed properties: 3669059
  • Make sure keeping track of changed computed properties (so they can depend on each other): 484f262
  • Errors are suppressed as well if silent: 4333592
  • Make moon silent in production: c227bf8
  • Remove checker for warnings in production version: 2983514
  • Make h function take array of children: a6bb0b4
  • Add support for 'name' option in components: a53637a

Patches

  • Update cache/dependency systems: e63d63e
  • Better m-show implementation (perf boost): 718ff7b
  • Ensure empty attributes have meta/values: 96da99b
  • Ensure properties with args can have multiple instances of themselves: e21eba5
  • More efficient prop diff (perf boost) 🔥: b61d16d
  • Use a different diff with vnodes and dom: 3b240cf
  • Better way of iterating through children: 1619af8
  • 🔥 perf boost: use ternary expression over and condition (more declarative): 684d40d
  • ⚡ rewrite diff completely to use hybrid of nodes+vnodes: f94aafc
  • ⚡ perf boost: faster prop check without hasOwnProperty check: 575aec7
  • Expose 'h' and perform vnode equality check optimization: 339cabe
  • ⚡ perf boost: handle case when there are no children and remove all of them: 577fe98
  • ⚡ perf boost: faster way to traverse children while avoiding calls to CompareICStub: 347d8b3
  • Ensure children are hydrated when creating a text node via optimization: b40a71f