Giter Site home page Giter Site logo

mrluiigi / pika-babel-plugin-transform-simple-e4x Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pikamuchu/pika-babel-plugin-transform-simple-e4x

0.0 0.0 0.0 462 KB

babel plugin for obsolete e4x xml processing

License: MIT License

Shell 8.22% JavaScript 91.78%

pika-babel-plugin-transform-simple-e4x's Introduction

babel-plugin-transform-simple-e4x

Version Build Status Codacy Badge codecov

Buy Me a Coffee at ko-fi.com

Introduction

Babel plugin for e4x xml processing.

Usage

npm install\
  babel-plugin-transform-simple-e4x\
  babel-preset-env\
  --save-dev

In your .babelrc:

{
  "presets": ["@babel/preset-env"],
  "plugins": ["babel-plugin-transform-simple-e4x"]
}

The plugin transpiles the following E4X code:

const fooId = 'foo-id';
const barText = 'bar text';

let xml = (
  <xml>
    <foo id={fooId}>{barText}</foo>
  </xml>
);

xml += <var id="var-id"/>;

To the following JavaScript:

var XML = require("simple4x");

var fooId = 'foo-id';
var barText = 'bar text';

var xml = new XML("<xml><foo id=\"" + (fooId) + "\">" + (barText) + "</foo></xml>");

xml.appendChild(new XML("<var id=\"var-id\" />"));

See tests for more examples and details.

Examples

Web Rendering

Web Service

Requirements

  • Babel 7 compatible

Developing

Built with

Folder structure

  • root: Contains the README.md, the main configuration to execute the project such as package.json or any other configuration files.
  • lib: Contains the source code for plugin.
  • test: Contains library tests and examples.
  • examples: Contains library examples.
  • node_modules: Contains third party JS libraries used in this project

Setting up Dev

Download the code

git clone [email protected]:pikamachu/pika-babel-plugin-transform-simple-e4x.git
cd pika-babel-plugin-transform-simple-e4x

Install dependencies

bash pika install

Run application tests.

bash pika test

pika-babel-plugin-transform-simple-e4x's People

Contributors

pikamuchu 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.