[release] v0.0.67 #4
bradleyboy
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
👋 A new version of Nokkio is available–v0.0.67. It includes a few fixes and a new schema feature: computed fields.
To upgrade, run:
nokkio upgrade.What's fixed
🐛 As reported in #3, we weren't properly adding a
declaration.d.tsfile to new TypeScript + CSS Module projects, causing TS errors.🐛 Also reported in #3, we were enabling CSS modules only for files ending in
.modules.css, when most other tools support.module.css. This is now fixed, both work for now.New: Computed fields
Up until now, every field specified in your project's schema represents a field we store in your project's database. But sometimes you may want to add fields to your model at runtime that are derived from other fields or even other models. That's what computed fields are for–you can add them to your schema so they show up in your project's types, etc, then fill them in at runtime.
Here's a very contrived example: Let's say you have a
Personmodel in your project with a first and last name:Let's say you want to also have a full name property, you can do that with computed fields like so:
Then in your project's
server/boot.tsfile, you can add the computed field anytime a Person is read:We needed this for
www.nokk.io(did you know Nokkio was built on Nokkio?), so this is not quite documented yet, but we will do that soon. In the meantime, feel free to ask here if you run into any issues!All reactions