Phoenix 1.3.0 released

Here is a link with info on a 1.3 release of the PragProg Phoenix book: https://forums.pragprog.com/forums/393/topics/14820

1 Like

Hi @chrismccord thanks for Phoenix! I’m using Phoenix 1.3.0-rc in an umbrella application.

My structure is:

foobar_umbrella
  - foobar
  - foobar_web

So within my Phoenix app, naming looks like, for example an API controller:

defmodule FoobarWeb.Web.Api.V1.ArticleController do
  ...
end

Since the MyApp.Web alias has been changed to MyAppWeb, does this mean code will look like?

use FoobarWebWeb, :controller

How do you recommend I approach this update?


Also, I’m using Phoenix from NPM to connect to my Phoenix Channels using websockets, can I update the package from npm to get v2 of the channel protocols?

1 Like

The module of your web app, would be FoobarWeb, with calls to use FoobarWeb, :controller

The package hasn’t been updated yet, but will for the final release. You can specify a path dep in your package.json or vendor it today.

4 Likes

Thanks Chris!

Question about naming tables: How will tables be named when two different contexts has very same schema with different fields but also with clashing ones? Should I avoid situations like this one by name them differently, have one big table or split them somehow?

Rest looks very, very promising. Thanks a lot!

If you have two database-backed schemas in different contexts that are entirely separate, but named the same, then you will need to give one of them a unique name. You can do this by passing the --table flag to the generator.

We would need to talk about your specific use case to say more, but please check out the new context guide which will give you ideas how to handle this kind of scenario. In the guide we create an authors table for author specific information for our CMS, rather than polluting our Account’s “users” table with author specific data.
https://hexdocs.pm/phoenix/1.3.0-rc.3/contexts.html

6 Likes

Thanks for Phoenix. Thanks turning all the criticisms about contexts nil. This project is something to be proud of.

5 Likes

Thanks, I passed only an imaginated example here. I’ll read guides carefully. Thanks again for the great work you’ve made with the core team for the Elixir society :slight_smile:

1 Like

Congrats and thanks to @chrismccord and the #phoenixframework team! Started playing with it for couple of weeks now… it looks pretty solid!

2 Likes

Great!

Just tried out the new installer, and here’s a quick note about the test directory structure (for people upgrading from rc.2):

  • test/web is now test/my_app_web
  • the module names are now MyAppWeb
  • the files in test/support (conn_case, etc.) also have the MyAppWeb name

Thanks for all the hard work everyone’s put in.

2 Likes

Awesome!!

In case it’s useful, you can see the changes to generated files between the two RC’s here: https://www.phoenixdiff.org/?source=1.3.0-rc.2&target=1.3.0-rc.3

Or, if you’re upgrading from 1.2, you can see that at https://www.phoenixdiff.org as well.

11 Likes

I quite liked the table namespacing. Going to miss it as default. :icon_sad:

mix phx.gen.html Accounts User users email:string --table accounts_users
3 Likes

Thanks to Chris and the team! been using 1.3.0 for personal projects and loving it so far. It took some time to wrap my head around the new folder structure, but it makes everything more clear :slight_smile:

2 Likes

Awesome work, Chris! Kudos to you, and to your team! Thank you!

1 Like

I’m not quite sure what this comment is aiming for. What kind of feedback are you after around this release?

1 Like

As promised, 1.3.0 has landed! Check out the officinal announcement here:

22 Likes

Hurra!

Elixir 1.5 released. Phoenix 1.3 released. Now it’s the time to convince my PO that I have to do this upgrade in our app :slight_smile:
Thanks Chris and to the Core team!

4 Likes