Skip to content

Commit

Permalink
Merge branch 'main' into queue-depth-endpoint
Browse files Browse the repository at this point in the history
lukemelia committed Jan 27, 2025
2 parents 5a2d89d + 4677c53 commit 908746b
Showing 191 changed files with 4,701 additions and 1,298 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -84,8 +84,8 @@ Instead of running `pnpm start:base`, you can alternatively use `pnpm start:all`
| :4205 | `/test` realm for matrix client tests (playwright controlled) | 🚫 | 🚫 |
| :4210 | Development Worker Manager (spins up 1 worker by default) || 🚫 |
| :4211 | Test Worker Manager (spins up 1 worker by default) || 🚫 |
| :4212 | Test Worker Manager for matrix client tests (playwright controlled - 1 worker) || 🚫 |
| :4213 | Test Worker Manager for matrix client tests - base realm server (playwright controlled - 1 worker) || 🚫 |
| :4212 | Worker Manager for matrix client tests (playwright controlled - 1 worker) | | 🚫 |
| :4213 | Worker Manager for matrix client tests - base realm server (playwright controlled - 1 worker) || 🚫 |
| :5001 | Mail user interface for viewing emails sent to local SMTP || 🚫 |
| :5435 | Postgres DB || 🚫 |
| :8008 | Matrix synapse server || 🚫 |
@@ -223,7 +223,7 @@ There is a ember-freestyle component explorer available to assist with developme

1. `cd packages/boxel-ui/test-app`
2. `pnpm start`
3. Visit http://localhost:4210/ in your browser
3. Visit http://localhost:4220/ in your browser

## Boxel Motion Demo App

@@ -290,7 +290,7 @@ To run the `packages/realm-server/` workspace tests start:
### Boxel UI

1. `cd packages/boxel-ui/test-app`
2. `pnpm test` (or `pnpm start` and visit http://localhost:4210/tests to run tests in the browser)
2. `pnpm test` (or `pnpm start` and visit http://localhost:4220/tests to run tests in the browser)

### Boxel Motion

24 changes: 14 additions & 10 deletions packages/base/card-api.gts
Original file line number Diff line number Diff line change
@@ -1699,7 +1699,10 @@ export class BaseDef {
}
return Object.fromEntries(
Object.entries(
getFields(value, { includeComputeds: true, usedFieldsOnly: true }),
getFields(value, {
includeComputeds: true,
usedLinksToFieldsOnly: true,
}),
).map(([fieldName, field]) => {
let rawValue = peekAtField(value, fieldName);
if (field?.fieldType === 'linksToMany') {
@@ -1967,7 +1970,7 @@ export function subscribeToChanges(
changeSubscribers.add(subscriber);

let fields = getFields(fieldOrCard, {
usedFieldsOnly: true,
usedLinksToFieldsOnly: true,
includeComputeds: false,
});
Object.keys(fields).forEach((fieldName) => {
@@ -2010,7 +2013,7 @@ export function unsubscribeFromChanges(
changeSubscribers.delete(subscriber);

let fields = getFields(fieldOrCard, {
usedFieldsOnly: true,
usedLinksToFieldsOnly: true,
includeComputeds: false,
});
Object.keys(fields).forEach((fieldName) => {
@@ -2308,7 +2311,7 @@ function serializeCardResource(
let { includeUnrenderedFields: remove, ...fieldOpts } = opts ?? {};
let { id: removedIdField, ...fields } = getFields(model, {
...fieldOpts,
usedFieldsOnly: !opts?.includeUnrenderedFields,
usedLinksToFieldsOnly: !opts?.includeUnrenderedFields,
});
let fieldResources = Object.entries(fields)
.filter(([_fieldName, field]) =>
@@ -2830,7 +2833,7 @@ export async function recompute(
Object.keys(
getFields(model, {
includeComputeds: true,
usedFieldsOnly: !opts?.recomputeAllFields,
usedLinksToFieldsOnly: !opts?.recomputeAllFields,
}),
),
);
@@ -2936,15 +2939,15 @@ export async function getIfReady<T extends BaseDef, K extends keyof T>(

export function getFields(
card: typeof BaseDef,
opts?: { usedFieldsOnly?: boolean; includeComputeds?: boolean },
opts?: { usedLinksToFieldsOnly?: boolean; includeComputeds?: boolean },
): { [fieldName: string]: Field<BaseDefConstructor> };
export function getFields<T extends BaseDef>(
card: T,
opts?: { usedFieldsOnly?: boolean; includeComputeds?: boolean },
opts?: { usedLinksToFieldsOnly?: boolean; includeComputeds?: boolean },
): { [P in keyof T]?: Field<BaseDefConstructor> };
export function getFields(
cardInstanceOrClass: BaseDef | typeof BaseDef,
opts?: { usedFieldsOnly?: boolean; includeComputeds?: boolean },
opts?: { usedLinksToFieldsOnly?: boolean; includeComputeds?: boolean },
): { [fieldName: string]: Field<BaseDefConstructor> } {
let obj: object | null;
let usedFields: string[] = [];
@@ -2979,9 +2982,10 @@ export function getFields(
!['contains', 'containsMany'].includes(maybeField.fieldType)
) {
if (
opts?.usedFieldsOnly &&
opts?.usedLinksToFieldsOnly &&
!usedFields.includes(maybeFieldName) &&
!maybeField.isUsed
!maybeField.isUsed &&
!['contains', 'containsMany'].includes(maybeField.fieldType)
) {
return [];
}
8 changes: 7 additions & 1 deletion packages/base/cards-grid.gts
Original file line number Diff line number Diff line change
@@ -384,13 +384,19 @@ class Isolated extends Component<typeof CardsGrid> {
on: catalogEntryRef,
eq: { ref: activeFilterRef },
},
sort: [
{
by: 'createdAt',
direction: 'desc',
},
],
};
}
let card = await chooseCard<CatalogEntry>(
{
filter: {
on: catalogEntryRef,
every: [{ eq: { isField: false } }],
every: [{ eq: { specType: 'card' } }],
},
},
{ preselectedCardTypeQuery },
Loading

0 comments on commit 908746b

Please sign in to comment.