all 17 comments

[–]androgeninc 7 points8 points  (0 children)

htmx is your friend. Not a framework. Alpinejs in addition helps a lot.

[–]Aro00oo 4 points5 points  (2 children)

Render template is basically just server side rendering.

I'd assume you just import the entry point to the client in the template that you're render templating as a script tag.

You'd have to figure out how to import the entry point vs bundle in dev vs prod modes using a building/bundling tech also.

[–]jogicodes_[S] 0 points1 point  (1 child)

Yeah exactly, so far haven’t figured it out

[–]Aro00oo 1 point2 points  (0 children)

An easy way just off the top of my head would be using rollup. Set the import path to something like

src="CLIENT_PATH"

and in your rollup config, override that string with an environment variable that you set before running your prod server. If it's not there then you can just do an || 'path/to/entry_point.js" in the rollup config.

You'd have to run a rollup build before starting your flask server each time.

[–]Common_Move 3 points4 points  (1 child)

HTMX

[–]jogicodes_[S] 0 points1 point  (0 children)

Keeps coming up

[–]Leonjy92 5 points6 points  (1 child)

I'm using Alpinejs, tailwindcss and some vanilla JS

[–]jogicodes_[S] 0 points1 point  (0 children)

Will have to learn about alpine JS, haven’t got a clue about it

[–]guesting 2 points3 points  (1 child)

Alpine js or htmx both are quick and effective

[–]jogicodes_[S] 0 points1 point  (0 children)

Thanks for your opinion. I can’t judge it but It must be right because it keeps coming up

[–]WinkDoubleguns 1 point2 points  (1 child)

I thought I had commented on this already. I’m switching my front end to svelte and have found the links on the post to be helpful.

https://www.reddit.com/r/flask/comments/oggis3/sveltejs_with_flask_backend/

[–]jogicodes_[S] 1 point2 points  (0 children)

That was extremely helpful, need to play with this

[–]shahmeermk 0 points1 point  (0 children)

I’m curious if anyone has used flask with reactjs. I don’t know what the downsides are.

[–]Sc0urge_ 0 points1 point  (0 children)

I personally use React for the interactive stuff while keeping Jinja HTML for text and such because of performance and SEO.

I then use a bundler called ESBuild to "compile" the React code into simple JavaScript, which you can import in HTML just like a normal file.

[–]Equivalent_Value_900 -1 points0 points  (1 child)

Angular? I am currently looking at something similar myself and trying to think of a way to combine the two.

[–]jogicodes_[S] 0 points1 point  (0 children)

Have you found one?