liveview-native / live_view_native_stylesheet

MIT License
12 stars 5 forks source link

Stylesheet parsing error #37

Closed joecorcoran closed 9 months ago

joecorcoran commented 9 months ago

I'm using 0.2.0-rc.1 and having problems getting a simple stylesheet to parse. I'm following the video tutorial from the beta release, maybe some things have changed since then. Apologies if this issue should be in a different repo.

defmodule Hello2Web.HomeLive do
  use Hello2Web, :live_view
  use Hello2Web.HomeStyles

  def render(%{format: :swiftui} = assigns) do
    ~SWIFTUI"""
    <VStack>
      <Text class="bold">Hello from iOS!</Text>
      <Text phx-click="incr"><%= @count %></Text>
    </VStack>
    """
  end

  # ...
end
defmodule Hello2Web.HomeStyles do
  use LiveViewNative.Stylesheet, :swiftui

  ~SHEET"""
  "bold" do
    bold(true)
  end
  """

  def class(_, _), do: {:unmatched, ""}
end

Here's what I see in Xcode:

Stylesheet parsing failed for class `bold`:

error: multiple failures occurred

error: unexpected input
 --> input:1:84
1 | …Hello2Web.HomeStyles, source: "bold(true)"], [true]}]}
  |                      ^ expected "]"

error: unexpected input
 --> input:1:14
1 | %{"bold" => [{:bold, [file: "home_styles.ex", line: 6, module: Hello2Web.Ho…
  |              ^ expected "]"

in stylesheet:

%{"bold" => [{:bold, [file: "home_styles.ex", line: 6, module: Hello2Web.HomeStyles, source: "bold(true)"], [true]}]}

Any ideas?


Xcode Version 15.2 (15C500b) Elixir 1.16 Erlang 26.2.1 Phoenix 1.7.10

Here's the LVN section from mix.lock.

  "live_view_native": {:hex, :live_view_native, "0.2.0-rc.1", "81f0a76bb50a31f2ac64dae10fad3a250178b66a69a4b7d586ffb64258d9002b", [:mix], [{:deep_merge, "~> 1.0", [hex: :deep_merge, repo: "hexpm", optional: false]}, {:floki, ">= 0.30.0", [hex: :floki, repo: "hexpm", optional: false]}, {:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: false]}, {:live_view_native_platform, "0.2.0-rc.1", [hex: :live_view_native_platform, repo: "hexpm", optional: false]}, {:owl, "~> 0.8", [hex: :owl, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.7", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_live_view, "< 0.20.3", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.5", [hex: :plug_cowboy, repo: "hexpm", optional: false]}], "hexpm", "2a9fe947bd349ff9598ac0bc7919de9d93f2d03b5a46488005fb86b745e66086"},
  "live_view_native_platform": {:hex, :live_view_native_platform, "0.2.0-rc.1", "944061db8d93e1a6016f43a9ea8d94061660f14ac69728182f6047691a6f481c", [:mix], [{:ecto, "~> 3.8", [hex: :ecto, repo: "hexpm", optional: false]}, {:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}], "hexpm", "0d9d11a1a30bb1218bf534cf520c24a9b4e688705ecb003f1579996ef5be247e"},
  "live_view_native_stylesheet": {:hex, :live_view_native_stylesheet, "0.2.0-rc.1", "725c0e7720fb431c3512892fcfa07cd6bef62aa0326dea297e8ea77849fc850a", [:mix], [{:nimble_parsec, "~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "22870da5f3b8d319412454e1a5bc6e4afdaabc0ddee0ff9ba58b7204e8a14f7b"},
  "live_view_native_swiftui": {:hex, :live_view_native_swiftui, "0.2.0-rc.1", "4b5f88b0ccc9d15cf67d6532d8c863a0323f3f7d51457bb09f22db293689022e", [:mix], [{:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: false]}, {:live_view_native_platform, "0.2.0-rc.1", [hex: :live_view_native_platform, repo: "hexpm", optional: false]}, {:live_view_native_stylesheet, "0.2.0-rc.1", [hex: :live_view_native_stylesheet, repo: "hexpm", optional: false]}, {:makeup_json, "~> 0.1.0", [hex: :makeup_json, repo: "hexpm", optional: false]}, {:makeup_swift, "~> 0.0.1", [hex: :makeup_swift, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "adb0327781773e6a731f66d4799132138e4677cc9f03a9095a149860ddfe3060"},
bcardarella commented 9 months ago

@joecorcoran this should be fixed for the v0.3.0 release branch which will hopefully be moving to beta by next week along with installation instructions

joecorcoran commented 9 months ago

Great, thanks for updating!

Joe Corcoran https://corcoran.online

On Fri, Jan 26, 2024, at 1:28 AM, Brian Cardarella wrote:

Closed #37 https://github.com/liveview-native/live_view_native_stylesheet/issues/37 as completed.

— Reply to this email directly, view it on GitHub https://github.com/liveview-native/live_view_native_stylesheet/issues/37#event-11603654082, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAP5KINEBEKTXL3ZBIUDULYQL2C3AVCNFSM6AAAAABBUYSKD2VHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJRGYYDGNRVGQYDQMQ. You are receiving this because you were mentioned.Message ID: @.***>