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

Update Prettier, our override for <style> in templates no longer needed #2149

Merged
merged 5 commits into from
Feb 18, 2025
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
15 changes: 7 additions & 8 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Documentation about Boxel

## Prerequisites
Expand All @@ -9,13 +8,13 @@ It also has a feature to save an .svg image, which be opened in Chrome for a dec

## Concepts

The following are important concepts:
The following are important concepts:

- [Card and Field Definition Relationships](card-def-field-def-relationships.md): There is a subtle distinction between card and fields to consider when creating cards.
- [Inheritance](card-inheritance.md): Cards can be extended based upon user's custom needs -- no reinventing the wheel.
- [Rendering](card-rendering.md): Cards can be rendered easily in the browser. Each card renders differently based upon how it is related and what context it exists in.
- [Card and Field Definition Relationships](card-def-field-def-relationships.md): There is a subtle distinction between card and fields to consider when creating cards.
- [Inheritance](card-inheritance.md): Cards can be extended based upon user's custom needs -- no reinventing the wheel.
- [Rendering](card-rendering.md): Cards can be rendered easily in the browser. Each card renders differently based upon how it is related and what context it exists in.
- [Serialization and Deserialization](card-serialization-deserialization.md): Cards have to be adapted to a consistent JSON format before being sent over-the-wire to other consumers.
- [Computed Fields](computed-fields.md): Computed fields work too! We can compute on the data that is already contained in a card to build more complex logic.
- [Indexing](indexing.md): Indexing powers the re-rendering of cards when it's dependencies get updated.
- [Computed Fields](computed-fields.md): Computed fields work too! We can compute on the data that is already contained in a card to build more complex logic.
- [Indexing](indexing.md): Indexing powers the re-rendering of cards when it's dependencies get updated.
- [Realm](realm.md): Realms are storage for cards that have their own underlying permissions and indexer.
- [Search](search.md): Every Card is searchable within and across realms.
- [Search](search.md): Every Card is searchable within and across realms.
16 changes: 10 additions & 6 deletions docs/queue.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
Our queue system is postgres based job queue system (resurrected from hub v2). This leverages postgres pub/sub capabilities to create a job queue system that implements our `Queue` interface (we previously created a mock queue that implements this same interface for browser testing).

The queue is controlled by the `jobs` table. We can monitor and control our queue using this table. The following is an example query of this table after running our tests.
The queue is controlled by the `jobs` table. We can monitor and control our queue using this table. The following is an example query of this table after running our tests.

```
> SELECT * FROM JOBS;
id | category | args | status | created_at | finished_at | queue | result

id | category | args | status | created_at | finished_at | queue | result
----+-----------+------+----------+----------------------------+----------------------------+-----------------+--------
1 | increment | 17 | resolved | 2024-04-19 16:57:43.305961 | 2024-04-19 16:57:43.311274 | increment-queue | 18
```

On system start up we can register job handlers whose responsibility it is to run queued jobs (these handlers can horizontally scale if we so choose). A handler registration looks like this:

```ts
queue.register('increment', async (a: number) => a + 1);
```
This is a real simple example that just adds 1 to the job's input arguments. A handler ran return an async result as JSONB value which is stored in the `jobs.result` column of the `jobs` table. This handler defines a "category" called `increment` for this function that it has registered. A handler processes the queue by looking for the oldest job that isn't running and handles that first.

This is a real simple example that just adds 1 to the job's input arguments. A handler ran return an async result as JSONB value which is stored in the `jobs.result` column of the `jobs` table. This handler defines a "category" called `increment` for this function that it has registered. A handler processes the queue by looking for the oldest job that isn't running and handles that first.

Clients of the queue that wish to run jobs can do so by specifying the category of job that they wish to run, the queue that they wish to use, and input arguments for the job (the input arguments can be a JSONB value which is stored in the `jobs.args` column of the `jobs` table).

```ts
let job = await queue.publish<number>('increment', 17, {
queueName: 'increment-queue',
});
```

The caller is handed a `job` object. This object has an `id` property and a `done` property that returns a promise for the job's return value (which is a parameterized type) when the job is completed. Note that the `queueName` is optional. If no name is supplied then the queue name `"default"` is used. The `queueName` is used to control job concurrency. Jobs are processed in each `queueName` serially.

When a job is first published to a queue it is assigned a status of `unfulfilled`. When a job has completed successfully it is assigned a status of `resolved`. If a job throws an error it is assigned a status of `rejected` and the error is serialized in the `jobs.result` column.
When a job is first published to a queue it is assigned a status of `unfulfilled`. When a job has completed successfully it is assigned a status of `resolved`. If a job throws an error it is assigned a status of `rejected` and the error is serialized in the `jobs.result` column.

Using SQL you can monitor the progress of the jobs in the queue, as well as, you can manipulate the results of the queue processing by setting `jobs.status`, `jobs.result`, and `jobs.queueName` using SQL.
Using SQL you can monitor the progress of the jobs in the queue, as well as, you can manipulate the results of the queue processing by setting `jobs.status`, `jobs.result`, and `jobs.queueName` using SQL.
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@
"@embroider/util": "1.13.1",
"@glimmer/tracking>@glimmer/validator": "0.84.3",
"jsesc": "^3.0.0",
"ember-modifier": "^4.1.0",
"prettier": "github:cardstack/prettier#glimmer-style-tag-in-template-support"
"ember-modifier": "^4.1.0"
},
"peerDependencyRules": {
"allowedVersions": {
"mustache": "3",
"prettier@github:cardstack/prettier#glimmer-style-tag-in-template-support": "3.1.0-dev",
"[email protected]>ember-source": "*"
}
},
Expand Down Expand Up @@ -70,7 +68,7 @@
"eslint-plugin-prefer-let": "^3.0.1",
"eslint-plugin-prettier": "^5.0.0",
"hcl2-parser": "^1.0.3",
"prettier": "^2.7.1",
"prettier": "^3.5.1",
"prettier-plugin-ember-template-tag": "^1.1.0",
"typescript": "~5.1.6"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -819,4 +819,4 @@
"user_id": "@aibot:localhost",
"age": 48448
}
]
]
Loading
Loading