Comparing version 1.1.4 to 1.1.5
{ | ||
"name": "sax-wasm", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"repository": "https://github.com/justinwilaby/sax-wasm", | ||
@@ -15,4 +15,4 @@ "description": "An extremely fast JSX, HTML and XML parser written in Rust compiled to WebAssembly for Node and the Web", | ||
"scripts": { | ||
"test": "jest --runInBand", | ||
"test:coveralls": "jest --runInBand --coverage --coverageReporters=text-lcov | coveralls", | ||
"test": "nyc mocha src/js/__test__/", | ||
"test:coveralls": "npm run test && nyc report --reporter=text-lcov | coveralls", | ||
"build:wasm": "rustc ./src/main.rs -C lto -O --target wasm32-unknown-unknown -o ./lib/sax-wasm.wasm", | ||
@@ -32,27 +32,11 @@ "run:wasm-gc": "cd ./lib && wasm-gc sax-wasm.wasm", | ||
"devDependencies": { | ||
"@types/jest": "^23.3.1", | ||
"@types/node": "^10.5.5", | ||
"@types/webassembly-js-api": "^0.0.1", | ||
"@types/mocha": "^2.2.47", | ||
"@types/node": "^10.12.19", | ||
"@types/webassembly-js-api": "^0.0.2", | ||
"coveralls": "^3.0.2", | ||
"jest": "^23.4.2", | ||
"ts-jest": "^23.1.3", | ||
"typescript": "^3.0.1" | ||
}, | ||
"jest": { | ||
"transform": { | ||
"^.+\\.(tsx?|jsx?)$": "ts-jest" | ||
}, | ||
"testURL": "http://localhost", | ||
"testMatch": [ | ||
"<rootDir>/src/js/**/?(*.)(spec|test).(ts)?(x)" | ||
], | ||
"moduleFileExtensions": [ | ||
"ts", | ||
"tsx", | ||
"js", | ||
"jsx", | ||
"json", | ||
"node" | ||
] | ||
"expect.js": "^0.3.1", | ||
"mocha": "^5.2.0", | ||
"nyc": "^13.1.0", | ||
"typescript": "^3.2.4" | ||
} | ||
} |
@@ -12,3 +12,3 @@ # SAX (Simple API for XML) for Web Assembly | ||
Web Assembly with the sole motivation to bring **near native speeds** to XML and JSX parsing for node and the web. | ||
Inspired by [sax js](https://github.com/isaacs/sax-js) and rebuilt with Rust for Web Assembly sax-wasm brings optimizations | ||
Inspired by [sax js](https://github.com/isaacs/sax-js) and rebuilt with Rust for Web Assembly, sax-wasm brings optimizations | ||
for speed and support for JSX syntax. | ||
@@ -109,16 +109,16 @@ | ||
|Event |Mask |Argument | | ||
|----------------------------------|--------------|--------------------| | ||
|SaxEventType.Text |0b1 |text: Text | | ||
|SaxEventType.ProcessingInstruction|0b10 |procInst: string | | ||
|SaxEventType.SGMLDeclaration |0b100 |sgmlDecl: string | | ||
|SaxEventType.Doctype |0b1000 |doctype: string | | ||
|SaxEventType.Comment |0b10000 |comment: string | | ||
|SaxEventType.OpenTagStart |0b100000 |tag: Tag | | ||
|SaxEventType.Attribute |0b1000000 |attribute: Attribute| | ||
|SaxEventType.OpenTag |0b10000000 |tag: Tag | | ||
|SaxEventType.CloseTag |0b100000000 |tag: Tag | | ||
|SaxEventType.OpenCDATA |0b1000000000 |start: Position | | ||
|SaxEventType.CDATA |0b10000000000 |cdata: string | | ||
|SaxEventType.CloseCDATA |0b100000000000|end: Position | | ||
|Event |Mask |Argument passed to handler | | ||
|----------------------------------|--------------|---------------------------------------------| | ||
|SaxEventType.Text |0b000000000001|text: [Text](src/js/saxWasm.ts#L46) | | ||
|SaxEventType.ProcessingInstruction|0b000000000010|procInst: string | | ||
|SaxEventType.SGMLDeclaration |0b000000000100|sgmlDecl: string | | ||
|SaxEventType.Doctype |0b000000001000|doctype: string | | ||
|SaxEventType.Comment |0b000000010000|comment: string | | ||
|SaxEventType.OpenTagStart |0b000000100000|tag: [Tag](src/js/saxWasm.ts#L52) | | ||
|SaxEventType.Attribute |0b000001000000|attribute: [Attribute](src/js/saxWasm.ts#L37)| | ||
|SaxEventType.OpenTag |0b000010000000|tag: [Tag](src/js/saxWasm.ts#L52) | | ||
|SaxEventType.CloseTag |0b000100000000|tag: [Tag](src/js/saxWasm.ts#L52) | | ||
|SaxEventType.OpenCDATA |0b001000000000|start: [Position](src/js/saxWasm.ts#L32) | | ||
|SaxEventType.CDATA |0b010000000000|cdata: string | | ||
|SaxEventType.CloseCDATA |0b100000000000|end: [Position](src/js/saxWasm.ts#L32) | | ||
@@ -139,3 +139,3 @@ ## SAXParser.js | ||
- `eventHanlder` - A function reference used for event handling. The supplied function must have a signature that accepts | ||
- `eventHandlder` - A function reference used for event handling. The supplied function must have a signature that accepts | ||
2 arguments: 1. The `event` which is one of the `SaxEventTypes` and the `body` (listed in the table above) | ||
@@ -149,3 +149,3 @@ | ||
- `write(ptr: *mut u8, length: usize)` - Supplies the parser with the location and length of the newly written bytes in the | ||
stream and kicks off processing. The parser assumes that the bytes are valid utf-8. Writing non utf-8 bytes will may cause | ||
stream and kicks off processing. The parser assumes that the bytes are valid utf-8. Writing non utf-8 bytes may cause | ||
unpredictable behavior. | ||
@@ -157,4 +157,3 @@ | ||
### Prerequisites | ||
This project requires rust v1.29+ since it contains the `wasm32-unknown-unknown` target out of the box. This is | ||
currently only available in the nightly build. | ||
This project requires rust v1.30+ since it contains the `wasm32-unknown-unknown` target out of the box. | ||
@@ -165,10 +164,10 @@ Install rust: | ||
``` | ||
Install the nightly compiler and switch to it. | ||
Install the stable compiler and switch to it. | ||
```bash | ||
rustup install nightly | ||
rustup default nightly | ||
rustup install stable | ||
rustup default stable | ||
``` | ||
Install the wasm32-unknown-unknown target. | ||
```bash | ||
rustup target add wasm32-unknown-unknown --toolchain nightly | ||
rustup target add wasm32-unknown-unknown --toolchain stable | ||
``` | ||
@@ -175,0 +174,0 @@ Install [node with npm](https://nodejs.org/en/) then run the following command from the project root. |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
71420
8
178