Gabool
TTCTheo's Typesafe Cult
•Created by Gabool on 4/23/2024 in #questions
Scehma Versioning of Event driven architecture
What are some ways schema versioning is done.
Currently at work our system has no schema versioning, so I have been working on a middle man module that will be the start of versioning everything at least externally. With that comes schema versioning and a rest api that functions over an event based backend. The most obvious first step is adding a schema version, our api will be v1/<resource>.
However, there can be minor schema changes and additions, and I am not sure on how to best go about handling this.
Should each backend module have a registery of schemas, and what version a field is supported?
Should I have a mapper to map between old and new versions of the schema when they are minor updates?
The biggest thing is keeping a consistent rest api, but allowing us to make heavy handed backend changes, I presume as long as the fields stay the same or relatively the same this shouldn't be too bad as we work to update our existing architecture. Any thoughts or recomended readings/research topics would help, as I am getting a bit of information overload.
5 replies
TTCTheo's Typesafe Cult
•Created by Gabool on 8/5/2023 in #questions
GCP Private service connect
I am trying to setup a nats Jetstream cluster behind private service connect, realistically I would like to expose each node as a service and create an endpoint for each one. I was able to get one working node working, but I am struggling to get two nodes working. Right now they are just vms. It seems as if I would need to do a load balancer for each node, is there anyway to set this up where I can have one endpoint per a node, the nodes will talk amongst themselves and will load balance on there own, so I don't realistically need an lb, but private service connect seems to require one for a publisher service.
I know this is primarily web dev, but figured I had a chance to run into at least one person that may know GCP and would be able to throw ideas around/talk through my solution this far.
2 replies
TTCTheo's Typesafe Cult
•Created by Gabool on 3/18/2023 in #questions
tailwind w- h- custom value's
Hello all, how often do you guys utilize custom value's over w-2 h-3? I see myself using them everywhere, but sometimes it just doesn't seem to feel right like there is an in-between that is missing and it makes me feel like I'm straying from the path
5 replies
TTCTheo's Typesafe Cult
•Created by Gabool on 1/12/2023 in #questions
React Hook Form Typescript - Tabs
Hello All,
Currently I have setup tabs on my form, and currently the state only saves to the page context when submit is pressed on each tab, however I would like it to save the values between changing tabs without having to use submit or shouldUnregister: false as its deprecated.
I figured I could persist the state on click of the tab (pretty much just run submit form outside of the form), but I don't like this method as I lose metadata like isDirty.
I can do something similar as above, and use getValues(), as well as the metadata and save that, and on tab change rebuild the state manually as well, but that just seems round about for whatever reason, I figure there maybe another way to accomplish this single form nature, or like a background save on change to the page state.
https://codesandbox.io/s/tabs-760h9?file=/src/TabGroup.tsx:845-892
Pretty much using this as a template, only difference is I am using tailwind ui, and searchparams to store which tab is open.
Maybe skipping app level state, and just autosaving to server state similar to the solution here:
https://stackoverflow.com/questions/73614962/how-to-make-a-react-query-with-react-hook-form-autosave
What are your opinions in the matter?
3 replies
TTCTheo's Typesafe Cult
•Created by Gabool on 12/29/2022 in #questions
Database Design for API
How would you guys go about designing a table/api for something like a form builder for a specific purpose.
For example I want the users to be able to add inputs etc, and right now I just save these as json in a json column for each form type created by a user, however when it comes to types, this isn't so convenient. So I was thinking of possibly just making the form inputs to be stored as a list of json, where each input would have { name:"", Value:"", Type:"", Validation:"" } and then just parsing the json array into a form and to store it's values. Almost like EAV style, but per a row since we have json columns now
2 replies
TTCTheo's Typesafe Cult
•Created by Gabool on 12/19/2022 in #questions
Active Bottom Tab Rounding.
36 replies
TTCTheo's Typesafe Cult
•Created by Gabool on 10/9/2022 in #questions
React Hook Form Reset Triggering on Change?
I have a form using useform, one of the inputs updates another input when it is filled out using onchange and setvalue, however that second input is set to the first inputs value when I update default values using reset, and not setting the field to it's value returned in an API call. Any ideas on how to allow for setting a value on change and pulling correct data when reseting the form?
6 replies