jsx-compiler
Parser for Rax JSX Statements.
Last updated 4 years ago by rax-publisher .
BSD-3-Clause · Original npm · Tarball · package.json
$ npm install jsx-compiler 
SYNC missed versions from official npm registry.

jsx-compiler

Transform JSX styled Rax Components into miniapp parts.

example

input:

import { Component } from 'rax';

export default class extends Component {

  render() {
    return (<view>hello world</view>);
  }
}

Run jsx compiler.

  • type: Required, enum of app, page, component.
  • outputPath: Required, string of dist path.
  • sourcePath: Required, string of source path.
  • resourcePath: Required, string of original file path.
const compile = require('jsx-compiler');
const { baseOptions } = compile;

const output = compile(code, { ...baseOptions, type: 'component' });

output:

  • ast
    • Babel 7 format AST of JS code
  • imported
    • Imported modules and local identifiers
  • exported
    • Exported identifiers
  • template
    • axml template for miniapp
  • code
    • Transformed JS code.
  • map
    • Source map of JS code
  • config
    • JS Object, miniapp config
  • style
    • String, acss of style.
  • usingComponents

eg.

{
  ast: ASTNodeTree,
  imported: {
    rax: [
      {
        local: "Component",
        default: false,
        importFrom: "Component",
        name: "rax",
        external: true
      }
    ]
  },
  exported: ["default"],
  code:
    'import { createComponent as __create_component__, Component as __component__ } from "jsx2mp-runtime";\n\nconst __def__ = class extends __component__ {\n  render() {\n    return {};\n  }\n\n};\n\nComponent(__create_component__(__def__, {\n  events: []\n}));',
  map: null,
  config: {
    component: true
  },
  style: "",
  usingComponents: {},
  template: "<view>hello world</view>"
}

Current Tags

  • 0.4.38-2                                ...           beta (2 years ago)
  • 0.4.37                                ...           latest (2 years ago)

