Phoenix 1.7.0-rc.0 is out!

FYI for 1.6, under FreeBSD I was never able to get the tailwind CLI working. Has anyone with FreeBSD tried this new release yet?

Tailwindcli is not build for FreeBSD (see here). The elixir tooling just fetches prebuild binaries from there by default. Configuring it with a custom path if you build the cli on your own should work.

Edit:
Maybe the target selection could be adjusted though to detect running on freebsd:

1 Like

When I tried to add phx_live_storybook dependency to Phoenix 1.7 rc1, I got these compilation errors, along with few warnings.

== Compilation error in file lib/phx_live_storybook/live/error_view.ex ==
** (CompileError) lib/phx_live_storybook/live/error_view.ex:2: module Phoenix.View is not loaded and could not be found. This may be happening because the module you are trying to load directly or indirectly depends on the current module
    (elixir 1.14.0) expanding macro: Kernel.use/2
    lib/phx_live_storybook/live/error_view.ex:2: PhxLiveStorybook.ErrorView (module)
    expanding macro: PhxLiveStorybook.Web.__using__/1
    lib/phx_live_storybook/live/error_view.ex:2: PhxLiveStorybook.ErrorView (module)
    (elixir 1.14.0) expanding macro: Kernel.use/2
could not compile dependency :phx_live_storybook, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile phx_live_storybook", update it with "mix deps.update phx_live_storybook" or clean it with "mix deps.clean phx_live_storybook"

Thanks, yes, I installed 1.7 and I can create a new site with phx.new and run it with phx.server with no errors, but there’s no page being served, just a “cannot connect” error in the browser. That’s going to be a show stopper for most BSD users when it comes to trying out the framework. I’m at a point where I’m still learning how these javascript bundlers / packagers work, so it’s not something that I can fix.

Are You trying to open in another machine?

If so You would need to modify config/dev.exs and allow binding on 0.0.0.0 instead of 127.0.0.1

I’m familiar with that step, so no that wasn’t the issue. I should have checked the logs - I think there are logs, I’ve seen references to the logger - but I’ve already deleted the project and gone back to 1.6.

Did anyone try creating a new project with Phoenix 1.7 RC1 and adding authentication with the non-liveview option [Y,n] → n?

While when I select liveview everything works fine, in the non liveview case I get errors at the user registration phase already:

no “new” html template defined for CpartWeb.UserSessionHTML

However, in the generated code, there is a template at lib/cpart_web/controllers/user_registration_html/new.html.heex (automatically generated).

Moreover, I get a warning in VSCode regarding BCrypt but only for the non-liveview option.

I haven’t tested this scenario, but I remember I had a missing controller/view/template (not sure which now) issue with 1.7, which seemed to go away when I moved the file out of and back into the folder in VS Code’s file panel.

1 Like

Thank you sharing your experience! Unfortunately, it does not work for me.

Related:

I appreciate all the hard work put into 1.7 but I’m not fully sold on tailwind. Is there a flag like --no-tailwind. The only option I see right now to get a barebones install is to use --no-assets, but then you have to wire everything up manually.

You can wire up other framework, similar to how we used to replace miligram.

And then replace all the stylings in core_components file.

Any newly generated pages will have your styling with framework of your choice.

@LostKobrakai already did it!

2 Likes

I think there is a typo in the Request life cycle - a new view section in the 1.7 docs.

The embebd template should be:

embed_templates "hello/*"

should be

  embed_templates "hello_html/*"

Not sure where to raise this formally

Guides are part of the phoenix repo, but this one has already been fixed:

3 Likes

Haha I was going through the docs again for practice and saw it.

Then I thought it’s a small change so let me raise a PR.

I saw it was already fixed in master branch. :sweat_smile:

Maybe it would be useful to start a thread where people could post their alternative core_component implementations. Would anyone else find this helpful? Is there a better/simpler way for people to share their implementation for Milligram / Bulma / Bootstrap / etc?

3 Likes

Following up here - the issue is that the generator is not writing embed_templates with the correct directories into the generated HTML modules. Could someone please point me in the direction of where those HTML modules are specified for generation in the code? I can implement a fix for this if it has not yet been done.

To clarify, in your case the fix would be to add embed_templates "(auth_module)_html/*" to all your (auth_module)HTML modules. So it would go from this:

defmodule AppWeb.UsersConfirmationHTML do
  use AppWeb, :html
end

to this:

defmodule AppWeb.UsersConfirmationHTML do
  use AppWeb, :html

  embed_templates("users_confirmation_html/*")
end
1 Like

Thank you for providing the solution!

I believe this is where your PR should go

But looks like it’s already fixed in master.

2 Likes

Thanks for pointing me in the right direction, and I’m glad that it’s already been addressed!