Skip to content

Commit

Permalink
Update PocketBase SDK and TanStack Query Client
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrozadotdev committed Jun 12, 2024
1 parent a821bc0 commit b3ccda0
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 39 deletions.
2 changes: 1 addition & 1 deletion client/packages/openblocks/src/constants/libConstants.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const libNames = new Set(["uuid", "numbro", "Papa"]);
export const libNames = new Set(["uuid", "numbro", "Papa", "pb", "qc"]);
16 changes: 9 additions & 7 deletions docs/en/build-apps/use-third-party-libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ Every developer learns one of the most important principles of software engineer

PocketBlocks provides some JavaScript built-in libraries for use.

| Library | Docs | Version |
| --------- | -------------------------------------------------------------------- | ---------------------------- |
| lodash | [https://lodash.com/docs/](https://lodash.com/docs/) | 4.17.21 |
| moment | [https://momentjs.com/docs/](https://momentjs.com/docs/) | 2.29.3 |
| uuid | [https://github.com/uuidjs/uuid](https://github.com/uuidjs/uuid) | 8.3.2(Support v1/v3/v4/v5) |
| numbro | [https://numbrojs.com/format.html](https://numbrojs.com/format.html) | 2.3.6 |
| papaparse | [https://www.papaparse.com/docs](https://www.papaparse.com/docs) | 5.3.2 |
| Library | Docs | Version |
| ------------------------ | -------------------------------------------------------------------------------------------------------------------- | ---------------------------- |
| lodash | [https://lodash.com/docs/](https://lodash.com/docs/) | 4.17.21 |
| moment | [https://momentjs.com/docs/](https://momentjs.com/docs/) | 2.29.3 |
| uuid | [https://github.com/uuidjs/uuid](https://github.com/uuidjs/uuid) | 8.3.2(Support v1/v3/v4/v5) |
| numbro | [https://numbrojs.com/format.html](https://numbrojs.com/format.html) | 2.3.6 |
| papaparse(Papa) | [https://www.papaparse.com/docs](https://www.papaparse.com/docs) | 5.3.2 |
| PocketBase SDK(pb) | [https://pocketbase.io/docs/client-side-sdks](https://pocketbase.io/docs/client-side-sdks) | 0.21.3 |
| TanStack QueryClient(qc) | [https://tanstack.com/query/v5/docs/reference/QueryClient](https://tanstack.com/query/v5/docs/reference/QueryClient) | 5.44.0 |

## Manually import third-party libraries

Expand Down
2 changes: 1 addition & 1 deletion docs/en/misc/data-sources.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
PocketBlocks integrates Openblocks and PocketBase, or at least the client's part. As this project aims to create as much flexibility as possible between those two software, we opted not to port the **data source/query library** features as we have access to the [Pocketbase SDK](https://pocketbase.io/docs/client-side-sdks/) through **window.pb**. We also can use the [extend features](https://pocketbase.io/docs/js-overview/) of Pocketbase to integrate with data sources using something like [n8n](https://n8n.io/) or [Zarpier](https://zapier.com/).

{% hint style="info" %}
We also provide a [QueryClient instance](https://tanstack.com/query/v4/docs/react/reference/QueryClient) for caching purposes. You can access it with **window.qc**. It uses sessionStorage with a staleTime of 5 minutes.
We also provide a [QueryClient instance](https://tanstack.com/query/v5/docs/reference/QueryClient) for caching purposes. You can access it with **window.qc**. It uses sessionStorage with a staleTime of 5 minutes.
{% endhint %}
16 changes: 9 additions & 7 deletions docs/pt-br/build-apps/use-third-party-libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ Todo desenvolvedor aprende um dos princípios mais importantes da engenharia de

PocketBlocks fornece algumas bibliotecas JavaScript integradas para uso.

| Biblioteca | Documentação | Versão |
| ---------- | -------------------------------------------------------------------- | ---------------------------- |
| lodash | [https://lodash.com/docs/](https://lodash.com/docs/) | 4.17.21 |
| moment | [https://momentjs.com/docs/](https://momentjs.com/docs/) | 2.29.3 |
| uuid | [https://github.com/uuidjs/uuid](https://github.com/uuidjs/uuid) | 8.3.2(Suporta v1/v3/v4/v5) |
| numbro | [https://numbrojs.com/format.html](https://numbrojs.com/format.html) | 2.3.6 |
| papaparse | [https://www.papaparse.com/docs](https://www.papaparse.com/docs) | 5.3.2 |
| Biblioteca | Documentação | Versão |
| ------------------------ | -------------------------------------------------------------------------------------------------------------------- | ---------------------------- |
| lodash | [https://lodash.com/docs/](https://lodash.com/docs/) | 4.17.21 |
| moment | [https://momentjs.com/docs/](https://momentjs.com/docs/) | 2.29.3 |
| uuid | [https://github.com/uuidjs/uuid](https://github.com/uuidjs/uuid) | 8.3.2(Support v1/v3/v4/v5) |
| numbro | [https://numbrojs.com/format.html](https://numbrojs.com/format.html) | 2.3.6 |
| papaparse(Papa) | [https://www.papaparse.com/docs](https://www.papaparse.com/docs) | 5.3.2 |
| PocketBase SDK(pb) | [https://pocketbase.io/docs/client-side-sdks](https://pocketbase.io/docs/client-side-sdks) | 0.21.3 |
| TanStack QueryClient(qc) | [https://tanstack.com/query/v5/docs/reference/QueryClient](https://tanstack.com/query/v5/docs/reference/QueryClient) | 5.44.0 |

## Importando manualmente bibliotecas de terceiros

Expand Down
2 changes: 1 addition & 1 deletion docs/pt-br/misc/data-sources.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
PocketBlocks integra Openblocks e PocketBase, ou pelo menos a parte do cliente. Como este projeto visa criar o máximo de flexibilidade possível entre esses dois softwares, optamos por não portar os recursos **fonte de dados/biblioteca de consulta**, pois temos acesso ao [Pocketbase SDK](https://pocketbase.io/docs/client-side-sdks/) por meio do **window.pb**. Também podemos usar os [recursos de extensão](https://pocketbase.io/docs/js-overview/) do Pocketbase para integração com fontes de dados usando algo como [n8n](https://n8n.io/) ou [ Zarpier](https://zapier.com/).

{% dica estilo = "info" %}
Também fornecemos uma [instância do QueryClient](https://tanstack.com/query/v4/docs/react/reference/QueryClient) para fins de armazenamento em cache. Você pode acessá-lo com **window.qc**. Ele usa sessionStorage com staleTime de 5 minutos.
Também fornecemos uma [instância do QueryClient](https://tanstack.com/query/v5/docs/reference/QueryClient) para fins de armazenamento em cache. Você pode acessá-lo com **window.qc**. Ele usa sessionStorage com staleTime de 5 minutos.
{% endhint %}
8 changes: 4 additions & 4 deletions proxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
"vite": "^4.5.3"
},
"dependencies": {
"@tanstack/query-core": "^4.35.0",
"@tanstack/query-persist-client-core": "^4.35.0",
"@tanstack/query-sync-storage-persister": "^4.35.0",
"@tanstack/query-core": "^5.44.0",
"@tanstack/query-persist-client-core": "^5.44.0",
"@tanstack/query-sync-storage-persister": "^5.44.0",
"axios-mock-adapter": "^1.22.0",
"i18next": "^23.5.1",
"i18next-browser-languagedetector": "^7.1.0",
"lz-string": "^1.5.0",
"path-to-regexp": "^6.2.1",
"pocketbase": "^0.18.0"
"pocketbase": "^0.21.3"
}
}
37 changes: 19 additions & 18 deletions proxy/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -196,24 +196,25 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"

"@tanstack/query-core@4.35.3", "@tanstack/query-core@^4.35.0":
version "4.35.3"
resolved "https://registry.npmjs.org/@tanstack/query-core/-/query-core-4.35.3.tgz"
integrity sha512-PS+WEjd9wzKTyNjjQymvcOe1yg8f3wYc6mD+vb6CKyZAKvu4sIJwryfqfBULITKCla7P9C4l5e9RXePHvZOZeQ==
"@tanstack/query-core@5.44.0", "@tanstack/query-core@^5.44.0":
version "5.44.0"
resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-5.44.0.tgz#f7d5e04eaca0ed0c8ff52b36d0a6df142b3a78fb"
integrity sha512-Fa1J7iEEyJnjXG1N4+Fz4OXNH/INve3XSn0Htms3X4wgRsXHxMDwqBE2XtDCts7swkwSIs4izEtaFqWVFr/eLQ==

"@tanstack/query-persist-client-core@4.35.3", "@tanstack/query-persist-client-core@^4.35.0":
version "4.35.3"
resolved "https://registry.npmjs.org/@tanstack/query-persist-client-core/-/query-persist-client-core-4.35.3.tgz"
integrity sha512-UlUMsvmy12qgPzphIq8iyFtwxuv/vaEyFQEFDVVCvyrqj2G020qMZiCA1vj3+gasmCXh59EraiC2eY4Iqo0/PA==
"@tanstack/query-persist-client-core@5.44.0", "@tanstack/query-persist-client-core@^5.44.0":
version "5.44.0"
resolved "https://registry.yarnpkg.com/@tanstack/query-persist-client-core/-/query-persist-client-core-5.44.0.tgz#c30770082e944c3fb7c0b2c146d2dba0f913d47c"
integrity sha512-S9JvOsIWC/lXKBHBw7pHHMHdKecFEmZs7Znik5+YtukasniF7glXdGGmvFcoqweeqneAVyPX0gtoMvf1Dz71dw==
dependencies:
"@tanstack/query-core" "4.35.3"
"@tanstack/query-core" "5.44.0"

"@tanstack/query-sync-storage-persister@^4.35.0":
version "4.35.3"
resolved "https://registry.npmjs.org/@tanstack/query-sync-storage-persister/-/query-sync-storage-persister-4.35.3.tgz"
integrity sha512-q9axt4iJkRnhR9R9qou+Q2+T2S21jwgf/7carYs9DQGLoE9r9YnwxgbmDE72yQd1glcsGF26UqqO6WO8ziNCrQ==
"@tanstack/query-sync-storage-persister@^5.44.0":
version "5.44.0"
resolved "https://registry.yarnpkg.com/@tanstack/query-sync-storage-persister/-/query-sync-storage-persister-5.44.0.tgz#3c65f9d05de26f8e3224bde635e1e41a9fc0485d"
integrity sha512-/ZamsjzP3UxH8sRTdhpNNoUPfo1ZjoJ2wrn3dDZGw95AMQprCXNhoT+nVSaqvo0pmvArY9M1N3QVXwx3ZLI2LQ==
dependencies:
"@tanstack/query-persist-client-core" "4.35.3"
"@tanstack/query-core" "5.44.0"
"@tanstack/query-persist-client-core" "5.44.0"

"@types/json-schema@^7.0.12":
version "7.0.13"
Expand Down Expand Up @@ -1011,10 +1012,10 @@ picomatch@^2.3.1:
resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz"
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==

pocketbase@^0.18.0:
version "0.18.0"
resolved "https://registry.npmjs.org/pocketbase/-/pocketbase-0.18.0.tgz"
integrity sha512-09ri0Rnm4JjboU4OJeibd6pgvKi4DPg/r/Uu/QI3mKSZsrROoMT75zyiOldbBBMWZUDG1TRlv6BjQj30SFsrVw==
pocketbase@^0.21.3:
version "0.21.3"
resolved "https://registry.yarnpkg.com/pocketbase/-/pocketbase-0.21.3.tgz#83e16bec07ba649649c313e85cc5786a84dc422e"
integrity sha512-bsQRZ1mj4dhPJ4P5iSrDqWQtBX2NtuBkf6IOZwTv27zZOw6zrISgo963i5JD/99qKKD5aMSMDPGk1BE9ZyI7Cg==

postcss@^8.4.27:
version "8.4.31"
Expand Down

0 comments on commit b3ccda0

Please sign in to comment.