151 Versions

  • 0.4.38-2                                ...           2 years ago
  • 0.4.38-1                                ...           2 years ago
  • 0.4.38-0                                ...           2 years ago
  • 0.4.37                                ...           2 years ago
  • 0.4.37-0                                ...           2 years ago
  • 0.4.36-5                                ...           3 years ago
  • 0.4.36-4                                ...           3 years ago
  • 0.4.36                                ...           3 years ago
  • 0.4.36-3                                ...           3 years ago
  • 0.4.36-2                                ...           3 years ago
  • 0.4.36-1                                ...           3 years ago
  • 0.4.36-0                                ...           3 years ago
  • 0.4.35                                ...           3 years ago
  • 0.4.35-0                                ...           3 years ago
  • 0.4.34                                ...           3 years ago
  • 0.4.33                                ...           3 years ago
  • 0.4.33-2                                ...           3 years ago
  • 0.4.33-1                                ...           3 years ago
  • 0.4.33-0                                ...           3 years ago
  • 0.4.32                                ...           3 years ago
  • 0.4.32-0                                ...           3 years ago
  • 0.4.31                                ...           3 years ago
  • 0.4.31-1                                ...           3 years ago
  • 0.4.31-0                                ...           3 years ago
  • 0.4.30                                ...           4 years ago
  • 0.4.30-0                                ...           4 years ago
  • 0.4.29                                ...           4 years ago
  • 0.4.29-2                                ...           4 years ago
  • 0.4.29-1                                ...           4 years ago
  • 0.4.29-0                                ...           4 years ago
  • 0.4.28                                ...           4 years ago
  • 0.4.28-0                                ...           4 years ago
  • 0.4.27                                ...           4 years ago
  • 0.4.27-0                                ...           4 years ago
  • 0.4.26                                ...           4 years ago
  • 0.4.26-0                                ...           4 years ago
  • 0.4.25                                ...           4 years ago
  • 0.4.25-1                                ...           4 years ago
  • 0.4.25-0                                ...           4 years ago
  • 0.4.24                                ...           4 years ago
  • 0.4.23                                ...           4 years ago
  • 0.4.22                                ...           4 years ago
  • 0.4.21                                ...           4 years ago
  • 0.4.20                                ...           4 years ago
  • 0.4.19                                ...           4 years ago
  • 0.4.19-2                                ...           4 years ago
  • 0.4.19-1                                ...           4 years ago
  • 0.4.19-0                                ...           4 years ago
  • 0.4.18                                ...           4 years ago
  • 0.4.18-0                                ...           4 years ago
  • 0.4.17                                ...           4 years ago
  • 0.4.17-2                                ...           4 years ago
  • 0.4.17-1                                ...           4 years ago
  • 0.4.17-0                                ...           4 years ago
  • 0.4.16                                ...           4 years ago
  • 0.4.15                                ...           4 years ago
  • 0.4.14                                ...           4 years ago
  • 0.4.14-2                                ...           4 years ago
  • 0.4.14-1                                ...           4 years ago
  • 0.4.14-0                                ...           4 years ago
  • 0.4.13                                ...           4 years ago
  • 0.4.13-0                                ...           4 years ago
  • 0.4.12                                ...           4 years ago
  • 0.4.11                                ...           4 years ago
  • 0.4.11-1                                ...           4 years ago
  • 0.4.11-0                                ...           4 years ago
  • 0.4.10                                ...           4 years ago
  • 0.4.9                                ...           5 years ago
  • 0.4.8                                ...           5 years ago
  • 0.4.7                                ...           5 years ago
  • 0.4.5                                ...           5 years ago
  • 0.3.37                                ...           5 years ago
  • 0.3.36                                ...           5 years ago
  • 0.4.4                                ...           5 years ago
  • 0.4.3                                ...           5 years ago
  • 0.4.3-2                                ...           5 years ago
  • 0.4.3-1                                ...           5 years ago
  • 0.4.3-0                                ...           5 years ago
  • 0.4.2                                ...           5 years ago
  • 0.4.2-0                                ...           5 years ago
  • 0.4.1                                ...           5 years ago
  • 0.4.1-0                                ...           5 years ago
  • 0.4.0                                ...           5 years ago
  • 0.3.35                                ...           5 years ago
  • 0.3.34                                ...           5 years ago
  • 0.3.33                                ...           5 years ago
  • 0.3.32                                ...           5 years ago
  • 0.3.32-3                                ...           5 years ago
  • 0.3.32-2                                ...           5 years ago
  • 0.3.32-1                                ...           5 years ago
  • 0.3.32-0                                ...           5 years ago
  • 0.3.31                                ...           5 years ago
  • 0.3.31-2                                ...           5 years ago
  • 0.3.31-1                                ...           5 years ago
  • 0.3.31-0                                ...           5 years ago
  • 0.3.30                                ...           5 years ago
  • 0.3.30-2                                ...           5 years ago
  • 0.3.30-0                                ...           5 years ago
  • 0.3.29                                ...           5 years ago
  • 0.3.28                                ...           5 years ago
  • 0.3.27                                ...           5 years ago
  • 0.3.26                                ...           5 years ago
  • 0.3.25                                ...           5 years ago
  • 0.3.24                                ...           5 years ago
  • 0.3.23                                ...           5 years ago
  • 0.3.22                                ...           5 years ago
  • 0.3.21                                ...           5 years ago
  • 0.3.20                                ...           5 years ago
  • 0.3.19                                ...           5 years ago
  • 0.3.18                                ...           5 years ago
  • 0.3.17                                ...           5 years ago
  • 0.3.16                                ...           5 years ago
  • 0.3.15                                ...           5 years ago
  • 0.3.13                                ...           5 years ago
  • 0.3.12                                ...           5 years ago
  • 0.3.10                                ...           5 years ago
  • 0.3.9                                ...           5 years ago
  • 0.3.8                                ...           5 years ago
  • 0.3.7                                ...           5 years ago
  • 0.3.6                                ...           5 years ago
  • 0.3.5                                ...           5 years ago
  • 0.3.4                                ...           5 years ago
  • 0.3.3                                ...           5 years ago
  • 0.3.2                                ...           5 years ago
  • 0.3.1                                ...           5 years ago
  • 0.3.0                                ...           5 years ago
  • 0.2.8                                ...           5 years ago
  • 0.2.7                                ...           5 years ago
  • 0.2.6                                ...           5 years ago
  • 0.2.5                                ...           5 years ago
  • 0.2.4                                ...           5 years ago
  • 0.2.3                                ...           5 years ago
  • 0.2.2                                ...           5 years ago
  • 0.2.1                                ...           5 years ago
  • 0.2.0                                ...           5 years ago
  • 0.1.10                                ...           5 years ago
  • 0.1.9                                ...           5 years ago
  • 0.1.9-beta.1                                ...           5 years ago
  • 0.1.8                                ...           5 years ago
  • 0.1.7                                ...           5 years ago
  • 0.1.7-0                                ...           5 years ago
  • 0.1.6                                ...           5 years ago
  • 0.1.5                                ...           5 years ago
  • 0.1.4                                ...           5 years ago
  • 0.1.3                                ...           5 years ago
  • 0.1.2                                ...           5 years ago
  • 0.1.1                                ...           5 years ago
  • 0.1.0                                ...           5 years ago
  • 0.0.0-beta.3                                ...           5 years ago
  • 0.0.0-beta.2                                ...           6 years ago
  • 0.0.0-beta0                                ...           6 years ago
Downloads
Total 2
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (11)
Dev Dependencies (2)
Dependents (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE