Skip to content

v8.0.0-rc.17-dev.40

@StevenMcClankerton StevenMcClankerton tagged this 14 Oct 09:06
## Linked issue

n/a. Close-out of the PSL mixins project.

## At a glance

```
projects/psl-mixins/                    deleted (28 files)
```

## Summary

The PSL mixins project has delivered: `<keyword> mixin <Name> { … }`
declares a set of members for one block kind, `+<Name>` includes it, and
the emitted contract is the same as for the members written inline. This
PR removes the project's working folder. The decisions are recorded in
[ADR
269](docs/architecture%20docs/adrs/ADR%20269%20-%20PSL%20mixins.md).

## Delivered

| PR | What |
|---|---|
| #30674 | Consumers read a block's members from its symbol |
| #30675 | Mixin syntax: parser, typed AST, formatter, reserved word,
signed numbers, member recovery |
| #30694 | Inclusions take effect: mixin symbols, binder resolution,
placement between the binder's passes (replaced #30678) |
| #30679 | Go-to-definition, references, hover, rename and semantic
tokens for mixins |
| #30681 | Completion and signature help for mixins, mixin declaration
snippets, ADR 269, the RC feature list |

Open, outside this PR: #30714 moves the handling of a mixin written
without its block keyword from the parser to the symbol table and
removes a redundant diagnostic.

## Definition of Done

| Item | Status |
|---|---|
| Mixins declared for `model`, `type`, `enum` and an extension block, at
the top level and in a namespace, included with an unqualified and a
qualified name | Met, #30694 |
| A schema using a mixin emits the contract of the same schema written
inline, for the four block kinds | Met, #30694 (SQL, Mongo, Postgres
policy tests) |
| Member order follows the inclusion's position where the contract keeps
order | Met, #30694. A model's fields and a table's columns are sorted
in the emitted contract regardless; ADR 269 states this |
| Diagnostics at the inclusion: unresolved name, keyword mismatch,
member provided twice, inclusion in a mixin body | Met, #30694 |
| A mixin attribute naming a field the mixin does not declare is an
unresolved reference in the mixin | Met, #30694 |
| No production consumer reads block members from a syntax node | Met,
#30674 |
| `mixin X { … }` and `model mixin { … }` each get a diagnostic saying
what a mixin declaration needs | Met, #30675; #30714 removes a redundant
second diagnostic |
| The formatter prints both forms and is idempotent | Met, #30675 |
| Go-to-definition on an inclusion opens the mixin; renaming a mixin
updates its inclusions | Met, #30679 |
| Completion after `+` offers only mixins of the block's keyword | Met,
#30681 |
| Prisma 7 and Prisma 6 schemas that declare or include a mixin are
rejected | Met, #30694 |
| An ADR records the syntax and the resolve-where-written rule; the RC
feature list shows the agreed spelling | Met, #30681 |
| Manual QA | Run twice against the built CLI and a language-server
session; all scripted scenarios passed. The script and reports were
removed from #30681 at review and are not kept in the repository. The VS
Code steps were not run |

## Where each project decision now lives

| Decision | Home |
|---|---|
| Declaration and inclusion syntax, reserved `mixin`, one keyword per
mixin, namespaces, position, duplicates as errors,
resolve-where-written, no mixins in mixins, a mixin is not a type,
members shared not copied, where placement runs, interpreter-side
exceptions, alternatives | ADR 269 |
| `+` before a digit is part of a number; a failed member keeps the rest
of its line | ADR 269 (sign); the parser and its diagnostics tests
(recovery) |
| Duplicate member reported at whichever member comes second; the same
mixin included twice reports once | ADR 269 and
`mixin-placement.test.ts` |
| Interpreter errors on a mixin's members are reported once per
including block; no unused-mixin warning | ADR 269, Consequences |
| Retiring field presets and type aliases is not part of this project |
`projects/prisma-8-rc1/feature-surface.md` item 6 keeps it as separate
work |

## Classification

Every file under `projects/psl-mixins/` was transient: the project spec
and plan, five slice specs and plans, their dispatch briefs, the team
syntax brief, and the trace log. No file was migrated; the long-lived
material was written to `docs/` during the project. No file outside the
folder referred to it.

## Skill update

n/a — internal only.

## Checklist

- [x] All commits are signed off (`git commit -s`) per the
[DCO](../CONTRIBUTING.md#developer-certificate-of-origin-dco).
- [x] I read [CONTRIBUTING.md](../CONTRIBUTING.md) and the change is
scoped to one logical concern.
- [x] Tests are updated (or `n/a` if the change is doc-only / refactor
with no behavioural delta).
- [ ] The PR title is in `TML-NNNN: <sentence-case title>` form. No
Linear ticket is used for this project.
- [x] The **Skill update** section above is filled in (or stated `n/a —
internal only`).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Steven McClankerton <tatarintsev@prisma.io>
Co-authored-by: Steven McClankerton <tatarintsev@prisma.io>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Assets 2
Loading