Coder Social home page Coder Social logo

carsonmckinstry / melody Goto Github PK

View Code? Open in Web Editor NEW

This project forked from trivago/melody

0.0 3.0 0.0 609 KB

Melody is a library for building JavaScript web applications.

Home Page: https://melody.js.org

License: Apache License 2.0

JavaScript 80.07% Shell 0.31% HTML 3.67% TypeScript 15.94%

melody's Introduction

Melody Logo

Melody is a UI library for building JavaScript applications.

It helps you to write solid, high performance applications following best practices, while maintaining a clear separation of concerns. The view layer is cleanly delegated to templates which are compiled to highly efficient JavaScript instructions that adaptively render to the DOM.

This approach allows you to keep unchanged DOM nodes, reduces the memory usage of your application and improves the rendering performance of both, your application and the browser rendering it.

Its performance is comparable to other fast UI libraries like Inferno and has been battle tested by millions of trivago users!

The Component API provided by Melody follows many of the principles of Redux, which is the preferred data layer for Melody applications.

Melody currently uses Twig templates as view layer and provides a higher level API that emits efficient DOM patching instructions. At the core Melody provides an API (or set of functions) enhancing those views in order to be more efficient and to help you to create better structure for your applications. This approach inherently creates a clear separation of concerns and leverages functional programming. In the next sections we will see how Melody gradually enhances those views and we will examine building blocks of Melody apps.

Getting Started

The easiest way to get started with Melody is to use Create Melody App. It sets up your development environment so that you can use the latest JavaScript features, provides a nice developer experience, and optimizes your app for production.

yarn create melody-app my-app
cd my-app
yarn
yarn start

Example

Simple example of rendering a melody component:

hello.twig

<div id="app">
    <h1>Hello {{ name }}</h1>
</div>

index.js

import { createComponent, render } from 'melody-component';
import template from './hello.twig';

const documentRoot = document.getElementById('root');

const component = createComponent(template);

render(documentRoot, component, { name: 'Melody' });

It receives a name property with the string "Melody", then renders a header saying "Hello Melody" on the page.

melody's People

Contributors

abertelle avatar ayusharma avatar btiwaree avatar danielcaldas avatar efegurkan avatar frvge avatar iandevlin avatar krakenfuss avatar malte-wessel avatar pago avatar tauanz avatar taueres avatar timdegroote avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.