The modern browser environment is fantastic
If you want to prototype extremely fast with generative AI, small files are the way to go.
Wouldn’t it be great if only we could do structure, presentation and logic all in one file without messing with a complicated build system?
Well, it’s 2024, we can.
Ask your LLM to assemble the app you want feature by feature as web components! Modern vanilla JS, no build system, just what current browsers support.
I got so used to complicated TypeScript setups, multiple frameworks, that I didn’t even bother checking what the native web can do.
But now this is a perfect pairing for GenAI.
Use a domain-driven approach, have a store for managing state and trigger updates as events in the system.
That way you can have independent components and a high level orchestrator that ties it all together.
I’ve found that my error rate dropped significantly with this approach.
Sure, if you are building a simple thing that can fit inside 400 lines of code, the LLM can just spit it out.
But if you want to use it to prototype a more complex application, you need to structure it in a way that doesn’t hit the context limits.
This is the best way I’ve found so far.
Try it, let me know how it goes.
P.S. If you want backwards compatibility, you’ll need a build system. But for rapid prototyping, going vanilla is just incredible.
Yours,
Taj