Skip to content

Commit

Permalink
lintfix
Browse files Browse the repository at this point in the history
lintfix

lintfix

lintfix

lintfix
  • Loading branch information
NullVoxPopuli committed Dec 20, 2023
1 parent 1f5c4fb commit 8658e80
Show file tree
Hide file tree
Showing 13 changed files with 78 additions and 62 deletions.
2 changes: 1 addition & 1 deletion benchmark/benchmarks/krausest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
"config": {
"tsconfig": "../../tsconfig.json"
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,4 @@
"node": "20.9.0",
"pnpm": "8.6.12"
}
}
}
2 changes: 1 addition & 1 deletion packages/@glimmer-workspace/build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@
"source": "js:typed",
"type": "library:build-support"
}
}
}
48 changes: 24 additions & 24 deletions packages/@glimmer/debug/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,36 +139,36 @@ export interface Op {
}
type StackOption =
| {
type: 'stack:unchecked';
reason: string;
}
type: 'stack:unchecked';
reason: string;
}
| {
type: 'stack:delta';
value: number;
}
type: 'stack:delta';
value: number;
}
| {
type: 'stack:params';
value: ShorthandStackParam[];
}
type: 'stack:params';
value: ShorthandStackParam[];
}
| {
type: 'stack:peeks';
value: ShorthandStackParam[];
}
type: 'stack:peeks';
value: ShorthandStackParam[];
}
| {
type: 'stack:returns';
value: ShorthandStackReturn[];
}
type: 'stack:returns';
value: ShorthandStackReturn[];
}
| {
type: 'stack:dynamic';
value: DynamicStackFn | { reason: string };
};
type: 'stack:dynamic';
value: DynamicStackFn | { reason: string };
};

type MetadataOption =
| ShorthandOperandList
| {
type: 'multi';
options: StackOption[];
}
type: 'multi';
options: StackOption[];
}
| StackOption;

function stackDelta(change: number): MetadataOption {
Expand Down Expand Up @@ -392,9 +392,9 @@ export class MetadataBuilder<
const normalizedOptions: NormalizedOptions =
name === RESERVED
? ([
[],
() => ({ type: 'unchecked', reason: 'reserved', delta: undefined }),
] satisfies NormalizedOptions)
[],
() => ({ type: 'unchecked', reason: 'reserved', delta: undefined }),
] satisfies NormalizedOptions)
: toOptions(options);

this.#push(name, normalizedOptions);
Expand Down
7 changes: 1 addition & 6 deletions packages/@glimmer/manager/lib/public/modifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,7 @@ import type {
} from '@glimmer/interfaces';
import { registerDestructor } from '@glimmer/destroyable';
import { unwrapReactive } from '@glimmer/reference';
import {
castToBrowser,
devmode,
dict,
setDescription,
} from '@glimmer/util';
import { castToBrowser, devmode, dict, setDescription } from '@glimmer/util';
import { createUpdatableTag, untrack } from '@glimmer/validator';

