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

[New Feature]: Allow TTL attribute to also be a partition or sort key #726

Closed
wants to merge 4 commits into from
Closed
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
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@architect/arc.codes",
"version": "3.12.8",
"version": "3.12.9",
"repository": {
"type": "git",
"url": "https://github.com/architect/arc.codes"
Expand Down
3 changes: 2 additions & 1 deletion src/views/docs/en/guides/backend/indexes.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ In this example you can query for an account by their username or email!
- Otherwise, the basic syntax for defining `@indexes` is the same as `@tables`:
- Partition key, defined by a `*`, is required
- Sort key, defined by `**`, is optional
- Currently only `*String`, `**String`, `*Number` and `**Number` are supported
- Currently only `*String`, `**String`, `*Number`, `**Number`, `*TTL`, `**TTL` are supported
- `*TTL` and `**TTL` is equivalent to `*Number` and `**Number` respectively, but also turns [time-to-live](./tables.md#time-to-live) on.

## Examples

Expand Down
1 change: 1 addition & 0 deletions src/views/docs/en/guides/backend/tables.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ accounts
- The required partition key is denoted by `*`
- The optional sort key is denoted by `**`
- Currently only `*String`, `**String`, `*Number` and `**Number` are supported
- `*TTL` and `**TTL` is equivalent to `*Number` and `**Number` respectively, but also turns [time-to-live](#time-to-live) on.
- Lambdas can only be values of: `insert`, `update`, or `destroy`

> **Protip:** table names can be anything but choose a consistent naming scheme within your app namespace; one useful scheme is plural nouns like: `accounts` or `email-invites`
Expand Down
14 changes: 11 additions & 3 deletions src/views/docs/en/guides/frontend/static-assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Architect projects support text and binary static assets such as images, styles,

## `@static` configuration

- `fingerprint` - **boolean** (defaults to false)
- Enable static asset file fingerprinting (and long-lived caching headers)
- `fingerprint` - **boolean** or **string** (defaults to false)
- Enable long-lived caching headers by static asset file fingerprinting
- `folder` - **string** (defaults to `./public`)
- Designate the local folder to upload static assets from.
- `ignore` - **list**
Expand All @@ -25,7 +25,7 @@ Architect projects support text and binary static assets such as images, styles,

### `fingerprint`

Fingerprinting adds a unique SHA to a file name based on the file content before uploading to S3. The file can then be cached effectively forever. Whenever the contents of the file changes so does the SHA invalidating the cache.
When set to `true`, fingerprinting adds a unique SHA to a file name based on the file content before uploading to S3. The file can then be cached effectively forever. Whenever the contents of the file changes so does the SHA invalidating the cache.

```arc
@static
Expand All @@ -34,6 +34,14 @@ fingerprint true

The Node.js runtime helper, [`@architect/functions`, provides a `static`](../../reference/runtime-helpers/node.js#arc.static) method to help create a path for a given fingerprinted asset. See [below for an example](#fingerprinted-file-paths).


By setting fingerprinting to `external`, the file name is not changed before uploading to S3. You should only do this if you can ensure that the file name changes when you change the file content. This setting is incompatible with the Node.js runtime helper mentioned above.

```arc
@static
fingerprint external
```

### `folder`

Use a custom folder name or path for static assets.
Expand Down
2 changes: 1 addition & 1 deletion src/views/docs/en/reference/project-manifest/static.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ All parameters are optional.
- `compression` - **boolean** or **string** (defaults to false)
- Enable static asset compression; `true` or `br` compresses with brotli, or `gzip` compresses with gzip
- `fingerprint` - **boolean** (defaults to false)
- Enable static asset file fingerprinting (and long-lived caching headers)
- Enable long-lived caching headers by static asset file fingerprinting
- `folder` - **string** (defaults to `./public`)
- Designate the local folder to upload static assets from.
- `ignore` - **list**
Expand Down
Loading