New Fauna JS driver available for alpha testing #469
Replies: 5 comments 3 replies
-
It's looking great @n400 ! Is this new version going to improve the client-side size issues discussed here? Personally, I'm fine with the breaking changes. Would be great if the dashboard's shell supported these FQL name changes. I find myself frequently copying/pasting JS code into the shell and viceversa. |
Beta Was this translation helpful? Give feedback.
-
The new API looks cleaner and more like what I'd expect. The new naming ( |
Beta Was this translation helpful? Give feedback.
-
@n400, i tried the new version with vite, and I am getting the following error: |
Beta Was this translation helpful? Give feedback.
-
Hello. These instructions seem specific to Node.js. How can I use it in a browser (or in Deno)? (I am looking for instructions for using |
Beta Was this translation helpful? Give feedback.
-
Closing this, as we will be maintaining v4 of this driver while also moving forward with our v10 driver in a different repository: https://github.com/fauna/fauna-js Thanks all, for your feedback! |
Beta Was this translation helpful? Give feedback.
-
Help us improve Fauna's upcoming JS driver
We're working on a new JavaScript driver that supports ECMAScript modules (ESM) to support tree shaking, allow for smaller bundle sizes, and generally provide a more modern development experience.
Please note that this driver version is not officially supported and should NOT be used in production, because we might continue to add breaking changes and there may be bugs as we continue to improve the experience.
That said, we would be very thankful if you would be kind enough to test it in a development environment and provide us feedback and/or questions.
Installation instructions
To try the new driver, you’ll need to change the FaunaDB dependency :
npm install https://github.com/fauna/faunadb-js.git#esm_build --save
In package.json, you should now see this line:
"faunadb": "git+https://github.com/fauna/faunadb-js.git#esm_build",
instead of:
"faunadb": "file:../../faunadb-js",
Migration guide from 4.X.X to 5.X.X
To take advantage of ESM, you will need to make some minor changes to your app code:
Faunadb imports
Import query functions
All query functions have been removed from the main package and hosted under sub-module
faunadb/query
.CommonJS
ECMAScript
Although most modern bundle tools are able to tree-shake the package with named imports, we recommend using deep imports.
Renamed queries
Due to the restriction of JS reserved words, some queries have been renamed.
Streaming API
The streaming API is no longer included by default.
Providing feedback and asking questions
To provide feedback or ask questions, please feel free to reply to this Discussion topic and/or email product at fauna dot com
Beta Was this translation helpful? Give feedback.
All reactions