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

feat: build basic port with SvelteKit #143

Merged
merged 7 commits into from
Nov 25, 2024
Merged

feat: build basic port with SvelteKit #143

merged 7 commits into from
Nov 25, 2024

Conversation

nicholaschiang
Copy link
Owner

No description provided.

I'll be trying Drizzle cause it looks interesting and it's one of the
recommended tools when initializing a new SvelteKit project.

For now, I'll just use my existing Prisma schema and use a
database-first approach with `drizzle pull`.

Ref: https://orm.drizzle.team/docs/overview
Ref: https://orm.drizzle.team/docs/migrations
This patch adds a very basic collections list page that connects to our
Postgres database and lists all of the collections available. The data
is streamed from the server [[1]] via a server-only load function [[2]].

I use Drizzle [[3]] as the ORM of choice. It is more performant than
Prisma and more flexible [[4]]. I introspect an existing Postgres
database that contains all of the data and schemas currently in
production (this database state was seeded with Prisma from the code in
`remix-ui`) [[5]].

[1]: https://svelte.dev/docs/kit/load#Streaming-with-promises
[2]: https://svelte.dev/docs/kit/load#Page-data
[3]: https://orm.drizzle.team/
[4]: https://orm.drizzle.team/docs/overview
[5]: https://orm.drizzle.team/docs/get-started/postgresql-existing#step-4---introspect-your-database
This patch adjusts the Prettier configuration to align with the existing
opinionated configuration in `remix-ui`. Note that single quotes are
disabled due to their unavailability in HTML markup.

A few opinionated changes have been made, but I defer mostly to the
default options in Prettier.

Ref: sveltejs/language-tools#2098
Ref: https://prettier.io/docs/en/option-philosophy
Copy link

vercel bot commented Nov 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
dolce ✅ Ready (Inspect) Visit Preview Nov 25, 2024 0:37am

@nicholaschiang nicholaschiang changed the title Nicholas/svelte feat: build basic port with SvelteKit Nov 24, 2024
Copy link

cypress bot commented Nov 24, 2024

dolce    Run #754

Run Properties:  status check passed Passed #754  •  git commit 7195f7d688: feat: build basic port with SvelteKit
Project dolce
Branch Review nicholas/svelte
Run status status check passed Passed #754
Run duration 00m 17s
Commit git commit 7195f7d688: feat: build basic port with SvelteKit
Committer Nicholas Chiang
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 1
View all changes introduced in this branch ↗︎

This patch uses the Drizzle select API instead of the query API to
reduce overhead. We only select the first look for each collection and
use a single query with two LEFT JOINs to accomplish a nearly identical
UX that is 10x faster.
@nicholaschiang nicholaschiang merged commit 9abd0fc into main Nov 25, 2024
9 checks passed
@nicholaschiang nicholaschiang deleted the nicholas/svelte branch November 25, 2024 01:06
@nicholas-release-bot
Copy link

🎉 This PR is included in version 1.69.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant