Skip to content

Commit

Permalink
set force: true by default in single file scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
SteffenDE committed Dec 12, 2024
1 parent d1250dc commit a5cfdd5
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 19 deletions.
24 changes: 15 additions & 9 deletions .github/single-file-samples/main.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ Application.put_env(:sample, Example.Endpoint,
secret_key_base: String.duplicate("a", 64)
)

Mix.install([
{:plug_cowboy, "~> 2.5"},
{:jason, "~> 1.0"},
{:phoenix, "~> 1.7"},
# please test your issue using the latest version of LV from GitHub!
{:phoenix_live_view, github: "phoenixframework/phoenix_live_view", branch: "main", override: true},
])
Mix.install(
[
{:plug_cowboy, "~> 2.5"},
{:jason, "~> 1.0"},
{:phoenix, "~> 1.7"},
# please test your issue using the latest version of LV from GitHub!
{:phoenix_live_view,
github: "phoenixframework/phoenix_live_view", branch: "main", override: true}
],
force: true
)

# build the LiveView JavaScript assets (this needs mix and npm available in your path!)
path = Phoenix.LiveView.__info__(:compile)[:source] |> Path.dirname() |> Path.join("../")
Expand All @@ -32,8 +36,10 @@ defmodule Example.HomeLive do

def render("live.html", assigns) do
~H"""
<script src="/assets/phoenix/phoenix.js"></script>
<script src="/assets/phoenix_live_view/phoenix_live_view.js"></script>
<script src="/assets/phoenix/phoenix.js">
</script>
<script src="/assets/phoenix_live_view/phoenix_live_view.js">
</script>
<%!-- uncomment to use enable tailwind --%>
<%!-- <script src="https://cdn.tailwindcss.com"></script> --%>
<script>
Expand Down
26 changes: 16 additions & 10 deletions .github/single-file-samples/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@ Application.put_env(:phoenix, Example.Endpoint,
secret_key_base: String.duplicate("a", 64)
)

Mix.install([
{:plug_cowboy, "~> 2.5"},
{:jason, "~> 1.0"},
{:phoenix, "~> 1.7"},
# please test your issue using the latest version of LV from GitHub!
{:phoenix_live_view, github: "phoenixframework/phoenix_live_view", branch: "main", override: true},
{:floki, ">= 0.30.0"}
])
Mix.install(
[
{:plug_cowboy, "~> 2.5"},
{:jason, "~> 1.0"},
{:phoenix, "~> 1.7"},
# please test your issue using the latest version of LV from GitHub!
{:phoenix_live_view,
github: "phoenixframework/phoenix_live_view", branch: "main", override: true},
{:floki, ">= 0.30.0"}
],
force: true
)

ExUnit.start()

Expand All @@ -30,8 +34,10 @@ defmodule Example.HomeLive do

def render("live.html", assigns) do
~H"""
<script src="/assets/phoenix/phoenix.js"></script>
<script src="/assets/phoenix_live_view/phoenix_live_view.js"></script>
<script src="/assets/phoenix/phoenix.js">
</script>
<script src="/assets/phoenix_live_view/phoenix_live_view.js">
</script>
<script>
let liveSocket = new window.LiveView.LiveSocket("/live", window.Phoenix.Socket)
liveSocket.connect()
Expand Down

0 comments on commit a5cfdd5

Please sign in to comment.