import type { ManagerFactory } from '.';
Expand Down
6 changes: 3 additions & 3 deletions packages/@glimmer/reference/lib/api/accessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function ResultAccessor<T = unknown>(
get: () => ReactiveResult<T>;
set: (val: T) => ReactiveResult<void>;
},
description?: DescriptionSpec,
description?: DescriptionSpec
): Reactive<T> {
return InternalResultAccessor(options, description);
}
Expand All @@ -44,9 +44,9 @@ export function InternalResultAccessor<T = unknown>(
set: (val: T) => ReactiveResult<void>;
},
description?: DescriptionSpec,
type: AccessorType | MutableReferenceType = ACCESSOR,
type: AccessorType | MutableReferenceType = ACCESSOR
): Reactive<T> {
const { get, set } = options;
const { get, set } = options;

const internal = new InternalReactive<T>(type);

Expand Down
11 changes: 10 additions & 1 deletion packages/@glimmer/reference/lib/api/cell.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
import type {DeeplyConstantReactiveCell, DefaultDescriptionFields, Described, DescriptionSpec, MutableReactiveCell, ReactiveCell, ReferenceDescription, RETURN_TYPE} from '@glimmer/interfaces';
import type {
DeeplyConstantReactiveCell,
DefaultDescriptionFields,
Described,
DescriptionSpec,
MutableReactiveCell,
ReactiveCell,
ReferenceDescription,
RETURN_TYPE,
} from '@glimmer/interfaces';
import { devmode, setDescription, toValidatableDescription } from '@glimmer/util';
import { CONSTANT_TAG, consumeTag, createTag, dirtyTag } from '@glimmer/validator';

Expand Down
12 changes: 8 additions & 4 deletions packages/@glimmer/reference/lib/api/mutability.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,14 @@ export function toMut<T>(maybeMut: Reactive<T>): Reactive<T> {
// TODO probably should assert that maybeMut is updatable
// Ember already has the same assertion

return InternalResultAccessor({
get: () => readInternalReactive(maybeMut as InternalReactive<T>),
set: (value: unknown) => updateInternalReactive(reactive, value),
}, undefined, MUTABLE_REF);
return InternalResultAccessor(
{
get: () => readInternalReactive(maybeMut as InternalReactive<T>),
set: (value: unknown) => updateInternalReactive(reactive, value),
},
undefined,
MUTABLE_REF
);
}

export function isConstant(reactive: Reactive) {
Expand Down
8 changes: 7 additions & 1 deletion packages/@glimmer/reference/lib/api/predicates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ import type {

import type { InternalReactive } from './internal/reactive';

import { ACCESSOR, CONSTANT_ERROR, FALLIBLE_FORMULA, MUTABLE_REF, REFERENCE } from './internal/reactive';
import {
ACCESSOR,
CONSTANT_ERROR,
FALLIBLE_FORMULA,
MUTABLE_REF,
REFERENCE,
} from './internal/reactive';

export function isFallibleFormula<T>(_ref: Reactive<T>): _ref is ReactiveFormula<T> {
return _ref[REFERENCE] === FALLIBLE_FORMULA;
Expand Down
6 changes: 3 additions & 3 deletions packages/@glimmer/runtime/lib/compiled/opcodes/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ APPEND_OPCODES.add(Op.DynamicModifier, (vm) => {
if (import.meta.env.DEV) {
const label = stringifyDebugLabel(ref);
throw new Error(
`Expected a dynamic modifier definition, but received an object or function that did not have a modifier manager associated with it. The dynamic invocation was \`{{${
String(label)
}}}\`, and the incorrect definition is the value at the path \`${debugToString!(
`Expected a dynamic modifier definition, but received an object or function that did not have a modifier manager associated with it. The dynamic invocation was \`{{${String(
label
)}}}\`, and the incorrect definition is the value at the path \`${debugToString!(
hostDefinition
)}\`, which was: ${debugToString!(hostDefinition)}`
);
Expand Down
3 changes: 2 additions & 1 deletion packages/@glimmer/util/lib/object-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ export function array<T>(): {
allocate: <N extends number>(size: N) => Expand<FixedArray<T | null, N>>;
} {
return {
allocate: <N extends number>(size: N) => Array(size).fill(null) as Expand<FixedArray<T | null, N>>,
allocate: <N extends number>(size: N) =>
Array(size).fill(null) as Expand<FixedArray<T | null, N>>,
};
}

Expand Down
28 changes: 14 additions & 14 deletions packages/@glimmer/validator/lib/validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,27 +266,27 @@ export function createTag(label?: DevMode<TagDescription>): DirtyableTag {
return createTagWithId(
DIRYTABLE_TAG_ID,
label ??
devmode(
() =>
({
reason: 'cell',
label: ['(dirtyable)'],
}) satisfies TagDescription
)
devmode(
() =>
({
reason: 'cell',
label: ['(dirtyable)'],
}) satisfies TagDescription
)
);
}

export function createUpdatableTag(label?: DevMode<TagDescription>): UpdatableTag {
return createTagWithId(
UPDATABLE_TAG_ID,
label ??
devmode(
() =>
({
reason: 'cell',
label: ['(updatable)'],
}) satisfies TagDescription
)
devmode(
() =>
({
reason: 'cell',
label: ['(updatable)'],
}) satisfies TagDescription
)
);
}

Expand Down
5 changes: 3 additions & 2 deletions packages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
"devDependencies": {
"@types/qunit": "^2.19.9",
"vite": "^4.3.9"
}
}
},
"name": "@glimmer-workspace/packages"
}

0 comments on commit 8658e80

Please sign in to comment.