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.
Files changed (71) hide show
  1. package/.clinerules +1 -0
  2. package/LICENSE +1 -1
  3. package/README.md +1 -1
  4. package/WHATSNEW.md +106 -0
  5. package/apprun.d.ts +7 -1
  6. package/dist/apprun-dev-tools.js +1 -1
  7. package/dist/apprun-dev-tools.js.map +1 -1
  8. package/dist/apprun-html.esm.js +21 -4
  9. package/dist/apprun-html.esm.js.map +1 -1
  10. package/dist/apprun-html.js +1 -1
  11. package/dist/apprun-html.js.LICENSE.txt +6 -0
  12. package/dist/apprun-html.js.map +1 -1
  13. package/dist/apprun-play-html.esm.js +21 -4
  14. package/dist/apprun-play-html.esm.js.map +1 -1
  15. package/dist/apprun-play.js +1 -1
  16. package/dist/apprun-play.js.map +1 -1
  17. package/dist/apprun.esm.js +1 -1
  18. package/dist/apprun.esm.js.map +1 -1
  19. package/dist/apprun.js +1 -1
  20. package/dist/apprun.js.map +1 -1
  21. package/esm/app.js +38 -10
  22. package/esm/app.js.map +1 -1
  23. package/esm/apprun-code.js.map +1 -1
  24. package/esm/apprun-dev-tools-tests.js.map +1 -1
  25. package/esm/apprun-dev-tools.js.map +1 -1
  26. package/esm/apprun-html.js.map +1 -1
  27. package/esm/apprun-play.js.map +1 -1
  28. package/esm/apprun.js +65 -9
  29. package/esm/apprun.js.map +1 -1
  30. package/esm/component.js +59 -1
  31. package/esm/component.js.map +1 -1
  32. package/esm/decorator.js +33 -0
  33. package/esm/decorator.js.map +1 -1
  34. package/esm/directive.js +31 -0
  35. package/esm/directive.js.map +1 -1
  36. package/esm/router.js +27 -0
  37. package/esm/router.js.map +1 -1
  38. package/esm/types.js +28 -0
  39. package/esm/types.js.map +1 -1
  40. package/esm/vdom-lit-html.js +19 -17
  41. package/esm/vdom-lit-html.js.map +1 -1
  42. package/esm/vdom-my.js.map +1 -1
  43. package/esm/vdom-patch.js.map +1 -1
  44. package/esm/vdom-to-html.js.map +1 -1
  45. package/esm/vdom.js +24 -0
  46. package/esm/vdom.js.map +1 -1
  47. package/esm/web-component.js +32 -0
  48. package/esm/web-component.js.map +1 -1
  49. package/index.html +3 -2
  50. package/jest.config.js +63 -0
  51. package/jest.setup.js +47 -0
  52. package/jsx-runtime.js +1 -1
  53. package/jsx-runtime.js.map +1 -1
  54. package/package.json +16 -43
  55. package/react.js +0 -15
  56. package/rollup.config.js +27 -10
  57. package/src/app.ts +64 -30
  58. package/src/apprun.ts +94 -13
  59. package/src/component.ts +57 -1
  60. package/src/decorator.ts +34 -1
  61. package/src/directive.ts +33 -1
  62. package/src/global.d.ts +22 -0
  63. package/src/router.ts +28 -2
  64. package/src/types/apprun.d.ts +56 -0
  65. package/src/types.ts +30 -1
  66. package/src/vdom-lit-html.ts +21 -19
  67. package/src/vdom.ts +25 -2
  68. package/src/web-component.ts +33 -0
  69. package/tsconfig.jest.json +27 -3
  70. package/tsconfig.json +3 -3
  71. 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
-
@@ -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 = {
@@ -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": "es2015",
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", "es2015", "es5"],
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
+ }
@@ -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
+ }