mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix-next: avoid circular reference (#6812)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
require("globals");
|
||||
|
||||
import { Observable, EventData } from "../data/observable";
|
||||
import { View } from "../ui/core/view";
|
||||
import {
|
||||
trace as profilingTrace,
|
||||
time,
|
||||
@@ -35,7 +36,6 @@ export { Observable };
|
||||
import {
|
||||
AndroidApplication,
|
||||
CssChangedEventData,
|
||||
getRootView,
|
||||
iOSApplication,
|
||||
LoadAppCSSEventData,
|
||||
UnhandledErrorEventData,
|
||||
@@ -79,10 +79,10 @@ export function setApplication(instance: iOSApplication | AndroidApplication): v
|
||||
app = instance;
|
||||
}
|
||||
|
||||
export function livesync(context?: HmrContext) {
|
||||
export function livesync(rootView: View, context?: HmrContext) {
|
||||
events.notify(<EventData>{ eventName: "livesync", object: app });
|
||||
const liveSyncCore = global.__onLiveSyncCore;
|
||||
let reapplyAppCss = false
|
||||
let reapplyAppCss = false;
|
||||
|
||||
if (context) {
|
||||
const fullFileName = getCssFileName();
|
||||
@@ -91,7 +91,6 @@ export function livesync(context?: HmrContext) {
|
||||
reapplyAppCss = extensions.some(ext => context.module === fileName.concat(ext));
|
||||
}
|
||||
|
||||
const rootView = getRootView();
|
||||
if (reapplyAppCss && rootView) {
|
||||
rootView._onCssStateChange();
|
||||
} else if (liveSyncCore) {
|
||||
|
||||
@@ -217,7 +217,8 @@ global.__onLiveSync = function __onLiveSync(context?: HmrContext) {
|
||||
return;
|
||||
}
|
||||
|
||||
livesync(context);
|
||||
const rootView = getRootView();
|
||||
livesync(rootView, context);
|
||||
};
|
||||
|
||||
function initLifecycleCallbacks() {
|
||||
|
||||
@@ -21,7 +21,7 @@ import { Frame, NavigationEntry } from "../ui/frame";
|
||||
import * as utils from "../utils/utils";
|
||||
import { profile, level as profilingLevel, Level } from "../profiling";
|
||||
|
||||
// NOTE: UIResponder with implementation of window - related to https://github.com/NativeScript/ios-runtime/issues/430
|
||||
// NOTE: UIResponder with implementation of window - related to https://github.com/NativeScript/ios-runtime/issues/430
|
||||
// TODO: Refactor the UIResponder to use Typescript extends when this issue is resolved:
|
||||
// https://github.com/NativeScript/ios-runtime/issues/1012
|
||||
var Responder = (<any>UIResponder).extend({
|
||||
@@ -161,7 +161,7 @@ class IOSApplication implements IOSApplicationDefinition {
|
||||
this.setWindowContent(args.root);
|
||||
} else {
|
||||
this._window = UIApplication.sharedApplication.delegate.window;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@profile
|
||||
@@ -378,5 +378,6 @@ global.__onLiveSync = function __onLiveSync(context?: HmrContext) {
|
||||
return;
|
||||
}
|
||||
|
||||
livesync(context);
|
||||
const rootView = getRootView();
|
||||
livesync(rootView, context);
|
||||
}
|
||||
Reference in New Issue
Block a user