Michael Rawlings ddca804915 Hydrate tests (#994)
* enable hydrate tests, use repeated key in split component to get references to server-rendered components

* allow tests to determine if hydrate mode, update attach event tests for correct expectations when hydrating

* add empty class so that the component is mounted when hydrating and we have a component reference to use for testing

* add support for  to the hydrate tests, update tests to serializeGlobals

* allow skipping hydrate only, skip hydrate for implicit component tests

* skip hydrate for test with two different global inputs

* better support for split/legacy components in the test harness

* components are already mounted in hydrate mode, so setup needs to be done elsewhere

* temporarily skip tests failing due to onCreate not being called for root level hydrated components

* only add attach/detach global helpers if target is vdom - this should not run on the server and was causing the morphdom/vdom tests to fail if it was included before them

* skip hydrate tests for deprecated components - there are a number of issues here that still need to be fixed
2018-02-23 12:15:44 -08:00
2017-10-01 10:48:31 -07:00
2018-01-18 15:39:19 -05:00
2017-11-07 08:55:02 -08:00
2018-02-23 12:15:44 -08:00
2018-02-23 12:15:44 -08:00
2017-02-01 13:45:49 -05:00
2017-11-22 16:46:18 -08:00
2017-09-26 17:37:25 -07:00
2017-07-11 13:01:06 -06:00
2017-11-20 15:20:19 -08:00
2017-11-29 18:26:28 -08:00
2017-05-19 19:33:40 -06:00
2018-02-20 10:44:30 -08:00
2017-05-19 17:27:55 -06:00
2017-05-19 19:33:40 -06:00
2017-05-19 17:27:55 -06:00
2017-05-19 19:33:40 -06:00
2017-05-19 14:35:33 -06:00
2017-05-19 19:33:40 -06:00
2017-05-19 17:27:55 -06:00
2017-05-19 19:33:40 -06:00
2017-05-19 14:35:33 -06:00
2017-05-19 17:27:55 -06:00
2017-05-19 19:33:40 -06:00
2017-01-03 15:56:58 -07:00
2017-05-19 19:33:40 -06:00
2018-02-20 10:44:40 -08:00
2018-02-07 01:22:28 -08:00
2017-05-19 14:35:33 -06:00
2017-05-19 14:35:33 -06:00

Marko logo

Marko is a friendly (and fast!) UI library that makes building web apps fun. Learn more on markojs.com, and even Try Marko Online!

Build Status Coverage Status Gitter NPM Downloads

Get Involved

  • Contributing: Pull requests are welcome!
  • Support: Join our gitter chat to ask questions to get support from the maintainers and other Marko developers
  • Discuss: Tweet using the #MarkoJS hashtag and follow @MarkoDevTeam

Installation

npm install marko --save

Examples

Marko provides an elegant and readable syntax for both single-file components and components broken into separate files. There are plenty of examples to play with on Marko's Try-Online. Additional component documentation can be found on the Marko.js website.

Single file

The following single-file component renders a button and a counter with the number of times the button has been clicked. Try this example now!

click-count.marko

class {
    onCreate() {
        this.state = { count:0 };
    }
    increment() {
        this.state.count++;
    }
}

style {
    .count {
        color:#09c;
        font-size:3em;
    }
    .example-button {
        font-size:1em;
        padding:0.5em;
    }
}

<div.count>
    ${state.count}
</div>
<button.example-button on-click('increment')>
    Click me!
</button>

Multi-file

The same component as above split into an index.marko template file, component.js containing your component logic, and style.css containing your component style:

index.marko

<div.count>
    ${state.count}
</div>
<button.example-button on-click('increment')>
    Click me!
</button>

component.js

module.exports = {
    onCreate() {
        this.state = { count:0 };
    },
    increment() {
        this.state.count++;
    }
};

style.css

.count {
    color:#09c;
    font-size:3em;
}
.example-button {
    font-size:1em;
    padding:0.5em;
}

Concise Syntax

Marko also support a beautiful concise syntax as an alternative to the HTML syntax. Find out more about the concise syntax here.

<!-- Marko HTML syntax -->
<ul>
    <li for(color in ['a', 'b', 'c'])>
        ${color}
    </li>
</ul>
// Marko concise syntax
ul
    li for(color in ['a', 'b', 'c'])
        -- ${color}

Changelog

See CHANGELOG.md

Maintainers

Code of Conduct

This project adheres to the eBay Code of Conduct. By participating in this project you agree to abide by its terms.

License

MIT

Description
A declarative, HTML-based language that makes building web apps fun
Readme MIT 72 MiB
Languages
JavaScript 65.4%
TypeScript 21.3%
Marko 7%
HTML 6.3%