2.1.0 • Published 3 years ago

@duox/jsml v2.1.0

Weekly downloads
33
License
MIT
Repository
github
Last release
3 years ago

JSML (JavaScript Markup Language)

Sometimes we find ourselves with the need to use some of the new technologies but our learning with them can be difficult at first, because we do not know how they work. This is a small library for web interfaces, very flat that extracts basic concepts from modern frameworks, such as React, Angular, Vue, etc.

PS: This library is not recommended at all for projects in production and less for large-scale projects.

PS 2: The name is currently a joke, dont take serious.

Version 2 released

Check our online documentation! (stills in development, made on JSML)

How you can use it?

npm i --save @duox/jsml

app.ts

import { Component, PagePhase, Page } from '@duox/jsml';
import { Span } from '../components/span';

@Page()
export class App implements PagePhase {
  render(): Component[] {
    return [
      Span('Hola Mundo!'),
    ];
  }
}

main.ts

import { PageResolver } from '@duox/jsml';
import { App } from './pages/app';

const appContainer = document.querySelector('#app') as HTMLElement;

const app = new PageResolver(App, appContainer);

app.render();

Or also you can use a routing system, for example:

app.ts

import {
  Component,
  PagePhase,
  Route,
  Page,
  Routes
} from '@duox/jsml';
import { Container } from '../components/container';
import { HomePage } from './home.page';

const routes: Route[] = [
  {
    Page: HomePage,
    default: true,
    path: 'home',
  }
];

@Routes({
  routes,
  zoneId: "main[key='main-navigation']"
})
@Page()
export class App implements PagePhase {
  render(): Component[] {
    return [
      Container({
        key: 'main-navigation'
      }),
    ];
  }
}

Enjoy!

2.0.9

3 years ago

2.0.8

3 years ago

2.1.0

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.5

3 years ago

2.0.4

3 years ago

2.0.7

3 years ago

2.0.6

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.1.1

3 years ago

1.1.2

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago