@lark.js/mvc 0.0.11 → 0.0.12
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/devtool.cjs +272 -257
- package/dist/devtool.js +273 -258
- package/dist/index.cjs +278 -269
- package/dist/index.d.cts +61 -2
- package/dist/index.d.ts +61 -2
- package/dist/index.js +277 -269
- package/dist/rspack.cjs +8 -4
- package/dist/rspack.js +8 -4
- package/dist/runtime.js +1 -1
- package/dist/vite.cjs +51 -5
- package/dist/vite.d.cts +7 -1
- package/dist/vite.d.ts +7 -1
- package/dist/vite.js +53 -4
- package/dist/webpack.cjs +8 -4
- package/dist/webpack.js +8 -4
- package/package.json +1 -1
- package/src/client.d.ts +8 -0
- /package/dist/{chunk-RIV4NK3K.js → chunk-66OZBBSP.js} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -121,6 +121,34 @@ declare class EventEmitter<T = unknown> implements EventEmitterInterface<T> {
|
|
|
121
121
|
fire(event: string, data?: Record<string, unknown>, remove?: boolean, lastToFirst?: boolean): this;
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
+
/**
|
|
125
|
+
* Minimal HMR context interface.
|
|
126
|
+
* Compatible with Vite's `import.meta.hot` and webpack's `module.hot`.
|
|
127
|
+
* Defined here to avoid depending on bundler-specific type packages.
|
|
128
|
+
*/
|
|
129
|
+
interface HotContext {
|
|
130
|
+
/** Accept a self-update. The callback receives the new module namespace. */
|
|
131
|
+
accept(cb?: (mod: {
|
|
132
|
+
default?: unknown;
|
|
133
|
+
} | undefined) => void): void;
|
|
134
|
+
/** Register a cleanup callback that runs before this module is replaced. */
|
|
135
|
+
dispose(cb: (data: unknown) => void): void;
|
|
136
|
+
/** Force a full page reload (fallback when HMR cannot handle the update). */
|
|
137
|
+
invalidate(): void;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Find all currently mounted frames whose viewPath matches the given path,
|
|
141
|
+
* and re-mount them.
|
|
142
|
+
*
|
|
143
|
+
* After a new View class is registered via `registerViewClass`, calling this
|
|
144
|
+
* function triggers `frame.mountView()` on each matching frame. Since the new
|
|
145
|
+
* class is already in the registry, `Frame.mountView` takes the synchronous
|
|
146
|
+
* path (`getViewClass` returns the class immediately).
|
|
147
|
+
*
|
|
148
|
+
* @param viewPath - The view path to match (e.g. 'home', 'components/list')
|
|
149
|
+
*/
|
|
150
|
+
declare function reloadViews(viewPath: string): void;
|
|
151
|
+
|
|
124
152
|
/**
|
|
125
153
|
* Base View class.
|
|
126
154
|
* Views are created via View.extend() and mounted by Frame.
|
|
@@ -274,6 +302,37 @@ declare class View implements ViewInterface {
|
|
|
274
302
|
* Merge mixins into View prototype.
|
|
275
303
|
*/
|
|
276
304
|
static merge(this: typeof View, ...mixins: Record<string, unknown>[]): typeof View;
|
|
305
|
+
/**
|
|
306
|
+
* Set up HMR accept handler for this view module.
|
|
307
|
+
*
|
|
308
|
+
* When the module is hot-replaced, the new View class is extracted from
|
|
309
|
+
* the new module, registered in the view registry, and all currently
|
|
310
|
+
* mounted frames using this viewPath are re-mounted.
|
|
311
|
+
*
|
|
312
|
+
* No-op when `hot` is undefined (production / non-HMR environment).
|
|
313
|
+
*
|
|
314
|
+
* ```ts
|
|
315
|
+
* if (import.meta.hot) {
|
|
316
|
+
* HomeView.accept(import.meta.hot, 'home');
|
|
317
|
+
* }
|
|
318
|
+
* ```
|
|
319
|
+
*/
|
|
320
|
+
static accept(hot: HotContext | undefined, viewPath: string): void;
|
|
321
|
+
/**
|
|
322
|
+
* Set up HMR dispose handler for this view module.
|
|
323
|
+
*
|
|
324
|
+
* When the module is about to be replaced, the old View class is removed
|
|
325
|
+
* from the registry so subsequent lookups don't return the stale class.
|
|
326
|
+
*
|
|
327
|
+
* No-op when `hot` is undefined (production / non-HMR environment).
|
|
328
|
+
*
|
|
329
|
+
* ```ts
|
|
330
|
+
* if (import.meta.hot) {
|
|
331
|
+
* HomeView.dispose(import.meta.hot, 'home');
|
|
332
|
+
* }
|
|
333
|
+
* ```
|
|
334
|
+
*/
|
|
335
|
+
static dispose(hot: HotContext | undefined, viewPath: string): void;
|
|
277
336
|
}
|
|
278
337
|
/**
|
|
279
338
|
* Type-safe wrapper around `View.extend()`.
|
|
@@ -689,7 +748,7 @@ interface VDomNode {
|
|
|
689
748
|
hasSpecials?: Record<string, string> | undefined;
|
|
690
749
|
/** Child VDomNode array (undefined for text/raw/self-closing) */
|
|
691
750
|
children?: VDomNode[] | undefined;
|
|
692
|
-
/** Diff key: from id,
|
|
751
|
+
/** Diff key: from id, #, or v-lark path */
|
|
693
752
|
compareKey?: string | undefined;
|
|
694
753
|
/** Keyed children count map (compareKey -> count) */
|
|
695
754
|
reused?: Record<string, number> | undefined;
|
|
@@ -2271,4 +2330,4 @@ declare function create<T>(name: string, creator: StateCreator<T>): StoreApi<T>;
|
|
|
2271
2330
|
*/
|
|
2272
2331
|
declare function bindStore<T>(view: unknown, store: StoreApi<T>, selector?: (state: T) => Record<string, unknown>): () => void;
|
|
2273
2332
|
|
|
2274
|
-
export { type AnyFunc, CALL_BREAK_TIME, Cache, type CacheEntry, type CacheInterface, type CacheOptions, type ChangeEvent, type CompileOptions, CrossSite, type CrossSiteConfig, type DomElement, type DomOp, type DomRef, EVENT_METHOD_REGEXP, EventDelegator, EventEmitter, type EventEmitterInterface, type EventListenerEntry, Frame, type FrameBoundElement, type FrameInterface, type FrameInvokeEntry, type FrameStaticEvent, Framework, type FrameworkConfig, type FrameworkInterface, LARK_VIEW, type Location, type LocationDiff, type MixinEventHandler, type ParamDiff, type ParsedUri, Payload, type PayloadInterface, type PendingCacheEntry, RouterEvents as ROUTER_EVENTS, type RouteChangeEvent, type RouteChangedEvent, type RouteViewConfig, Router, type RouterInterface, SPLITTER, Service, type ServiceCacheInfo, type ServiceEvent, type ServiceMetaEntry, type ServiceOptions, State, type StateInterface, type StoreApi, TAG_NAME_REGEXP, Updater, type UpdaterInterface, type VDomCreateFn, type VDomNode, type VDomRef, type VDomTemplate, VIEW_EVENT_METHOD_REGEXP, View, type ViewEvent, type ViewEventSelectorEntry, type ViewGlobalEventEntry, type ViewInterface, type ViewLocationObserved, type ViewObserveLocation, type ViewResourceEntry, type ViewTemplate, type VoidFunc, applyStyle, bindStore, computed, create, createVDomRef, defineView, config as frameworkConfig, getRouteMode, invalidateViewClass, mark, markBooted, markRouterBooted, nextCounter, registerViewClass, resetProjectsMap, safeguard, unmark, use, useUrlState, vdomCreate };
|
|
2333
|
+
export { type AnyFunc, CALL_BREAK_TIME, Cache, type CacheEntry, type CacheInterface, type CacheOptions, type ChangeEvent, type CompileOptions, CrossSite, type CrossSiteConfig, type DomElement, type DomOp, type DomRef, EVENT_METHOD_REGEXP, EventDelegator, EventEmitter, type EventEmitterInterface, type EventListenerEntry, Frame, type FrameBoundElement, type FrameInterface, type FrameInvokeEntry, type FrameStaticEvent, Framework, type FrameworkConfig, type FrameworkInterface, type HotContext, LARK_VIEW, type Location, type LocationDiff, type MixinEventHandler, type ParamDiff, type ParsedUri, Payload, type PayloadInterface, type PendingCacheEntry, RouterEvents as ROUTER_EVENTS, type RouteChangeEvent, type RouteChangedEvent, type RouteViewConfig, Router, type RouterInterface, SPLITTER, Service, type ServiceCacheInfo, type ServiceEvent, type ServiceMetaEntry, type ServiceOptions, State, type StateInterface, type StoreApi, TAG_NAME_REGEXP, Updater, type UpdaterInterface, type VDomCreateFn, type VDomNode, type VDomRef, type VDomTemplate, VIEW_EVENT_METHOD_REGEXP, View, type ViewEvent, type ViewEventSelectorEntry, type ViewGlobalEventEntry, type ViewInterface, type ViewLocationObserved, type ViewObserveLocation, type ViewResourceEntry, type ViewTemplate, type VoidFunc, applyStyle, bindStore, computed, create, createVDomRef, defineView, config as frameworkConfig, getRouteMode, invalidateViewClass, mark, markBooted, markRouterBooted, nextCounter, registerViewClass, reloadViews, resetProjectsMap, safeguard, unmark, use, useUrlState, vdomCreate };
|
package/dist/index.d.ts
CHANGED
|
@@ -121,6 +121,34 @@ declare class EventEmitter<T = unknown> implements EventEmitterInterface<T> {
|
|
|
121
121
|
fire(event: string, data?: Record<string, unknown>, remove?: boolean, lastToFirst?: boolean): this;
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
+
/**
|
|
125
|
+
* Minimal HMR context interface.
|
|
126
|
+
* Compatible with Vite's `import.meta.hot` and webpack's `module.hot`.
|
|
127
|
+
* Defined here to avoid depending on bundler-specific type packages.
|
|
128
|
+
*/
|
|
129
|
+
interface HotContext {
|
|
130
|
+
/** Accept a self-update. The callback receives the new module namespace. */
|
|
131
|
+
accept(cb?: (mod: {
|
|
132
|
+
default?: unknown;
|
|
133
|
+
} | undefined) => void): void;
|
|
134
|
+
/** Register a cleanup callback that runs before this module is replaced. */
|
|
135
|
+
dispose(cb: (data: unknown) => void): void;
|
|
136
|
+
/** Force a full page reload (fallback when HMR cannot handle the update). */
|
|
137
|
+
invalidate(): void;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Find all currently mounted frames whose viewPath matches the given path,
|
|
141
|
+
* and re-mount them.
|
|
142
|
+
*
|
|
143
|
+
* After a new View class is registered via `registerViewClass`, calling this
|
|
144
|
+
* function triggers `frame.mountView()` on each matching frame. Since the new
|
|
145
|
+
* class is already in the registry, `Frame.mountView` takes the synchronous
|
|
146
|
+
* path (`getViewClass` returns the class immediately).
|
|
147
|
+
*
|
|
148
|
+
* @param viewPath - The view path to match (e.g. 'home', 'components/list')
|
|
149
|
+
*/
|
|
150
|
+
declare function reloadViews(viewPath: string): void;
|
|
151
|
+
|
|
124
152
|
/**
|
|
125
153
|
* Base View class.
|
|
126
154
|
* Views are created via View.extend() and mounted by Frame.
|
|
@@ -274,6 +302,37 @@ declare class View implements ViewInterface {
|
|
|
274
302
|
* Merge mixins into View prototype.
|
|
275
303
|
*/
|
|
276
304
|
static merge(this: typeof View, ...mixins: Record<string, unknown>[]): typeof View;
|
|
305
|
+
/**
|
|
306
|
+
* Set up HMR accept handler for this view module.
|
|
307
|
+
*
|
|
308
|
+
* When the module is hot-replaced, the new View class is extracted from
|
|
309
|
+
* the new module, registered in the view registry, and all currently
|
|
310
|
+
* mounted frames using this viewPath are re-mounted.
|
|
311
|
+
*
|
|
312
|
+
* No-op when `hot` is undefined (production / non-HMR environment).
|
|
313
|
+
*
|
|
314
|
+
* ```ts
|
|
315
|
+
* if (import.meta.hot) {
|
|
316
|
+
* HomeView.accept(import.meta.hot, 'home');
|
|
317
|
+
* }
|
|
318
|
+
* ```
|
|
319
|
+
*/
|
|
320
|
+
static accept(hot: HotContext | undefined, viewPath: string): void;
|
|
321
|
+
/**
|
|
322
|
+
* Set up HMR dispose handler for this view module.
|
|
323
|
+
*
|
|
324
|
+
* When the module is about to be replaced, the old View class is removed
|
|
325
|
+
* from the registry so subsequent lookups don't return the stale class.
|
|
326
|
+
*
|
|
327
|
+
* No-op when `hot` is undefined (production / non-HMR environment).
|
|
328
|
+
*
|
|
329
|
+
* ```ts
|
|
330
|
+
* if (import.meta.hot) {
|
|
331
|
+
* HomeView.dispose(import.meta.hot, 'home');
|
|
332
|
+
* }
|
|
333
|
+
* ```
|
|
334
|
+
*/
|
|
335
|
+
static dispose(hot: HotContext | undefined, viewPath: string): void;
|
|
277
336
|
}
|
|
278
337
|
/**
|
|
279
338
|
* Type-safe wrapper around `View.extend()`.
|
|
@@ -689,7 +748,7 @@ interface VDomNode {
|
|
|
689
748
|
hasSpecials?: Record<string, string> | undefined;
|
|
690
749
|
/** Child VDomNode array (undefined for text/raw/self-closing) */
|
|
691
750
|
children?: VDomNode[] | undefined;
|
|
692
|
-
/** Diff key: from id,
|
|
751
|
+
/** Diff key: from id, #, or v-lark path */
|
|
693
752
|
compareKey?: string | undefined;
|
|
694
753
|
/** Keyed children count map (compareKey -> count) */
|
|
695
754
|
reused?: Record<string, number> | undefined;
|
|
@@ -2271,4 +2330,4 @@ declare function create<T>(name: string, creator: StateCreator<T>): StoreApi<T>;
|
|
|
2271
2330
|
*/
|
|
2272
2331
|
declare function bindStore<T>(view: unknown, store: StoreApi<T>, selector?: (state: T) => Record<string, unknown>): () => void;
|
|
2273
2332
|
|
|
2274
|
-
export { type AnyFunc, CALL_BREAK_TIME, Cache, type CacheEntry, type CacheInterface, type CacheOptions, type ChangeEvent, type CompileOptions, CrossSite, type CrossSiteConfig, type DomElement, type DomOp, type DomRef, EVENT_METHOD_REGEXP, EventDelegator, EventEmitter, type EventEmitterInterface, type EventListenerEntry, Frame, type FrameBoundElement, type FrameInterface, type FrameInvokeEntry, type FrameStaticEvent, Framework, type FrameworkConfig, type FrameworkInterface, LARK_VIEW, type Location, type LocationDiff, type MixinEventHandler, type ParamDiff, type ParsedUri, Payload, type PayloadInterface, type PendingCacheEntry, RouterEvents as ROUTER_EVENTS, type RouteChangeEvent, type RouteChangedEvent, type RouteViewConfig, Router, type RouterInterface, SPLITTER, Service, type ServiceCacheInfo, type ServiceEvent, type ServiceMetaEntry, type ServiceOptions, State, type StateInterface, type StoreApi, TAG_NAME_REGEXP, Updater, type UpdaterInterface, type VDomCreateFn, type VDomNode, type VDomRef, type VDomTemplate, VIEW_EVENT_METHOD_REGEXP, View, type ViewEvent, type ViewEventSelectorEntry, type ViewGlobalEventEntry, type ViewInterface, type ViewLocationObserved, type ViewObserveLocation, type ViewResourceEntry, type ViewTemplate, type VoidFunc, applyStyle, bindStore, computed, create, createVDomRef, defineView, config as frameworkConfig, getRouteMode, invalidateViewClass, mark, markBooted, markRouterBooted, nextCounter, registerViewClass, resetProjectsMap, safeguard, unmark, use, useUrlState, vdomCreate };
|
|
2333
|
+
export { type AnyFunc, CALL_BREAK_TIME, Cache, type CacheEntry, type CacheInterface, type CacheOptions, type ChangeEvent, type CompileOptions, CrossSite, type CrossSiteConfig, type DomElement, type DomOp, type DomRef, EVENT_METHOD_REGEXP, EventDelegator, EventEmitter, type EventEmitterInterface, type EventListenerEntry, Frame, type FrameBoundElement, type FrameInterface, type FrameInvokeEntry, type FrameStaticEvent, Framework, type FrameworkConfig, type FrameworkInterface, type HotContext, LARK_VIEW, type Location, type LocationDiff, type MixinEventHandler, type ParamDiff, type ParsedUri, Payload, type PayloadInterface, type PendingCacheEntry, RouterEvents as ROUTER_EVENTS, type RouteChangeEvent, type RouteChangedEvent, type RouteViewConfig, Router, type RouterInterface, SPLITTER, Service, type ServiceCacheInfo, type ServiceEvent, type ServiceMetaEntry, type ServiceOptions, State, type StateInterface, type StoreApi, TAG_NAME_REGEXP, Updater, type UpdaterInterface, type VDomCreateFn, type VDomNode, type VDomRef, type VDomTemplate, VIEW_EVENT_METHOD_REGEXP, View, type ViewEvent, type ViewEventSelectorEntry, type ViewGlobalEventEntry, type ViewInterface, type ViewLocationObserved, type ViewObserveLocation, type ViewResourceEntry, type ViewTemplate, type VoidFunc, applyStyle, bindStore, computed, create, createVDomRef, defineView, config as frameworkConfig, getRouteMode, invalidateViewClass, mark, markBooted, markRouterBooted, nextCounter, registerViewClass, reloadViews, resetProjectsMap, safeguard, unmark, use, useUrlState, vdomCreate };
|