Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/core/clickInspector.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Config, isDev } from './config.js';
import { Config } from './config.js';
import { isElementNode } from './utils.js';
import { isDev } from './env.js';
import type { ElementNode } from './elementNode.js';
import { IRendererNode } from './dom-renderer/domRendererTypes.js';

Expand Down Expand Up @@ -66,7 +67,7 @@
children: el.children,
},
);
(globalThis as any).$el = el;

Check warning on line 70 in src/core/clickInspector.ts

View workflow job for this annotation

GitHub Actions / build-test

Unsafe member access .$el on an `any` value

Check warning on line 70 in src/core/clickInspector.ts

View workflow job for this annotation

GitHub Actions / build-test

Unexpected any. Specify a different type
console.log('Pinned to $el — try $el.parent, $el.setFocus()');
}

Expand Down
13 changes: 2 additions & 11 deletions src/core/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,8 @@ import {
See `vite-env.d.ts` for environment variable type definitions.
*/

export const isDev = !!(import.meta.env && import.meta.env.DEV);

/** Whether the DOM renderer is used instead of `@solidtv/renderer` */
export const DOM_RENDERING =
typeof SOLIDTV_DOM_RENDERING !== 'undefined' &&
SOLIDTV_DOM_RENDERING === true;

/** Whether element shaders are enabled */
export const SHADERS_ENABLED =
typeof SOLIDTV_DISABLE_SHADERS === 'undefined' ||
SOLIDTV_DISABLE_SHADERS !== true;
export { isDev, DOM_RENDERING, SHADERS_ENABLED } from './env.js';
import { DOM_RENDERING } from './env.js';

/**
* True when the DOM renderer is both built in (`DOM_RENDERING`) and turned on
Expand Down
8 changes: 2 additions & 6 deletions src/core/elementNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,8 @@ import {
isFunction,
spliceItem,
} from './utils.js';
import {
Config,
isDev,
SHADERS_ENABLED,
isDomRendererActive,
} from './config.js';
import { isDev, SHADERS_ENABLED } from './env.js';
import { Config, isDomRendererActive } from './config.js';
import type {
RendererMain,
INode,
Expand Down
11 changes: 11 additions & 0 deletions src/core/env.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export const isDev = !!(import.meta.env && import.meta.env.DEV);

/** Whether the DOM renderer is used instead of `@solidtv/renderer` */
export const DOM_RENDERING =
typeof SOLIDTV_DOM_RENDERING !== 'undefined' &&
SOLIDTV_DOM_RENDERING === true;

/** Whether element shaders are enabled */
export const SHADERS_ENABLED =
typeof SOLIDTV_DISABLE_SHADERS === 'undefined' ||
SOLIDTV_DISABLE_SHADERS !== true;
Loading