dai-shi / waku

⛩️ The minimal React framework
https://waku.gg
MIT License
4.11k stars 108 forks source link

add api example #743

Closed dai-shi closed 2 weeks ago

dai-shi commented 2 weeks ago

While we wait for #329 (which takes time to design and implement, and we believe most cases are covered by server actions), we can use the low-level middleware api.

vercel[bot] commented 2 weeks ago

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

1 Ignored Deployment | Name | Status | Preview | Updated (UTC) | | :--- | :----- | :------ | :------ | | **waku** | ⬜️ Ignored ([Inspect](https://vercel.com/daishis-projects/waku/3pBoePFMtj5kVSSunv8C3DztqDdR)) | [Visit Preview](https://waku-git-api-example-daishis-projects.vercel.app) | Jun 6, 2024 6:08am |
codesandbox-ci[bot] commented 2 weeks ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

codesandbox-ci[bot] commented 2 weeks ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

dai-shi commented 2 weeks ago

I wonder if it's a framework choice or a React rule.

Anyway, I believe #329 is unavoidable for us. I'll work on it, but it will take time. There are some other tasks with priority (not because of the use case, but the internal architecture.)

himself65 commented 2 weeks ago

I wonder if it's a framework choice or a React rule.

I believe this is React behavior, which will prohibit race conditions in the React backend at all

dai-shi commented 2 weeks ago

By the way, for data fetching, we should use server components and rsc is capable of sending promises, so technically we can wrap the api with rsc.