Skip to content

Commit 5cd66b6

Browse files
chore: update composable schema docs (#531)
Co-authored-by: Maria Ines Parnisari <maria.ines.parnisari@authzed.com>
1 parent e1f9ac2 commit 5cd66b6

2 files changed

Lines changed: 33 additions & 1 deletion

File tree

app/spicedb/modeling/composable-schemas/page.mdx

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ The command allows you to combine a schema that is spread across many files, for
1818
<Tabs.Tab>
1919

2020
```zed
21+
use import
22+
use partial
23+
2124
import "./subjects.zed"
2225
2326
partial view_partial {
@@ -64,6 +67,30 @@ There are three new pieces of syntax: [import statements](#import-statements), [
6467

6568
## Breaking Changes
6669

70+
### `use import` and `use partial`
71+
72+
_`zed` version v0.36.0_
73+
74+
As of v0.36.0, if you want to use `import` and `partial` syntax, you need to enable the corresponding `use` flags, which tell the compiler
75+
that `import` and `partial` are valid syntax:
76+
77+
```zed
78+
use import
79+
use partial
80+
81+
import "foo.zed"
82+
partial something {}
83+
```
84+
85+
Note that the `use` flags are only required in a file that uses those keywords - imported files that don't use their own
86+
`import` or `partial` syntax don't need the flags, though it is not an error for them to be present.
87+
88+
### New Keywords
89+
90+
_`zed` version v0.27.0 -> v0.35.0_
91+
92+
<Callout>This is superseded by `use import` and `use partial` above.</Callout>
93+
6794
The composable schema compiler has some breaking changes relative to the compiler used internally by SpiceDB on a `WriteSchema` call.
6895
A new version of SpiceDB should not cause your schema to break.
6996
However, the schema compiler introduces some new keywords (among other changes), which may result in a schema that can be
@@ -83,6 +110,8 @@ Import statements allow you to break down a schema along the lines of top-level
83110
<Tabs.Tab>
84111

85112
```zed
113+
use import
114+
86115
// An import keyword followed by a quoted relative filepath
87116
import "./one.zed"
88117
@@ -135,6 +164,8 @@ It can contain relations, permissions, and partial references just like a `defin
135164
must be referenced by a [partial reference](#partial-references) to show up in the compiled schema.
136165

137166
```zed
167+
use partial
168+
138169
partial view_partial {
139170
...some_other_partial
140171
@@ -157,6 +188,8 @@ or [python's dictionary unpacking](https://docs.python.org/3/reference/expressio
157188
This syntax:
158189

159190
```zed
191+
use partial
192+
160193
partial view_partial {
161194
relation viewer: user
162195
permission view = viewer

next-env.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
/// <reference types="next/navigation-types/compat/navigation" />
43
import "./.next/dev/types/routes.d.ts";
54

65
// NOTE: This file should not be edited

0 commit comments

Comments
 (0)