@coherent.js/core 1.0.0-beta.2 → 1.0.0-beta.3
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/dist/coherent.d.ts +10 -150
- package/dist/coherent.d.ts.map +1 -1
- package/dist/coherent.js +33 -166
- package/dist/coherent.js.map +1 -1
- package/dist/components/component-system.js +109 -109
- package/dist/core/html-utils.js +5 -5
- package/dist/core/object-factory.js +21 -21
- package/dist/core/object-utils.js +2 -2
- package/dist/database/adapters/mongodb.d.ts +15 -0
- package/dist/database/adapters/mongodb.d.ts.map +1 -0
- package/dist/database/adapters/mongodb.js +216 -0
- package/dist/database/adapters/mongodb.js.map +1 -0
- package/dist/database/adapters/mysql.d.ts +12 -0
- package/dist/database/adapters/mysql.d.ts.map +1 -0
- package/dist/database/adapters/mysql.js +171 -0
- package/dist/database/adapters/mysql.js.map +1 -0
- package/dist/database/adapters/postgresql.d.ts +12 -0
- package/dist/database/adapters/postgresql.d.ts.map +1 -0
- package/dist/database/adapters/postgresql.js +177 -0
- package/dist/database/adapters/postgresql.js.map +1 -0
- package/dist/database/adapters/sqlite.d.ts +15 -0
- package/dist/database/adapters/sqlite.d.ts.map +1 -0
- package/dist/database/adapters/sqlite.js +241 -0
- package/dist/database/adapters/sqlite.js.map +1 -0
- package/dist/database/connection-manager.d.ts +135 -0
- package/dist/database/connection-manager.d.ts.map +1 -0
- package/dist/database/connection-manager.js +362 -0
- package/dist/database/connection-manager.js.map +1 -0
- package/dist/database/index.d.ts +38 -0
- package/dist/database/index.d.ts.map +1 -0
- package/dist/database/index.js +60 -0
- package/dist/database/index.js.map +1 -0
- package/dist/database/middleware.d.ts +122 -0
- package/dist/database/middleware.d.ts.map +1 -0
- package/dist/database/middleware.js +390 -0
- package/dist/database/middleware.js.map +1 -0
- package/dist/database/migration.d.ts +62 -0
- package/dist/database/migration.d.ts.map +1 -0
- package/dist/database/migration.js +423 -0
- package/dist/database/migration.js.map +1 -0
- package/dist/database/model.d.ts +8 -0
- package/dist/database/model.d.ts.map +1 -0
- package/dist/database/model.js +167 -0
- package/dist/database/model.js.map +1 -0
- package/dist/database/query-builder.d.ts +111 -0
- package/dist/database/query-builder.d.ts.map +1 -0
- package/dist/database/query-builder.js +187 -0
- package/dist/database/query-builder.js.map +1 -0
- package/dist/database/utils.d.ts +196 -0
- package/dist/database/utils.d.ts.map +1 -0
- package/dist/database/utils.js +372 -0
- package/dist/database/utils.js.map +1 -0
- package/dist/dev/dev-tools.d.ts +1 -1
- package/dist/dev/dev-tools.js +28 -28
- package/dist/performance/bundle-optimizer.js +11 -11
- package/dist/performance/cache-manager.js +6 -6
- package/dist/performance/monitor.js +10 -10
- package/dist/performance/monitor.js.map +1 -1
- package/dist/rendering/base-renderer.js +13 -13
- package/dist/rendering/dom-renderer.d.ts +0 -23
- package/dist/rendering/dom-renderer.d.ts.map +1 -1
- package/dist/rendering/dom-renderer.js +9 -77
- package/dist/rendering/dom-renderer.js.map +1 -1
- package/dist/rendering/html-renderer.d.ts +0 -15
- package/dist/rendering/html-renderer.d.ts.map +1 -1
- package/dist/rendering/html-renderer.js +4 -85
- package/dist/rendering/html-renderer.js.map +1 -1
- package/dist/rendering/streaming-renderer.js +12 -12
- package/dist/utils/dependency-utils.js +2 -2
- package/dist/utils/normalization.js +1 -1
- package/dist/utils/validation.js +1 -1
- package/package.json +1 -1
- package/dist/components/lifecycle.d.ts +0 -212
- package/dist/components/lifecycle.d.ts.map +0 -1
- package/dist/components/lifecycle.js +0 -525
- package/dist/components/lifecycle.js.map +0 -1
- package/dist/forms/validation.d.ts +0 -271
- package/dist/forms/validation.d.ts.map +0 -1
- package/dist/forms/validation.js +0 -573
- package/dist/forms/validation.js.map +0 -1
- package/dist/performance/component-cache.d.ts +0 -120
- package/dist/performance/component-cache.d.ts.map +0 -1
- package/dist/performance/component-cache.js +0 -364
- package/dist/performance/component-cache.js.map +0 -1
- package/dist/rendering/css-manager.d.ts +0 -73
- package/dist/rendering/css-manager.d.ts.map +0 -1
- package/dist/rendering/css-manager.js +0 -176
- package/dist/rendering/css-manager.js.map +0 -1
- package/dist/rendering/vdom-diff.d.ts +0 -47
- package/dist/rendering/vdom-diff.d.ts.map +0 -1
- package/dist/rendering/vdom-diff.js +0 -416
- package/dist/rendering/vdom-diff.js.map +0 -1
- package/dist/routing/router.d.ts +0 -241
- package/dist/routing/router.d.ts.map +0 -1
- package/dist/routing/router.js +0 -648
- package/dist/routing/router.js.map +0 -1
- package/dist/state/reactive-state.d.ts +0 -166
- package/dist/state/reactive-state.d.ts.map +0 -1
- package/dist/state/reactive-state.js +0 -546
- package/dist/state/reactive-state.js.map +0 -1
- package/dist/utils/error-handler.d.ts +0 -148
- package/dist/utils/error-handler.d.ts.map +0 -1
- package/dist/utils/error-handler.js +0 -468
- package/dist/utils/error-handler.js.map +0 -1
|
@@ -33,7 +33,7 @@ export class StreamingRenderer extends BaseRenderer {
|
|
|
33
33
|
* Main streaming render method
|
|
34
34
|
*/
|
|
35
35
|
async *render(component, options = {}) {
|
|
36
|
-
const
|
|
36
|
+
const config = { ...this.config, ...options };
|
|
37
37
|
this.metrics.startTime = performance.now();
|
|
38
38
|
try {
|
|
39
39
|
// Validate input if requested
|
|
@@ -48,9 +48,9 @@ export class StreamingRenderer extends BaseRenderer {
|
|
|
48
48
|
this.buffer = '';
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
catch (
|
|
52
|
-
// Stream
|
|
53
|
-
yield this.createErrorChunk(
|
|
51
|
+
catch (_error) {
|
|
52
|
+
// Stream _error information
|
|
53
|
+
yield this.createErrorChunk(_error);
|
|
54
54
|
}
|
|
55
55
|
finally {
|
|
56
56
|
this.metrics.endTime = performance.now();
|
|
@@ -99,7 +99,7 @@ export class StreamingRenderer extends BaseRenderer {
|
|
|
99
99
|
// Opening tag
|
|
100
100
|
let openTag = `<${tagName}`;
|
|
101
101
|
// Add attributes
|
|
102
|
-
const attributes = this.utils.extractAttributes(
|
|
102
|
+
const attributes = this.utils.extractAttributes(props);
|
|
103
103
|
if (attributes) {
|
|
104
104
|
openTag += ` ${attributes}`;
|
|
105
105
|
}
|
|
@@ -113,7 +113,7 @@ export class StreamingRenderer extends BaseRenderer {
|
|
|
113
113
|
yield* this.streamText(escapeHtml(String(text)));
|
|
114
114
|
}
|
|
115
115
|
// Handle children
|
|
116
|
-
if (hasChildren(
|
|
116
|
+
if (hasChildren(props)) {
|
|
117
117
|
const children = normalizeChildren(props.children);
|
|
118
118
|
for (const child of children) {
|
|
119
119
|
yield* this.streamComponent(child, config, depth);
|
|
@@ -158,13 +158,13 @@ export class StreamingRenderer extends BaseRenderer {
|
|
|
158
158
|
return chunk;
|
|
159
159
|
}
|
|
160
160
|
/**
|
|
161
|
-
* Create an
|
|
161
|
+
* Create an _error chunk
|
|
162
162
|
*/
|
|
163
|
-
createErrorChunk(
|
|
164
|
-
return this.createChunk(`<!-- Streaming Error: ${
|
|
165
|
-
|
|
166
|
-
errorMessage:
|
|
167
|
-
errorStack:
|
|
163
|
+
createErrorChunk(_error) {
|
|
164
|
+
return this.createChunk(`<!-- Streaming Error: ${_error.message} -->`, {
|
|
165
|
+
_error: true,
|
|
166
|
+
errorMessage: _error.message,
|
|
167
|
+
errorStack: _error.stack
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
170
|
/**
|
|
@@ -17,7 +17,7 @@ export function isPeerDependencyAvailable(packageName) {
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
* Dynamically import a peer dependency with
|
|
20
|
+
* Dynamically import a peer dependency with _error handling
|
|
21
21
|
* @param {string} packageName - Name of the package to import
|
|
22
22
|
* @param {string} integrationName - Human-readable name of the integration
|
|
23
23
|
* @returns {Promise<any>} - The imported module
|
|
@@ -62,7 +62,7 @@ export function createLazyIntegration(packageName, integrationName, createIntegr
|
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
|
-
* Check multiple peer dependencies and provide helpful
|
|
65
|
+
* Check multiple peer dependencies and provide helpful _error messages
|
|
66
66
|
* @param {Array<{package: string, integration: string}>} dependencies - List of dependencies to check
|
|
67
67
|
* @returns {Object} - Object with availability status for each dependency
|
|
68
68
|
*/
|
package/dist/utils/validation.js
CHANGED
package/package.json
CHANGED
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Lifecycle hooks factory
|
|
3
|
-
*/
|
|
4
|
-
export function createLifecycleHooks(): {};
|
|
5
|
-
export function getCurrentInstance(): any;
|
|
6
|
-
export function setCurrentInstance(instance: any): void;
|
|
7
|
-
/**
|
|
8
|
-
* Component decorator for automatic lifecycle management
|
|
9
|
-
*/
|
|
10
|
-
export function withLifecycle(component: any, options?: {}): (props?: {}) => any;
|
|
11
|
-
export namespace LIFECYCLE_PHASES {
|
|
12
|
-
let BEFORE_CREATE: string;
|
|
13
|
-
let CREATED: string;
|
|
14
|
-
let BEFORE_MOUNT: string;
|
|
15
|
-
let MOUNTED: string;
|
|
16
|
-
let BEFORE_UPDATE: string;
|
|
17
|
-
let UPDATED: string;
|
|
18
|
-
let BEFORE_UNMOUNT: string;
|
|
19
|
-
let UNMOUNTED: string;
|
|
20
|
-
let ERROR: string;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Component lifecycle manager
|
|
24
|
-
*/
|
|
25
|
-
export class ComponentLifecycle {
|
|
26
|
-
constructor(component: any, options?: {});
|
|
27
|
-
component: any;
|
|
28
|
-
id: string;
|
|
29
|
-
options: {};
|
|
30
|
-
phase: any;
|
|
31
|
-
hooks: Map<any, any>;
|
|
32
|
-
state: ReactiveState;
|
|
33
|
-
props: {};
|
|
34
|
-
context: {};
|
|
35
|
-
isMounted: boolean;
|
|
36
|
-
isDestroyed: boolean;
|
|
37
|
-
children: Set<any>;
|
|
38
|
-
parent: any;
|
|
39
|
-
eventHandlers: Map<any, any>;
|
|
40
|
-
timers: Set<any>;
|
|
41
|
-
subscriptions: Set<any>;
|
|
42
|
-
/**
|
|
43
|
-
* Generate unique component ID
|
|
44
|
-
*/
|
|
45
|
-
generateId(): string;
|
|
46
|
-
/**
|
|
47
|
-
* Add lifecycle hook
|
|
48
|
-
*/
|
|
49
|
-
hook(phase: any, callback: any): this;
|
|
50
|
-
/**
|
|
51
|
-
* Execute hooks for a specific phase
|
|
52
|
-
*/
|
|
53
|
-
executeHook(phase: any, ...args: any[]): Promise<void>;
|
|
54
|
-
/**
|
|
55
|
-
* Handle component errors
|
|
56
|
-
*/
|
|
57
|
-
handleError(error: any, phase: any): void;
|
|
58
|
-
/**
|
|
59
|
-
* Mount component
|
|
60
|
-
*/
|
|
61
|
-
mount(container: any, props?: {}): Promise<void>;
|
|
62
|
-
container: any;
|
|
63
|
-
/**
|
|
64
|
-
* Update component
|
|
65
|
-
*/
|
|
66
|
-
update(newProps?: {}): Promise<void>;
|
|
67
|
-
/**
|
|
68
|
-
* Unmount component
|
|
69
|
-
*/
|
|
70
|
-
unmount(): Promise<void>;
|
|
71
|
-
/**
|
|
72
|
-
* Add child component
|
|
73
|
-
*/
|
|
74
|
-
addChild(child: any): void;
|
|
75
|
-
/**
|
|
76
|
-
* Remove child component
|
|
77
|
-
*/
|
|
78
|
-
removeChild(child: any): void;
|
|
79
|
-
/**
|
|
80
|
-
* Add event listener with automatic cleanup
|
|
81
|
-
*/
|
|
82
|
-
addEventListener(element: any, event: any, listener: any, options?: {}): () => void;
|
|
83
|
-
/**
|
|
84
|
-
* Add subscription with automatic cleanup
|
|
85
|
-
*/
|
|
86
|
-
addSubscription(unsubscribe: any): any;
|
|
87
|
-
/**
|
|
88
|
-
* Set timer with automatic cleanup
|
|
89
|
-
*/
|
|
90
|
-
setTimeout(callback: any, delay: any): NodeJS.Timeout;
|
|
91
|
-
setInterval(callback: any, interval: any): NodeJS.Timeout;
|
|
92
|
-
/**
|
|
93
|
-
* Get component statistics
|
|
94
|
-
*/
|
|
95
|
-
getStats(): {
|
|
96
|
-
id: string;
|
|
97
|
-
phase: any;
|
|
98
|
-
isMounted: boolean;
|
|
99
|
-
isDestroyed: boolean;
|
|
100
|
-
childCount: number;
|
|
101
|
-
eventHandlers: number;
|
|
102
|
-
subscriptions: number;
|
|
103
|
-
timers: number;
|
|
104
|
-
state: {
|
|
105
|
-
stateKeys: number;
|
|
106
|
-
computedKeys: number;
|
|
107
|
-
watcherKeys: number;
|
|
108
|
-
historyLength: number;
|
|
109
|
-
middlewareCount: number;
|
|
110
|
-
};
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Event system for components
|
|
115
|
-
*/
|
|
116
|
-
export class ComponentEventSystem {
|
|
117
|
-
events: Map<any, any>;
|
|
118
|
-
globalHandlers: Map<any, any>;
|
|
119
|
-
/**
|
|
120
|
-
* Emit event to component or globally
|
|
121
|
-
*/
|
|
122
|
-
emit(eventName: any, data?: {}, target?: null): {
|
|
123
|
-
name: any;
|
|
124
|
-
data: {};
|
|
125
|
-
target: null;
|
|
126
|
-
timestamp: number;
|
|
127
|
-
stopped: boolean;
|
|
128
|
-
preventDefault: boolean;
|
|
129
|
-
};
|
|
130
|
-
/**
|
|
131
|
-
* Listen for events on component or globally
|
|
132
|
-
*/
|
|
133
|
-
on(eventName: any, handler: any, componentId?: null): () => void;
|
|
134
|
-
/**
|
|
135
|
-
* Remove event handler
|
|
136
|
-
*/
|
|
137
|
-
off(eventName: any, handler: any, componentId?: null): void;
|
|
138
|
-
/**
|
|
139
|
-
* Listen once
|
|
140
|
-
*/
|
|
141
|
-
once(eventName: any, handler: any, componentId?: null): () => void;
|
|
142
|
-
/**
|
|
143
|
-
* Notify component handlers
|
|
144
|
-
*/
|
|
145
|
-
_notifyHandlers(componentId: any, event: any): void;
|
|
146
|
-
/**
|
|
147
|
-
* Notify global handlers
|
|
148
|
-
*/
|
|
149
|
-
_notifyGlobalHandlers(event: any): void;
|
|
150
|
-
/**
|
|
151
|
-
* Clean up events for a component
|
|
152
|
-
*/
|
|
153
|
-
cleanup(componentId: any): void;
|
|
154
|
-
/**
|
|
155
|
-
* Get event statistics
|
|
156
|
-
*/
|
|
157
|
-
getStats(): {
|
|
158
|
-
componentEvents: number;
|
|
159
|
-
globalEvents: number;
|
|
160
|
-
totalHandlers: any;
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* Global event system instance
|
|
165
|
-
*/
|
|
166
|
-
export const eventSystem: ComponentEventSystem;
|
|
167
|
-
/**
|
|
168
|
-
* Lifecycle hooks for direct use
|
|
169
|
-
*/
|
|
170
|
-
export const useHooks: {};
|
|
171
|
-
export namespace componentUtils {
|
|
172
|
-
/**
|
|
173
|
-
* Get component lifecycle instance
|
|
174
|
-
*/
|
|
175
|
-
function getLifecycle(component: any): any;
|
|
176
|
-
/**
|
|
177
|
-
* Create component with lifecycle
|
|
178
|
-
*/
|
|
179
|
-
function createWithLifecycle(component: any, options?: {}): {
|
|
180
|
-
component: any;
|
|
181
|
-
lifecycle: ComponentLifecycle;
|
|
182
|
-
mount: (container: any, props?: {}) => Promise<void>;
|
|
183
|
-
unmount: () => Promise<void>;
|
|
184
|
-
update: (newProps?: {}) => Promise<void>;
|
|
185
|
-
};
|
|
186
|
-
/**
|
|
187
|
-
* Get all component instances
|
|
188
|
-
*/
|
|
189
|
-
function getAllInstances(): any[];
|
|
190
|
-
/**
|
|
191
|
-
* Find component by ID
|
|
192
|
-
*/
|
|
193
|
-
function findById(id: any): any;
|
|
194
|
-
/**
|
|
195
|
-
* Emit event to component
|
|
196
|
-
*/
|
|
197
|
-
function emit(component: any, eventName: any, data: any): {
|
|
198
|
-
name: any;
|
|
199
|
-
data: {};
|
|
200
|
-
target: null;
|
|
201
|
-
timestamp: number;
|
|
202
|
-
stopped: boolean;
|
|
203
|
-
preventDefault: boolean;
|
|
204
|
-
};
|
|
205
|
-
/**
|
|
206
|
-
* Listen to component events
|
|
207
|
-
*/
|
|
208
|
-
function listen(component: any, eventName: any, handler: any): () => void;
|
|
209
|
-
}
|
|
210
|
-
export default ComponentLifecycle;
|
|
211
|
-
import { ReactiveState } from '../state/reactive-state.js';
|
|
212
|
-
//# sourceMappingURL=lifecycle.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../../src/components/lifecycle.js"],"names":[],"mappings":"AAoeA;;GAEG;AACH,2CAcC;AAOD,0CAEC;AAED,wDAEC;AA8DD;;GAEG;AACH,8DACuC,UAAU,SAchD;;;;;;;;;;;;AArjBD;;GAEG;AACH;IACI,0CAwBC;IAvBG,eAA0B;IAC1B,WAA2B;IAC3B,YAAsB;IACtB,WAAiB;IACjB,qBAAsB;IACtB,qBAAgC;IAChC,UAAe;IACf,YAAiB;IACjB,mBAAsB;IACtB,qBAAwB;IACxB,mBAAyB;IACzB,YAAkB;IAClB,6BAA8B;IAC9B,iBAAuB;IACvB,wBAA8B;IAWlC;;OAEG;IACH,qBAEC;IAED;;OAEG;IACH,sCAWC;IAED;;OAEG;IACH,uDAeC;IAED;;OAEG;IACH,0CAYC;IAED;;OAEG;IACH,iDAkBC;IAXG,eAA0B;IAa9B;;OAEG;IACH,qCAgBC;IAED;;OAEG;IACH,yBAmDC;IAED;;OAEG;IACH,2BAGC;IAED;;OAEG;IACH,8BAGC;IAED;;OAEG;IACH,oFAqBC;IAED;;OAEG;IACH,uCAGC;IAED;;OAEG;IACH,sDAQC;IAED,0DAIC;IAED;;OAEG;IACH;;;;;;;;;;;;;;;;MAYC;CACJ;AAED;;GAEG;AACH;IAEQ,sBAAuB;IACvB,8BAA+B;IAGnC;;OAEG;IACH;;;;;;;MAsBC;IAED;;OAEG;IACH,iEAwBC;IAED;;OAEG;IACH,4DAuBC;IAED;;OAEG;IACH,mEAOC;IAED;;OAEG;IACH,oDAiBC;IAED;;OAEG;IACH,wCAgBC;IAED;;OAEG;IACH,gCAEC;IAED;;OAEG;IACH;;;;MAYC;CACJ;AAED;;GAEG;AACH,+CAAsD;AAkCtD;;GAEG;AACH,0BAA+C;;IAM3C;;OAEG;IACH,2CAEC;IAED;;OAEG;IACH;;;;;;MASC;IAED;;OAEG;IACH,kCAEC;IAED;;OAEG;IACH,gCAEC;IAED;;OAEG;IACH;;;;;;;MAEC;IAED;;OAEG;IACH,0EAGC;;;8BAvjByB,4BAA4B"}
|