Live data from Hacker News

FormKit: Form building framework for Vue 3

formkit.com

31–40 of 69 posts

Re: FormKit: Form building framework for Vue 3

#31

Earlier quoted context omitted.

Are you expecting vue to prevent you from doing something wrong?

Imagine if you write a java program and you execute it to get BSOD on windows, is that reasonable?

I've written C# code that deadlocked a webserver, C++ code that crashed a computer lab, JavaScript code that made the browser unresponsive, a SQL migration that accidentally deleted too much data. I don't really know what point you're trying to make, but bad code typically behaves badly.

Re: FormKit: Form building framework for Vue 3

#32

Earlier quoted context omitted.

Are you expecting vue to prevent you from doing something wrong?

Imagine if you write a java program and you execute it to get BSOD on windows, is that reasonable?

You can write a program that locks up your computer in most any language, it's called a fork bomb. Of course, there are guards against the most basic versions these days, but the point still stands that there's nothing stopping you from writing an endless loop that takes up more and more resources.

You can open the browser dev tools on this very page, write in `while(1);`, hit enter and watch the tab freeze up.

Re: FormKit: Form building framework for Vue 3

#33

Earlier quoted context omitted.

Are you expecting vue to prevent you from doing something wrong?

Imagine if you write a java program and you execute it to get BSOD on windows, is that reasonable?

In that case you should blame Windows not Java.

Re: FormKit: Form building framework for Vue 3

#35
post #18

I love these sorts of frameworks! Makes doing forms a lot nicer, especially the live validation. I feel like the next evolution is automatically generating a whole form from selecting a schema in an OpenAPI spec. In a lot of specs, the type (string, email, phone, int, etc) is present along with any constraints (min/max length). Depending on the language/OpenAPI generator, it even preserves field order. It could massi…

These exist, such as: https://github.com/rjsf-team/react-jsonschema-form

We also built one from scratch and used it in client-facing production applications (Angular + React Native). The biggest hurdle is that JSON schema is great at describing the shape of the form data but not a great job at describing how the form looks. We ended up creating a separate "presentation" schema which handled things like order of the form, rows/columns, widgets to use, and much more.

Re: FormKit: Form building framework for Vue 3

#36
post #18

I love these sorts of frameworks! Makes doing forms a lot nicer, especially the live validation. I feel like the next evolution is automatically generating a whole form from selecting a schema in an OpenAPI spec. In a lot of specs, the type (string, email, phone, int, etc) is present along with any constraints (min/max length). Depending on the language/OpenAPI generator, it even preserves field order. It could massi…

I know https://github.com/bytebuilders/vue-openapi-form exists but no first hand experience with it.

There's also a number of them out there that generate a form from json schema. I'm most familiar with https://github.com/formschema/native which we use/extend at https://routegy.com for microapps.

Re: FormKit: Form building framework for Vue 3

#37
post #29
post #17

Earlier quoted context omitted.

Well, they're not validating JSON. Forms are text value fields that aren't always sent as JSON later, or necessarily sent over the wire at all. They definitely are using their DSL for things far out of the scope of JSON schema. The builtin debouncing is pretty neat: https://formkit.com/essentials/validation#debounce-milli Forms in UI code also tend to have a bunch of business-logic type validation (e.g. "there's alre…

Well, they produce JSON though. I understand that there is much more context related to the user interface but you can extend JSON Schema to be able to tie more information to it. It's an incredibly flexible & collaborative way to define the schemas. The backend people are also familiar with it and can validate the data & collaborate with frontend people over a JSON Schema probably much easier compared to a frontend…

But then I'm running a bespoke DSL for interface display in a validation lib.

It's not obvious that's the better direction eh?

Re: FormKit: Form building framework for Vue 3

#38
post #34

Whenever I see these form frameworks the first thing I do is click the label to ensure it focuses the input field. Aaaand pass, good job!

That's a very low bar, I wouldn't even check because it's to be expected. Are there any form frameworks getting traction that are so broken?

Re: FormKit: Form building framework for Vue 3

#40

Is there something like this for bootstrap?

With the genesis theme that ships with it there’s nothing that would be inherently incompatible with bootstrap if you threw it inside a container — provided you’re already using Vue.

Happy to hear if you’re having any issues! We have a very active and helpful discord community.

Post reply on HN