@viewfly/platform-browser 0.0.1-alpha.4 → 0.0.1-alpha.6
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/bundles/fork.d.ts +2 -0
- package/bundles/index.esm.js +29 -3
- package/bundles/index.js +28 -1
- package/bundles/public-api.d.ts +1 -0
- package/package.json +3 -3
package/bundles/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NativeRenderer, Viewfly } from '@viewfly/core';
|
|
1
|
+
import { NativeRenderer, Viewfly, makeError, provide, onDestroy } from '@viewfly/core';
|
|
2
2
|
import { Injectable } from '@tanbo/di';
|
|
3
3
|
|
|
4
4
|
/******************************************************************************
|
|
@@ -265,8 +265,34 @@ function createApp(host, root, autoUpdate = true) {
|
|
|
265
265
|
}
|
|
266
266
|
]
|
|
267
267
|
});
|
|
268
|
-
app.
|
|
268
|
+
app.run();
|
|
269
269
|
return app;
|
|
270
270
|
}
|
|
271
271
|
|
|
272
|
-
|
|
272
|
+
const forkErrorFn = makeError('fork');
|
|
273
|
+
function fork(host, root) {
|
|
274
|
+
let parentComponent;
|
|
275
|
+
try {
|
|
276
|
+
parentComponent = provide([]);
|
|
277
|
+
}
|
|
278
|
+
catch (_a) {
|
|
279
|
+
throw forkErrorFn('The fork function can only be called synchronously within a component.');
|
|
280
|
+
}
|
|
281
|
+
const app = new Viewfly({
|
|
282
|
+
host,
|
|
283
|
+
root,
|
|
284
|
+
context: parentComponent,
|
|
285
|
+
providers: [
|
|
286
|
+
{
|
|
287
|
+
provide: NativeRenderer,
|
|
288
|
+
useClass: DomRenderer
|
|
289
|
+
}
|
|
290
|
+
]
|
|
291
|
+
});
|
|
292
|
+
onDestroy(() => {
|
|
293
|
+
app.destroy();
|
|
294
|
+
});
|
|
295
|
+
return app;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
export { DomRenderer, createApp, fork };
|
package/bundles/index.js
CHANGED
|
@@ -267,8 +267,35 @@ function createApp(host, root, autoUpdate = true) {
|
|
|
267
267
|
}
|
|
268
268
|
]
|
|
269
269
|
});
|
|
270
|
-
app.
|
|
270
|
+
app.run();
|
|
271
|
+
return app;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
const forkErrorFn = core.makeError('fork');
|
|
275
|
+
function fork(host, root) {
|
|
276
|
+
let parentComponent;
|
|
277
|
+
try {
|
|
278
|
+
parentComponent = core.provide([]);
|
|
279
|
+
}
|
|
280
|
+
catch (_a) {
|
|
281
|
+
throw forkErrorFn('The fork function can only be called synchronously within a component.');
|
|
282
|
+
}
|
|
283
|
+
const app = new core.Viewfly({
|
|
284
|
+
host,
|
|
285
|
+
root,
|
|
286
|
+
context: parentComponent,
|
|
287
|
+
providers: [
|
|
288
|
+
{
|
|
289
|
+
provide: core.NativeRenderer,
|
|
290
|
+
useClass: exports.DomRenderer
|
|
291
|
+
}
|
|
292
|
+
]
|
|
293
|
+
});
|
|
294
|
+
core.onDestroy(() => {
|
|
295
|
+
app.destroy();
|
|
296
|
+
});
|
|
271
297
|
return app;
|
|
272
298
|
}
|
|
273
299
|
|
|
274
300
|
exports.createApp = createApp;
|
|
301
|
+
exports.fork = fork;
|
package/bundles/public-api.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viewfly/platform-browser",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.6",
|
|
4
4
|
"description": "Viewfly is a simple and easy-to-use JavaScript framework with an intuitive development experience.",
|
|
5
5
|
"main": "./bundles/index.js",
|
|
6
6
|
"module": "./bundles/index.esm.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"keywords": [],
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@tanbo/di": "^1.1.4",
|
|
19
|
-
"@viewfly/core": "^0.0.1-alpha.
|
|
19
|
+
"@viewfly/core": "^0.0.1-alpha.6",
|
|
20
20
|
"reflect-metadata": "^0.1.13"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"bugs": {
|
|
38
38
|
"url": "https://github.com/viewfly/viewfly.git/issues"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "aedb326658afa6a712aebe3f22fe5209ae18a9f9"
|
|
41
41
|
}
|