8000 chore: cleanup · alexandreiflor1/nativescript-vue@d602ef8 · GitHub
[go: up one dir, main page]

Skip to content

Commit d602ef8

Browse files
committed
chore: cleanup
1 parent 84103c4 commit d602ef8

File tree

10 files changed

+26
-261
lines changed

10 files changed

+26
-261
lines changed

demo_/index.ts

Lines changed: 0 additions & 41 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nativescript-vue",
3-
"version": "3.0.0",
3+
"version": "3.0.0-beta.0",
44
"main": "dist/index.js",
55
"files": [
66
"dist/",

src/compiler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ export function compileToFunction(
2626
hoistStatic: true,
2727
prefixIdentifiers: true,
2828
onWarn(warn: CompilerError) {
29-
console.warn("warn", warn);
29+
console.warn("Template Compile Warning", warn);
3030
},
3131
onError(err: CompilerError) {
32-
console.log("err", err);
32+
console.error("Template Compile Error", err);
3333
},
3434
...options,
3535
});

src/components/ListView.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,11 @@ export const ListView = /*#__PURE__*/ defineComponent({
6666
if (props.items instanceof ObservableArray) {
6767
return;
6868
}
69-
console.log("props changed?");
7069

7170
const lv: NSCListView = listView.value?.nativeView;
7271
lv?.refresh();
7372
} catch (err) {
74-
console.log(err);
73+
console.error("Error while refreshing ListView", err);
7574
}
7675
});
7776

@@ -123,9 +122,7 @@ export const ListView = /*#__PURE__*/ defineComponent({
123122
// render all realized templates as children
124123
const cellVNODES = () =>
125124
Object.entries(cells.value).map(([id, entry]) => {
126-
const vnodes: VNode[] = ctx.slots[entry.slotName]?.(
127-
entry.itemCtx
128-
) ?? [
125+
const vnodes: VNode[] = ctx.slots[entry.slotName]?.(entry.itemCtx) ?? [
129126
// default template is just a label
130127
h("Label", {
131128
text: entry.itemCtx.item,

src/components/ListView.working.ts

Lines changed: 0 additions & 187 deletions
This file was deleted.

src/index.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { renderer } from "./renderer";
1010
import { install as modalsPlugin } from "./plugins/modals";
1111
import { install as navigationPlugin } from "./plugins/navigation";
1212
import { isKnownView } from "./registry";
13-
import { ListView } from "./components/ListView";
1413

1514
declare module "@vue/runtime-core" {
1615
interface App {
@@ -21,16 +20,6 @@ declare module "@vue/runtime-core" {
2120
isSVG?: boolean
2221
): ComponentPublicInstance;
2322
}
24-
25-
interface GlobalComponents {
26-
Frame: DefineComponent<{}>;
27-
Page: DefineComponent;
28-
StackLayout: DefineComponent;
29-
GridLayout: DefineComponent;
30-
Label: DefineComponent<{ text?: unknown }>;
31-
Button: DefineComponent<{ text?: unknown }>;
32-
ListView: typeof ListView
33-
}
3423
}
3524

3625
init();

src/nativescript/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Application, View } from "@nativescript/core";
22
import { ComponentPublicInstance } from "@vue/runtime-core";
3-
import { NSVRoot } from "../dom";
43
import { registerCoreElements } from "./elements";
54

65
// export all ns stuff in a single file to allow easy mocking for testing...
@@ -14,7 +13,6 @@ export function init() {
1413
}
1514

1615
export function startApp(rootComponent: ComponentPublicInstance) {
17-
console.log("starting app...");
1816
Application.run({
1917
create() {
2018
return rootComponent.$el.nativeView;
@@ -23,8 +21,6 @@ export function startApp(rootComponent: ComponentPublicInstance) {
2321
}
2422

2523
export function resetRoot(view: View) {
26-
console.log("reset root...");
27-
2824
Application.resetRootView({
2925
create() {
3026
return view;

src/plugins/navigation.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ function resolveFrame(frame: ResolvableFrame): Frame {
6565
}
6666

6767
function createNavigationRoot(cb: (view: any) => void) {
68-
console.log("createNavigationRoot");
6968
const defaultRoot = new NSVRoot();
7069

7170
// flag to indicate when we need to call resetRoot
@@ -79,15 +78,15 @@ function createNavigationRoot(cb: (view: any) => void) {
7978
removeChild(el);
8079

8180
shouldResetRoot = true;
82-
console.log("remove child", (el as NSVElement).tagName);
81+
// console.log("remove child", (el as NSVElement).tagName);
8382
};
8483

8584
defaultRoot.appendChild = (el) => {
8685
appendChild(el);
8786

8887
if (shouldResetRoot) {
8988
shouldResetRoot = false;
90-
console.log("append child", (el as NSVElement).tagName);
89+
// console.log("append child", (el as NSVElement).tagName);
9190
cb((el as NSVElement).nativeView);
9291
}
9392
};
@@ -110,7 +109,7 @@ function attachDisposeCallbacks(
110109

111110
const dispose = targetPage.disposeNativeView;
112111
targetPage.disposeNativeView = () => {
113-
console.log("dispose native view called.");
112+
// console.log("dispose native view called.");
114113
disposeCallback(targetPage);
115114
dispose.call(targetPage);
116115
};
@@ -121,7 +120,7 @@ export async function $navigateTo(
121120
options?: NavigationOptions
122121
): Promise<Page> {
123122
options = Object.assign({}, options);
124-
console.log("$navigateTo");
123+
// console.log("$navigateTo");
125124

126125
try {
127126
const frame = resolveFrame(options.frame);
@@ -132,10 +131,10 @@ export async function $navigateTo(
132131

133132
const cleanup = (page) => {
134133
if (page === latestPage) {
135-
console.log("DISPOSE NAVIGATION APP");
134+
// console.log("DISPOSE NAVIGATION APP");
136135
navigationApp.unmount();
137136
} else {
138-
console.log("no dispose we have replaced page");
137+
// console.log("no dispose we have replaced page");
139138
}
140139
};
141140

0 commit comments

Comments
 (0)
0