Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump ocular-devtools and adapt to typescript, prettier & eslint upgrade #8366

Merged
merged 5 commits into from Jan 3, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
File renamed without changes.
7 changes: 6 additions & 1 deletion modules/core/src/controllers/view-state.ts
@@ -1,6 +1,11 @@
import type Viewport from '../viewports/viewport';

export default abstract class ViewState<T, Props, State> implements IViewState<T> {
export default abstract class ViewState<
T,
Props extends Record<string, any>,
State extends Record<string, any>
> implements IViewState<T>
{
private _viewportProps: Required<Props>;
private _state: State;

Expand Down
3 changes: 2 additions & 1 deletion modules/core/src/lib/attribute/data-column.ts
Expand Up @@ -512,7 +512,8 @@ export default class DataColumn<Options, State> {

// https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/vertexAttribPointer
normalizeConstant(value: NumericArray): NumericArray {
switch (this.settings.type) {
/* eslint-disable complexity */
switch (this.settings.type as GL) {
case GL.BYTE:
// normalize [-128, 127] to [-1, 1]
return new Float32Array(value).map(x => ((x + 128) / 255) * 2 - 1);
Expand Down
2 changes: 1 addition & 1 deletion modules/core/src/lib/attribute/gl-utils.ts
Expand Up @@ -6,7 +6,7 @@ import type {BufferAccessor, DataColumnSettings} from './data-column';
/* eslint-disable complexity */
export function glArrayFromType(glType: number): TypedArrayConstructor {
// Sorted in some order of likelihood to reduce amount of comparisons
switch (glType) {
switch (glType as GL) {
case GL.FLOAT:
return Float32Array;
case GL.DOUBLE:
Expand Down
2 changes: 1 addition & 1 deletion modules/core/src/lib/layer-manager.ts
Expand Up @@ -52,7 +52,7 @@ export type LayerContext = {
timeline: Timeline;
mousePosition: {x: number; y: number} | null;
userData: any;
onError?: <PropsT>(error: Error, source: Layer<PropsT>) => void;
onError?: <PropsT extends {}>(error: Error, source: Layer<PropsT>) => void;
/** @deprecated Use context.device */
gl: WebGLRenderingContext;
};
Expand Down
2 changes: 1 addition & 1 deletion modules/core/src/lifecycle/constants.ts
Expand Up @@ -7,7 +7,7 @@ export const LIFECYCLE = {
FINALIZED: 'Finalized! Awaiting garbage collection'
} as const;

export type Lifecycle = typeof LIFECYCLE[keyof typeof LIFECYCLE];
export type Lifecycle = (typeof LIFECYCLE)[keyof typeof LIFECYCLE];

/* Secret props keys */
// Symbols are non-enumerable by default, does not show in for...in or Object.keys
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -75,7 +75,7 @@
"gl": "6.0.2",
"glsl-transpiler": "^1.8.6",
"jsdom": "^20.0.0",
"ocular-dev-tools": "2.0.0-alpha.19",
"ocular-dev-tools": "2.0.0-alpha.20",
"pre-commit": "^1.2.2",
"pre-push": "^0.1.1",
"react": "^18.0.0",
Expand Down
1,163 changes: 721 additions & 442 deletions yarn.lock

Large diffs are not rendered by default.