0.3.0 • Published 5 years ago

tranel v0.3.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

Tranel

npm.io license Build Status Coveralls npm Percentage of issues still open

Worker First DOM Manipulate Library

Characteristics

  • Use DOM API like main thread in dom

Note: you should clean ref in worker

Compatibility

Unit tests guarantee support on the following environment:

IECHSFIOSAndroid
10+ALL9+9+5+

Note: code depend on Proxy API, so you need import Polyfill to compatible with old version.

Directory

├── demo - Using demo
├── dist - Compiler output code
├── docs - Project documents
├── src - Source code directory
├── test - Unit tests
├── CHANGELOG.md - Change log

Usage Instructions

Using npm, download and install the code.

$ npm install --save tranel

For Render Thread:

  <script src="../../lib/tranel.js"></script>
  <script>
    new Tranel().listen("./worker.js").registerGlobal()
  </script>

For Worker Thread:

  importScripts("../../lib/tranel.js");
  new Tranel().listen().registerGlobal()

Then you can use DOM API in worker:

let $wcomputeButton = document.getElementById('wcompute');
let $wresult = document.getElementById('wresult');
let $input = document.getElementById('input')
$wcomputeButton.addEventListener('click', () => {
  $wresult.innerText = $input.value
})

Open demo get more example.

Documents

API

Contribution Guide

How to switch JS and TS

  • srctype and scripts in package.json
  • require file of test/test.js
  • require file of test/browser/index.html

For the first time to run, you need to install dependencies firstly.

$ npm install

To dev & serve demo

$ npm run dev

To build the project:

$ npm run build

To run unit tests:

$ npm t

Note: The browser environment needs to be tested manually under test/browser

Modify the version number in package.json, modify the version number in README.md, modify the CHANGELOG.md, and then release the new version.

$ npm run release

Publish the new version to NPM.

$ npm publish

Contributors

contributors

Change Log

CHANGELOG.md

Current Users

Relative links

0.3.0

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.1.1

5 years ago

0.1.3

5 years ago

0.1.0

5 years ago