apprun 3.33.9 → 3.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.clinerules +1 -0
- package/LICENSE +1 -1
- package/README.md +1 -1
- package/WHATSNEW.md +106 -0
- package/apprun.d.ts +7 -1
- package/dist/apprun-dev-tools.js +1 -1
- package/dist/apprun-dev-tools.js.map +1 -1
- package/dist/apprun-html.esm.js +21 -4
- package/dist/apprun-html.esm.js.map +1 -1
- package/dist/apprun-html.js +1 -1
- package/dist/apprun-html.js.LICENSE.txt +6 -0
- package/dist/apprun-html.js.map +1 -1
- package/dist/apprun-play-html.esm.js +21 -4
- package/dist/apprun-play-html.esm.js.map +1 -1
- package/dist/apprun-play.js +1 -1
- package/dist/apprun-play.js.map +1 -1
- package/dist/apprun.esm.js +1 -1
- package/dist/apprun.esm.js.map +1 -1
- package/dist/apprun.js +1 -1
- package/dist/apprun.js.map +1 -1
- package/esm/app.js +38 -10
- package/esm/app.js.map +1 -1
- package/esm/apprun-code.js.map +1 -1
- package/esm/apprun-dev-tools-tests.js.map +1 -1
- package/esm/apprun-dev-tools.js.map +1 -1
- package/esm/apprun-html.js.map +1 -1
- package/esm/apprun-play.js.map +1 -1
- package/esm/apprun.js +65 -9
- package/esm/apprun.js.map +1 -1
- package/esm/component.js +59 -1
- package/esm/component.js.map +1 -1
- package/esm/decorator.js +33 -0
- package/esm/decorator.js.map +1 -1
- package/esm/directive.js +31 -0
- package/esm/directive.js.map +1 -1
- package/esm/router.js +27 -0
- package/esm/router.js.map +1 -1
- package/esm/types.js +28 -0
- package/esm/types.js.map +1 -1
- package/esm/vdom-lit-html.js +19 -17
- package/esm/vdom-lit-html.js.map +1 -1
- package/esm/vdom-my.js.map +1 -1
- package/esm/vdom-patch.js.map +1 -1
- package/esm/vdom-to-html.js.map +1 -1
- package/esm/vdom.js +24 -0
- package/esm/vdom.js.map +1 -1
- package/esm/web-component.js +32 -0
- package/esm/web-component.js.map +1 -1
- package/index.html +3 -2
- package/jest.config.js +63 -0
- package/jest.setup.js +47 -0
- package/jsx-runtime.js +1 -1
- package/jsx-runtime.js.map +1 -1
- package/package.json +16 -43
- package/react.js +0 -15
- package/rollup.config.js +27 -10
- package/src/app.ts +64 -30
- package/src/apprun.ts +94 -13
- package/src/component.ts +57 -1
- package/src/decorator.ts +34 -1
- package/src/directive.ts +33 -1
- package/src/global.d.ts +22 -0
- package/src/router.ts +28 -2
- package/src/types/apprun.d.ts +56 -0
- package/src/types.ts +30 -1
- package/src/vdom-lit-html.ts +21 -19
- package/src/vdom.ts +25 -2
- package/src/web-component.ts +33 -0
- package/tsconfig.jest.json +27 -3
- package/tsconfig.json +3 -3
- package/webpack.config.cjs +9 -2
package/src/vdom.ts
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Virtual DOM Implementation
|
|
3
|
+
*
|
|
4
|
+
* This file provides the core virtual DOM functionality:
|
|
5
|
+
* 1. createElement: Creates virtual DOM nodes
|
|
6
|
+
* 2. Fragment: Support for fragments
|
|
7
|
+
* 3. render: Renders virtual DOM to real DOM
|
|
8
|
+
* 4. safeHTML: Safely renders HTML strings
|
|
9
|
+
*
|
|
10
|
+
* The virtual DOM system:
|
|
11
|
+
* - Provides efficient DOM updates
|
|
12
|
+
* - Supports JSX compilation
|
|
13
|
+
* - Handles component rendering
|
|
14
|
+
* - Manages DOM diffing and patching
|
|
15
|
+
*
|
|
16
|
+
* Usage:
|
|
17
|
+
* ```ts
|
|
18
|
+
* // JSX gets compiled to createElement calls
|
|
19
|
+
* const vdom = <div id="app">Hello</div>;
|
|
20
|
+
*
|
|
21
|
+
* // Render to DOM
|
|
22
|
+
* render(document.body, vdom);
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
|
|
1
26
|
import { createElement, updateElement, Fragment, safeHTML } from './vdom-my';
|
|
2
27
|
export { createElement, Fragment, updateElement as render, safeHTML };
|
|
3
28
|
export { createElement as jsx, createElement as jsxs };
|
|
4
|
-
|
|
5
|
-
|
package/src/web-component.ts
CHANGED
|
@@ -1,3 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Web Components Integration
|
|
3
|
+
*
|
|
4
|
+
* This file enables using AppRun components as Web Components:
|
|
5
|
+
* 1. Custom Element Creation
|
|
6
|
+
* - Converts AppRun components to custom elements
|
|
7
|
+
* - Handles lifecycle (connected, disconnected, etc)
|
|
8
|
+
* - Manages shadow DOM and light DOM rendering
|
|
9
|
+
*
|
|
10
|
+
* 2. Property/Attribute Sync
|
|
11
|
+
* - Observes attribute changes
|
|
12
|
+
* - Updates component state automatically
|
|
13
|
+
* - Handles camelCase/kebab-case conversion
|
|
14
|
+
* - Supports complex property types
|
|
15
|
+
*
|
|
16
|
+
* 3. Event Handling
|
|
17
|
+
* - Proxies events between component and element
|
|
18
|
+
* - Supports both global and local events
|
|
19
|
+
* - Maintains proper event bubbling
|
|
20
|
+
*
|
|
21
|
+
* Usage:
|
|
22
|
+
* ```ts
|
|
23
|
+
* // Register web component
|
|
24
|
+
* @customElement('my-element')
|
|
25
|
+
* class MyComponent extends Component {
|
|
26
|
+
* // Regular AppRun component code
|
|
27
|
+
* }
|
|
28
|
+
*
|
|
29
|
+
* // Use in HTML
|
|
30
|
+
* <my-element name="value"></my-element>
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
|
|
1
34
|
declare var customElements;
|
|
2
35
|
|
|
3
36
|
export type CustomElementOptions = {
|
package/tsconfig.jest.json
CHANGED
|
@@ -11,6 +11,30 @@
|
|
|
11
11
|
"esModuleInterop": true,
|
|
12
12
|
"downlevelIteration": true,
|
|
13
13
|
"allowJs": true,
|
|
14
|
-
"outDir": "coverage/src"
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
"outDir": "coverage/src",
|
|
15
|
+
"strict": true,
|
|
16
|
+
"noImplicitAny": true,
|
|
17
|
+
"strictNullChecks": true,
|
|
18
|
+
"strictFunctionTypes": true,
|
|
19
|
+
"strictBindCallApply": true,
|
|
20
|
+
"strictPropertyInitialization": true,
|
|
21
|
+
"noImplicitThis": true,
|
|
22
|
+
"alwaysStrict": true,
|
|
23
|
+
"skipLibCheck": true,
|
|
24
|
+
"forceConsistentCasingInFileNames": true,
|
|
25
|
+
"baseUrl": ".",
|
|
26
|
+
"paths": {
|
|
27
|
+
"*": ["src/types/*"]
|
|
28
|
+
},
|
|
29
|
+
"typeRoots": [
|
|
30
|
+
"./node_modules/@types",
|
|
31
|
+
"./src/types"
|
|
32
|
+
],
|
|
33
|
+
"types": ["jest", "node"]
|
|
34
|
+
},
|
|
35
|
+
"include": [
|
|
36
|
+
"src/**/*",
|
|
37
|
+
"tests/**/*",
|
|
38
|
+
"demo/**/*"
|
|
39
|
+
]
|
|
40
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"target": "
|
|
3
|
+
"target": "es2018",
|
|
4
4
|
"module": "es2015",
|
|
5
5
|
"moduleResolution": "node",
|
|
6
6
|
"jsx": "react",
|
|
7
7
|
"jsxFactory": "app.h",
|
|
8
8
|
"jsxFragmentFactory": "app.Fragment",
|
|
9
|
-
"lib": ["dom", "
|
|
9
|
+
"lib": ["dom", "es2018", "esnext.asynciterable"],
|
|
10
10
|
"experimentalDecorators": true,
|
|
11
11
|
"sourceMap": true,
|
|
12
12
|
"esModuleInterop": true,
|
|
13
13
|
"downlevelIteration": true,
|
|
14
14
|
"skipLibCheck": true
|
|
15
15
|
}
|
|
16
|
-
}
|
|
16
|
+
}
|
package/webpack.config.cjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
|
+
const webpack = require('webpack');
|
|
2
3
|
|
|
3
4
|
module.exports = {
|
|
4
5
|
entry: {
|
|
@@ -28,5 +29,11 @@ module.exports = {
|
|
|
28
29
|
open: true,
|
|
29
30
|
static: path.join(__dirname),
|
|
30
31
|
},
|
|
31
|
-
devtool: 'source-map'
|
|
32
|
-
|
|
32
|
+
devtool: 'source-map',
|
|
33
|
+
plugins: [
|
|
34
|
+
new webpack.DefinePlugin({
|
|
35
|
+
// This tells Lit to run in production mode
|
|
36
|
+
'globalThis.DEV_MODE': JSON.stringify(false)
|
|
37
|
+
})
|
|
38
|
+
]
|
|
39
|
+
}
|