[ADD] add basic infrastructure to buid owl-runtime without compiler

This commit is contained in:
Géry Debongnie
2022-05-26 12:11:10 +02:00
committed by Sam Degueldre
parent b10a700381
commit e4b810c027
7 changed files with 227 additions and 92 deletions
+13 -55
View File
@@ -1,58 +1,16 @@
import {
config,
createBlock,
html,
list,
mount as blockMount,
multi,
patch,
remove,
text,
toggler,
comment,
} from "./blockdom";
import { mainEventHandler } from "./component/handler";
export type { Reactive } from "./reactivity";
import { TemplateSet } from "./app/template_set";
import { compile } from "./compiler";
config.shouldNormalizeDom = false;
config.mainEventHandler = mainEventHandler;
export * from "./index.runtime";
export const blockDom = {
config,
// bdom entry points
mount: blockMount,
patch,
remove,
// bdom block types
list,
multi,
text,
toggler,
createBlock,
html,
comment,
TemplateSet.prototype._compileTemplate = function _compileTemplate(
name: string,
template: string | Element
) {
return compile(template, {
name,
dev: this.dev,
translateFn: this.translateFn,
translatableAttributes: this.translatableAttributes,
});
};
export { App, mount } from "./app/app";
export { xml } from "./app/template_set";
export { Component } from "./component/component";
export { useComponent, useState } from "./component/component_node";
export { status } from "./component/status";
export { reactive, markRaw, toRaw } from "./reactivity";
export { useEffect, useEnv, useExternalListener, useRef, useChildSubEnv, useSubEnv } from "./hooks";
export { EventBus, whenReady, loadFile, markup } from "./utils";
export {
onWillStart,
onMounted,
onWillUnmount,
onWillUpdateProps,
onWillPatch,
onPatched,
onWillRender,
onRendered,
onWillDestroy,
onError,
} from "./component/lifecycle_hooks";
export { validate } from "./validation";
export const __info__ = {};