refactor: circular deps part 13

This commit is contained in:
Nathan Walker
2025-07-09 20:07:56 -07:00
parent ee03774ec0
commit 579a25d583
31 changed files with 552 additions and 387 deletions

View File

@ -1,19 +1,24 @@
// Types
import { ViewBase } from '../ui/core/view-base';
//Requires
import { androidGetCurrentActivity } from '../application/helpers';
import { getRootView } from '../application/helpers-common';
import type { ViewBase } from '../ui/core/view-base';
import { unsetValue } from '../ui/core/properties/property-shared';
import { getNodeById } from './dom-types';
import { mainThreadify } from '../utils';
// Use lazy requires for core modules
const getAppRootView = () => require('../application').getRootView();
let unsetValue;
function unsetViewValue(view, name) {
if (!unsetValue) {
unsetValue = require('../ui/core/properties').unsetValue;
function getAppRootView() {
if (__ANDROID__) {
const activity = androidGetCurrentActivity();
if (!activity) {
return undefined;
}
const callbacks = activity['_callbacks'];
return callbacks ? callbacks.getRootView() : undefined;
} else {
return getRootView();
}
}
function unsetViewValue(view, name) {
view[name] = unsetValue;
}