Comments (7)
検討ありがとうございます。まず少し現在の実装のまま、もう少し使って書き心地を試して、不便そうなところあるか試してみます。
from skeet-firestore.
こちら、対応いただいたもので使えそうなのでクローズします。
いつも対応いただきありがとうございます👍
from skeet-firestore.
フロントエンドからは、'firebase/firestore'をそのまま使って、コンバーターを差し込んでいますが、これもプラグインに入れたほうが使いやすいでしょうか?
このプラグインはサーバーサイド用としていて、フロントエンドを外していた理由としては、メソッド名が競合しそうだったからです。
adminの方は複雑なのでラッパーが欲しかったのですが、
v9のクライアントからの取得は例えばこのようになっていて、
https://github.com/elsoul/skeet-next/blob/main/src/components/pages/user/chat/ChatBox.tsx#L110C5-L115C43
(このcreateFirestoreDataConverterはsrc/libからのimportなことに気をつけてください)
特別にラッパーを用意しなくても既に使いやすい形だと思っています。
このあたりご意見いただければ嬉しいです🙌
いつもありがとうございます!
引き続きよろしくお願いいたします。
from skeet-firestore.
withConverterを毎回つけるのはたしかに少し面倒なので、このあたりは改善できそうです。
その場合、プラグインはフロントエンド用と分けたほうが良いかもしれません。
そうすると、サーバーサイドと同じように例えばadd<Type>(args)
というAPIを提供できます。
例えば、'@skeet-framework/firestore-client'
のようなパッケージになるかと思います!
from skeet-firestore.
これやってみたんですが、(import { add } from '@skeet-framework/firestore/client' のようにして)
どうやらimportしたnpmパッケージにFirestoreのdbを突っ込むと動作しなくなるみたいです!
同じヘルパー関数をReact内に作って使うと使えます。
なので、作ったヘルパー関数はフロントエンドのlibに突っ込んで使えるようにしておきます!
後ほどテンプレートの方更新しますので、そちらの使い心地を試していただきたいです!
引き続きよろしくお願いいたします!
from skeet-firestore.
https://github.com/elsoul/skeet-next/tree/main/src/lib/skeet/firestore/lib
Next.js + Firestoreのテンプレートに、Firestoreのフロントエンド用ヘルパー関数を追加してみました!
使い方は
https://github.com/elsoul/skeet-next/blob/main/src/layouts/user/UserLayout.tsx
このように使えるので、より簡単に取り扱うことができるようになりました🙌
from skeet-firestore.
ご確認ありがとうございます!
こちらこそいつもありがとうございます🙌
from skeet-firestore.
Related Issues (11)
- Better to use server timestamp
- unresolve type QueryCondition because not export
- add test methods for adds, query, update, delete HOT 2
- Incorrect usage example of advancedConditions HOT 1
- We want to force code format before commit HOT 1
- [Question] document html write one line is code format rule in this project HOT 1
- not installed eslint plugins HOT 3
- README still refers to it as delete.
- Some environment has timestamp related error with add method HOT 1
- add a test for the skeet-firestore plugin method
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from skeet-firestore.