├── .gitignore
├── CHANGELOG.md
├── IDE plugins
├── eclipse
│ ├── HOWTO.md
│ └── plugin_impexjs.zip
└── sublime3
│ ├── HOWTO.md
│ └── impex
│ ├── Main.sublime-menu
│ ├── README.md
│ ├── impex.py
│ ├── impex.sublime-settings
│ ├── impex_global.sublime-completions
│ ├── impex_lifecycle.sublime-completions
│ └── impex_scope.sublime-completions
├── LICENSE
├── README.md
├── benchmark
└── regparser.html
├── build
├── impex.dev.all.js
├── impex.dev.all.min.js
├── impex.prod.all.js
└── impex.prod.all.min.js
├── examples
├── codes
│ ├── VDOM update with events.html
│ ├── VDOM update.html
│ ├── calculator.html
│ ├── component - anonymous.html
│ ├── component - attributes.html
│ ├── component - compare.html
│ ├── component - computedstate.html
│ ├── component - create.html
│ ├── component - cross level var.html
│ ├── component - event - keyboard.html
│ ├── component - event.html
│ ├── component - extends.html
│ ├── component - is.html
│ ├── component - lifecycle.html
│ ├── component - mixins.html
│ ├── component - named.html
│ ├── component - nexttick.html
│ ├── component - parent-children.html
│ ├── component - props.html
│ ├── component - this.html
│ ├── component - watch.html
│ ├── debug - stack.html
│ ├── delimiters.html
│ ├── directive - bind.html
│ ├── directive - class.html
│ ├── directive - cloak.html
│ ├── directive - elseif.html
│ ├── directive - event - bubbles.html
│ ├── directive - event - keyboard.html
│ ├── directive - event - mouseenter.html
│ ├── directive - event.html
│ ├── directive - for - component.html
│ ├── directive - for - template.html
│ ├── directive - for - template2.html
│ ├── directive - for - to.html
│ ├── directive - form.html
│ ├── directive - html - for.html
│ ├── directive - html.html
│ ├── directive - if - template.html
│ ├── directive - if test.html
│ ├── directive - if.html
│ ├── directive - model - attributes.html
│ ├── directive - pre.html
│ ├── directive - show on component.html
│ ├── directive - show.html
│ ├── directive - style.html
│ ├── filter - chain.html
│ ├── filter - currency.html
│ ├── filter - for.html
│ ├── global component ref.html
│ ├── global event.html
│ ├── global var.html
│ ├── html-scope.html
│ ├── nested.html
│ ├── number.html
│ ├── observe-array.html
│ ├── observe-object.html
│ ├── performence-nested.html
│ ├── performence-parser.html
│ ├── plugin - event.html
│ ├── plugin - store.html
│ ├── propsChange.html
│ ├── ref.html
│ ├── select.html
│ ├── slot component.html
│ ├── slot.html
│ ├── store.html
│ ├── test case - node update.html
│ ├── todos.html
│ ├── updateprop.html
│ └── wishlist
│ │ ├── css
│ │ └── main.css
│ │ ├── data.js
│ │ ├── index.html
│ │ └── js
│ │ ├── components.js
│ │ └── filters.js
├── index.html
├── lib
│ ├── fontawesome
│ │ ├── css
│ │ │ ├── font-awesome.css
│ │ │ └── font-awesome.min.css
│ │ └── fonts
│ │ │ ├── FontAwesome.otf
│ │ │ ├── fontawesome-webfont.eot
│ │ │ ├── fontawesome-webfont.svg
│ │ │ ├── fontawesome-webfont.ttf
│ │ │ ├── fontawesome-webfont.woff
│ │ │ └── fontawesome-webfont.woff2
│ ├── impex
│ │ ├── impex.dev.all.js
│ │ ├── impex.ext.loadable.js
│ │ ├── impex.ext.router.js
│ │ ├── impex.ext.store.js
│ │ └── impex.prod.all.js
│ └── jq
│ │ ├── jquery-3.1.0.min.js
│ │ └── jquery.slimscroll.min.js
└── themes
│ ├── default.css
│ ├── default.css.map
│ └── default.scss
├── ext
├── impex.ext.loadable.js
└── impex.ext.router.js
├── gulpfile.js
├── package.json
└── src
├── component
├── Component.js
├── EventEmitter.js
├── Task.js
└── watchers.js
├── core
├── Util.js
├── basic.js
├── compiler.js
└── parser.js
├── directive
└── build-in.js
├── filter
└── build-in.js
├── impex.js
├── observe
├── Change.js
├── Monitor.js
└── observer.js
├── shellEnd.js
├── shellStart.js
└── vdom
├── builder.js
├── comparer.js
├── transform.js
└── vnode.js
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 |
--------------------------------------------------------------------------------
/IDE plugins/eclipse/HOWTO.md:
--------------------------------------------------------------------------------
1 | # How to use?
2 |
3 | this zip file is a eclipse 3.x plugin, perform the following steps to manually install it.
4 |
5 | # Installation
6 |
7 | 1. Click the Help > Install New Software...
menu
8 |
9 | 2. Chose the zip file to install
10 |
11 |
--------------------------------------------------------------------------------
/IDE plugins/eclipse/plugin_impexjs.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrSoya/impex/ac9c2f41ea18ff5eeba8c34198e61384c6265e67/IDE plugins/eclipse/plugin_impexjs.zip
--------------------------------------------------------------------------------
/IDE plugins/sublime3/HOWTO.md:
--------------------------------------------------------------------------------
1 | # How to use?
2 |
3 | this 'impex' folder is a ST3 package, perform the following steps to manually install it.
4 |
5 | # Installation
6 |
7 | 1. Click the Preferences > Browse Packages…
menu
8 |
9 | 2. Copy 'impex' folder into the Packages/
directory
10 |
11 | 3. Restart Sublime Text
12 |
13 |
--------------------------------------------------------------------------------
/IDE plugins/sublime3/impex/Main.sublime-menu:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "id": "file",
4 | "children":
5 | [
6 | {
7 | "caption": "-"
8 | },
9 | {
10 | "caption": "New Impex template file",
11 | "command": "new_impex_template"
12 | },
13 | {
14 | "caption": "-"
15 | }
16 | ]
17 | },
18 | {
19 |
20 | "id": "preferences",
21 | "children":
22 | [
23 | {
24 | "id": "package-settings",
25 | "children":
26 | [
27 | {
28 | "caption": "Impex",
29 | "children":
30 | [
31 | {
32 | "caption": "README",
33 | "command": "open_file", "args":
34 | {
35 | "file": "${packages}/impex/README.md"
36 | }
37 | },
38 | {
39 | "caption": "-"
40 | },
41 | {
42 | "caption": "Settings – Default",
43 | "command": "open_file", "args":
44 | {
45 | "file": "${packages}/impex/impex.sublime-settings"
46 | }
47 | }
48 | ]
49 | }
50 | ]
51 | }
52 | ]
53 | }
54 | ]
55 |
--------------------------------------------------------------------------------
/IDE plugins/sublime3/impex/README.md:
--------------------------------------------------------------------------------
1 | # impexST
2 |
3 | 提供impex API和内置指令的语法提示,以及快速模板创建菜单等
4 |
5 | # API
6 | ## impex
7 | * g
8 | * version
9 | * config()
10 | * component()
11 | * directive()
12 | * filter()
13 | * render()
14 |
15 | ## impex.Component
16 | * el
17 | * state
18 | * refs
19 | * name
20 | * parent
21 | * children
22 | * setState()
23 | * watch()
24 |
25 | ## VNode
26 | * on()
27 | * setAttribute()
28 | * getAttribute()
29 |
30 | ## Derective data
31 | * comp
32 | * value
33 | * args
34 | * exp
35 |
36 |
37 | # Derective
38 | * x-if
39 | * x-for
40 | * x-html
41 | * x-class
42 | * x-style
43 | * x-bind
44 | * x-on
45 | * x-show
46 | * x-model
47 |
48 | # Menu
49 | File -> New Impex template file
50 |
--------------------------------------------------------------------------------
/IDE plugins/sublime3/impex/impex.py:
--------------------------------------------------------------------------------
1 | import sublime
2 | import sublime_plugin
3 |
4 | mpx_all_directives = [
5 | ["x-if","x-if=\"${1:exp}\""],
6 | ["x-for","x-for=\"${1:ds} as ${2:item}\""],
7 | ["x-for\tto","x-for=\"${1:begin} to ${2:end} as ${3:i}\""],
8 | ["x-html","x-html=\"${1:exp}\""],
9 | ["x-class","x-class=\"${1:exp}\""],
10 | ["x-style","x-style=\"${1:exp}\""],
11 | ["x-bind\tshortcut",".$1=\"${2:exp}\""],
12 | ["x-on\tshortcut",":$1=\"${2:exp}\""],
13 | ["x-show","x-show=\"${1:exp}\""],
14 | ["x-model","x-model=\"${1:exp}\""],
15 | ]
16 |
17 | mpx_custom_directives = [
18 | ["x-if","x-if=\"${1:exp}\""],
19 | ["x-for","x-for=\"${1:ds} as ${2:item}\""]
20 | ]
21 |
22 | class ImpexAutocomplete(sublime_plugin.EventListener):
23 | def on_query_completions(self, view, prefix, locations):
24 | global mpx_all_directives, mpx_custom_directives
25 | if view.match_selector(locations[0], 'text.html.basic meta.tag.block.any.html punctuation.definition.tag.end.html'):
26 | return mpx_all_directives
27 | if view.match_selector(locations[0], 'text.html.basic meta.tag.custom.html'):
28 | return mpx_custom_directives
29 | return []
30 |
31 |
32 | class NewImpexTemplateCommand(sublime_plugin.TextCommand):
33 | def run(self, edit):
34 | window = sublime.active_window()
35 | newView = window.new_file()
36 | # syntax = self.view.settings().get('syntax')
37 | # print(syntax)
38 | newView.set_syntax_file("Packages/HTML/HTML.sublime-syntax")
39 | newView.insert(edit, 0,
40 | "\n\n\t\n\n\t\n\n\n\n\n")
--------------------------------------------------------------------------------
/IDE plugins/sublime3/impex/impex.sublime-settings:
--------------------------------------------------------------------------------
1 | {
2 | "use_current_file_syntax": true,
3 |
4 | "auto_complete_triggers": [ {"selector": "source.html,source.js", "characters": "."} ],
5 | }
6 |
--------------------------------------------------------------------------------
/IDE plugins/sublime3/impex/impex_global.sublime-completions:
--------------------------------------------------------------------------------
1 | {
2 | "scope": "text.html.basic source.js.embedded.html, source.js",
3 |
4 | "completions":
5 | [
6 | //global attr
7 | "impex",
8 | { "trigger":"g\timpex", "contents":"g"},
9 | { "trigger":"version\timpex", "contents":"version"},
10 | { "trigger":"config(\timpex", "contents":"config(${1:cfg})"},
11 | { "trigger":"component(\timpex", "contents":"component(\"x-${1:name}\",{${2:...}})"},
12 | { "trigger":"directive(\timpex", "contents":"directive(\"${1:name}\",{\n\tonBind:function(vnode,data){\n\t\t${2://todo...}\n\t}\n})"},
13 | { "trigger":"filter(\timpex", "contents":"filter(\"${1:name}\",function(v,arg){\n\t${2://todo...}\n})"},
14 | { "trigger":"render(\timpex", "contents":"render(${1:node},{${2:...}})"},
15 |
16 |
17 | ]
18 | }
--------------------------------------------------------------------------------
/IDE plugins/sublime3/impex/impex_lifecycle.sublime-completions:
--------------------------------------------------------------------------------
1 | {
2 | "scope": "text.html.basic source.js.embedded.html meta.block.js,text.html.basic source.js.embedded.html meta.function-call.method.js,source.js meta.block.js",
3 |
4 | "completions":
5 | [
6 | //component
7 | { "trigger":"onCreate\tlifecycle com", "contents":"onCreate:function(){\n\t${1://todo...}\n}"},
8 | { "trigger":"onBeforeCompile\tlifecycle com", "contents":"onBeforeCompile:function(tmpl){\n\t${1://todo...}\n}"},
9 | { "trigger":"onCompile\tlifecycle com", "contents":"onCompile:function(vnode){\n\t${1://todo...}\n}"},
10 | { "trigger":"onBeforeMount\tlifecycle com", "contents":"onBeforeMount:function(dom){\n\t${1://todo...}\n}"},
11 | { "trigger":"onMount\tlifecycle com", "contents":"onMount:function(dom){\n\t${1://todo...}\n}"},
12 | { "trigger":"onPropBind\tlifecycle com", "contents":"onPropBind:function(props){\n\t${1://todo...}\n}"},
13 | { "trigger":"onPropChange\tlifecycle com", "contents":"onPropChange:function(newProps,oldProps){\n\t${1://todo...}\n}"},
14 | { "trigger":"onUpdate\tlifecycle com", "contents":"onUpdate:function(){\n\t${1://todo...}\n}"},
15 | { "trigger":"onBeforeUpdate\tlifecycle com", "contents":"onBeforeUpdate:function(changes){\n\t${1://todo...}\n}"},
16 |
17 | //directive
18 | { "trigger":"onBind\tlifecycle di", "contents":"onBind:function(vnode,data){\n\t${1://todo...}\n}"},
19 | { "trigger":"onUpdate\tlifecycle di", "contents":"onUpdate:function(vnode,data){\n\t${1://todo...}\n}"},
20 | ]
21 | }
--------------------------------------------------------------------------------
/IDE plugins/sublime3/impex/impex_scope.sublime-completions:
--------------------------------------------------------------------------------
1 | {
2 | "scope": "text.html.basic source.js.embedded.html meta.function-call.method.js,source.js meta.block.js meta.function-call.method.js",
3 |
4 | "completions":
5 | [
6 | //component attr
7 | { "trigger":"el\timpex Comp", "contents":"el"},
8 | { "trigger":"state\timpex Comp", "contents":"state"},
9 | { "trigger":"refs\timpex Comp", "contents":"refs"},
10 | { "trigger":"name\timpex Comp", "contents":"name"},
11 | { "trigger":"parent\timpex Comp", "contents":"parent"},
12 | { "trigger":"children\timpex Comp", "contents":"children"},
13 | { "trigger":"setState(\timpex Comp", "contents":"setState(\"${1:path}\",${2:val})"},
14 | { "trigger":"watch(\timpex Comp", "contents":"watch(\"${1:path}\",function(newVal,oldVal){\n\t${2://todo...}\n})"},
15 |
16 | //vnode attr
17 | { "trigger":"on(\timpex VNode", "contents":"on(\"${1:type}\",${2:expOrFn})"},
18 | { "trigger":"setAtt..(\timpex VNode", "contents":"setAttribute(${1:k},${2:v})"},
19 | { "trigger":"getAtt..(\timpex VNode", "contents":"getAttribute(${1:k})"},
20 |
21 | //directive data attr
22 | { "trigger":"comp\timpex Di data", "contents":"comp"},
23 | { "trigger":"value\timpex Di data", "contents":"value"},
24 | { "trigger":"args\timpex Di data", "contents":"args"},
25 | { "trigger":"exp\timpex Di data", "contents":"exp"},
26 | ]
27 | }
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 MrSoya
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # impex.js
2 |
3 | > 一个基于数据驱动的组件式web开发引擎
4 |
5 | ## Website
6 | [http://impexjs.org/](http://impexjs.org/)
7 |
8 | ## Demo
9 |
10 | ```html
11 |
14 | 演示两个相同元素节点更新 15 |
16 | 17 |document.body
。
13 | 匿名组件和命名组件相同,都负责管理自身视图中的数据更新
14 |
15 |
16 | //渲染匿名组件
17 | impex.create({
18 | el:'#demo',
19 | state:{
20 | name:'impex'
21 | }
22 | });
23 |
24 |
25 | 29 | 30 |
31 | 32 |11 | 组件可以接收上级组件传递的参数: 12 |
param
:字符串参数,直接绑定到子组件的$props中,不可变更,不区分类型.param
:类型参数,直接绑定到子组件的$props中,不可变更,区分类型
17 | 示例:
18 |
19 | <x-comp .content="msg" date="Date.now()" .time="time">
20 | </x-comp>
21 |
22 |
26 | 父组件: 27 |
content:{{msg}}
28 | 修改组件参数: 29 |
30 | 子组件:
31 |