Fresh Phoenix 1.5.1 project -- jQuery already in place?

As per the title. I got through the initial setup of a brand new Phoenix 1.5.1 app (and included --live when creating it), started the server and then tried typing $("section.phx-hero") in two browsers’ dev consoles, and both returned the right element.

I haven’t been keeping up with Phoenix development for a bit of time so just want to ask this: is jQuery now added out of the box in new Phoenix projects?

Pretty sure it’s been a helper in Chrome for a while, not sure when it was introduced though.

3 Likes

Yeah but I tested in Safari and Firefox.

$() being available is mentioned in the Firefox console docs too

Wiw, this was news to me :slight_smile:

I just created a scratch 1.5.1 project and no jquery in assets/node_modules after npm install. It’s not mentioned in package-json.lock either.

So a fresh Phoenix project doesn’t come with jQuery after all? The $ helper is now built-in in all major browsers?

AFAICT it’s built into their developer consoles, so it wouldn’t work from a script on the page. Haven’t tested that though.

1 Like

Can confirm that Phoenix does not ship with jQuery out of the box :slight_smile:

7 Likes