Comparing version 0.31.1 to 0.32.0
@@ -6,3 +6,9 @@ 'use strict'; | ||
}); | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
exports.default = Tree; | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
/* eslint-disable no-use-before-define, no-return-assign, max-len */ | ||
@@ -117,5 +123,12 @@ var LOGS = false; | ||
var _ref = node.element.props ? node.element.props : {}, | ||
children = _ref.children, | ||
rest = _objectWithoutProperties(_ref, ['children']); // eslint-disable-line no-unused-vars | ||
return { | ||
ind: ind, | ||
name: node.element.name, | ||
props: _extends({ | ||
children: '<function children>' | ||
}, rest), | ||
used: node.element.used(), | ||
@@ -122,0 +135,0 @@ id: node.element.id, |
{ | ||
"name": "actml", | ||
"version": "0.31.1", | ||
"version": "0.32.0", | ||
"description": "Like jsx but for your business logic", | ||
"main": "lib/index.js", | ||
"main": "./actml.production.js", | ||
"scripts": { | ||
"bundle": "browserify ./lib/index.js -o ./standalone/actml.js --standalone actml && uglifyjs ./standalone/actml.js -o ./standalone/actml.min.js", | ||
"build-dev": "cp ./actml.js ./actml.dev.js && node ./scripts/replaceInFile.js ./actml.dev.js __DEV__ true", | ||
"build-production": "cp ./actml.js ./actml.production.js && node ./scripts/replaceInFile.js ./actml.production.js __DEV__ false && uglifyjs ./actml.production.js -o ./actml.production.js --compress unused,dead_code", | ||
"build": "browserify ./lib/index.js -o ./actml.js --standalone actml && yarn build-dev && yarn build-production && rm ./actml.js", | ||
"test": "BABEL_ENV=development ./node_modules/.bin/jest \"(.*)\\.spec\\.js\"", | ||
"test-watch": "BABEL_ENV=development ./node_modules/.bin/jest \"(.*)\\.spec\\.js\" --watch --verbose false", | ||
"build": "rm -rf ./lib/* && ./node_modules/.bin/babel ./src --out-dir ./lib --ignore spec.js", | ||
"transpile": "rm -rf ./lib/* && ./node_modules/.bin/babel ./src --out-dir ./lib --ignore spec.js", | ||
"dev": "./node_modules/.bin/babel ./src --out-dir ./lib --ignore spec.js --watch", | ||
"release": "yarn test && yarn build && yarn bundle" | ||
"release": "yarn test && yarn transpile && yarn build" | ||
}, | ||
@@ -56,3 +58,6 @@ "repository": { | ||
"setupTestFrameworkScriptFile": "./jest/index.js", | ||
"verbose": false | ||
"verbose": false, | ||
"globals": { | ||
"__DEV__": true | ||
} | ||
}, | ||
@@ -59,0 +64,0 @@ "dependencies": { |
![ActML](assets/logo.jpg) | ||
# ActML | ||
> :dizzy: ActML is a library that allows you to use JSX syntax outside of React world. It aims to provide the same experience in terms of composability and patterns. | ||
@@ -31,3 +29,3 @@ | ||
* [How to use it](#how-to-use-it) | ||
* [Introduction](#caveats) | ||
* [Introduction](#introduction) | ||
* [Children](#children) | ||
@@ -52,3 +50,3 @@ * [Asynchronous](#asynchronous) | ||
## Caveats | ||
## Introduction | ||
@@ -62,5 +60,5 @@ ActML looks like [React](https://reactjs.org/) but it's not about rendering UI. It's about executing your JavaScript. | ||
You'll probably wonder why using ActML and instead writing `Foo()` we do `<Foo />`? The answer is same reason we you do `<Component />` instead of `React.createElement(Component, null)`. We are declarative instead of imperative. It's much better to say what we want to happen instead of how it happens. Being declarative means having more options for composition. | ||
You'll probably wonder why using ActML and instead of writing `Foo()` we use `<Foo />`? The answer is same reason why we write `<Component />` instead of `React.createElement(Component, null)`. We are declarative instead of imperative. It's better to say what we want to happen instead of how it happens. Being declarative means having more options for composition. The declarative code is easier to read and extend. | ||
Also when we write `<Foo />` we are not executing our function `Foo`. We are just saying that this function _should be_ executed at this place. We create a descriptor of that call which is passed to ActML runtime. This abstraction creates a layer where we can do bunch of things. We can for example process async operations behind the scenes or we can build a map of your application functions. | ||
Also when we write `<Foo />` we are not executing our function `Foo`. We are just saying that this function _should be_ executed at this place. We create a descriptor of that call which is passed to ActML runtime. This abstraction creates a layer where we can do bunch of things. We can for example process async operations behind the scenes or we can build a map the application's logic. We can deffer things or enhance them with additional arguments. | ||
@@ -102,3 +100,3 @@ ### Children | ||
Calling manually `children` means runs the children `X` and `Y` and receiving the result of them. | ||
Calling manually `children` means running the children `X` and `Y` and receiving the result of them. | ||
@@ -140,3 +138,3 @@ ### Asynchronous | ||
Notice that `<Greeting>` and `<FavoriteColor>` are synchronous. ActML waits for all the children to be processed and then resolves the promise returned by the `children` call. If all the elements were synchronous they we'll get an array straight away. | ||
Notice that `<Greeting>` and `<FavoriteColor>` are synchronous. ActML waits for all the children to be processed and then resolves the promise returned by the `children` call. If all the elements were synchronous then we'll get an array straight away. | ||
@@ -143,0 +141,0 @@ ### Context |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
25
2022
101392
279
5
1