GithubHelp home page GithubHelp logo

Comments (7)

euledge avatar euledge commented on July 24, 2024 1

検討ありがとうございます。まず少し現在の実装のまま、もう少し使って書き心地を試して、不便そうなところあるか試してみます。

from skeet-firestore.

euledge avatar euledge commented on July 24, 2024 1

こちら、対応いただいたもので使えそうなのでクローズします。
いつも対応いただきありがとうございます👍

from skeet-firestore.

KishiTheMechanic avatar KishiTheMechanic commented on July 24, 2024

フロントエンドからは、'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.

KishiTheMechanic avatar KishiTheMechanic commented on July 24, 2024

withConverterを毎回つけるのはたしかに少し面倒なので、このあたりは改善できそうです。
その場合、プラグインはフロントエンド用と分けたほうが良いかもしれません。
そうすると、サーバーサイドと同じように例えばadd<Type>(args)というAPIを提供できます。
例えば、'@skeet-framework/firestore-client'
のようなパッケージになるかと思います!

from skeet-firestore.

KishiTheMechanic avatar KishiTheMechanic commented on July 24, 2024

これやってみたんですが、(import { add } from '@skeet-framework/firestore/client' のようにして)
どうやらimportしたnpmパッケージにFirestoreのdbを突っ込むと動作しなくなるみたいです!
同じヘルパー関数をReact内に作って使うと使えます。

なので、作ったヘルパー関数はフロントエンドのlibに突っ込んで使えるようにしておきます!
後ほどテンプレートの方更新しますので、そちらの使い心地を試していただきたいです!

引き続きよろしくお願いいたします!

from skeet-firestore.

KishiTheMechanic avatar KishiTheMechanic commented on July 24, 2024

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.

KishiTheMechanic avatar KishiTheMechanic commented on July 24, 2024

ご確認ありがとうございます!

こちらこそいつもありがとうございます🙌

from skeet-firestore.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.