May I use phoenix without javascript?

Hello, I’d like to know if its possible to use Phoenix without javascript.

Generally yes, though optional parts in a phoenix codebase like liveview or the live dashboard require js.

Alright, thanks.

Oh and, forgive me as I’m new to this. To make use of sockets, the client-side requires JS?

Yes, the client-side must have JS. If you want a clean separation between the frontend and the backend, you can try phoenix - npm in the frontend project.

By the way, the README.md is copied from the phoenix framework so it’s quite confusing. All you need to do is just

$ npm install phoenix

and in your js code,

import {Socket, Channel} from 'phoenix'

Do you mean without writing javascript yourself or with javascript disabled?

2 Likes

With Javascript disabled.

Thank you.

LiveViews actually works with JS disabled. You don’t get websockets, of course, which means no live updates, it just gracefully falls back to regular old http.

3 Likes

Aha, gotcha. Thanks.