s_m
CCConvex Community
•Created by s_m on 11/13/2022 in #general
Hi The documentation states that Code
https://docs.convex.dev/using/query-and-mutation-functions#environment
Convex functions have access to fewer built-in APIs than JavaScript running in browsers or in Node.js. Nearly all JavaScript global objects are available. But web APIs like fetch and window are absent, as are Node.js APIs like process and fs.Does a way to access the environment exist within functions? would I be expected to store it in documents?
12 replies
CCConvex Community
•Created by s_m on 11/13/2022 in #general
Hi The documentation states that Code
A quick follow-up on the
clientConfig.js
: is the expectation that I am bundling the configuration with the build rather than building config-less portable apps that can take the configuration from the environment? Are there any convex-specific considerations if I swap to environment-sourced configuration (like, does not having the config at build time break anything?)? I'm guessing it's fine for me to make that change, and config at build time it's just a consequence of it being the default next.js approach, but checking anyway 🙂12 replies
CCConvex Community
•Created by s_m on 11/13/2022 in #general
Hi The documentation states that Code
Great, thank you for the insight! For now, I'll stick with declaring types manually but I'll re-assess whether that purist approach is necessary once I start fleshing out the schema.
12 replies
CCConvex Community
•Created by s_m on 11/13/2022 in #general
Hi The documentation states that Code
(I should clarify that I don't like generated code that is used as part of the app. Generated code for typings is fine, so my expectation is, if the generated code is not required for anything functional, then I'd import directly from
convex/react
for useMutationGeneric
etc. (and provide the typings as part of the app) and have the schema-based generated code (i.e: dataModel.d.ts
) generated locally as a development helper but not committed and thus not a dependency).12 replies