liveview-native / live_view_native

A framework for building native applications with Phoenix LiveView
https://native.live/
MIT License
576 stars 23 forks source link

Issue with wording #112

Closed AZholtkevych closed 8 months ago

AZholtkevych commented 8 months ago
Slack discussion (https://dockyard.slack.com/archives/C02E1GA5THB/p1704820362221439):
Getting a stylesheet bug
No parser found for `:swiftui`
    (live_view_native_stylesheet 0.2.0-rc.1) expanding macro: LiveViewNative.Stylesheet.__using__/1
    #cell:eu6fsifwxg3jvq77:2: MySheet (module)
    (elixir 1.15.6) expanding macro: Kernel.use/2
    #cell:eu6fsifwxg3jvq77:1: (file)
I have the following config:
Mix.install(
  [
    {:kino_live_view_native, "0.2.0-rc.1"}
  ],
  config: [
    live_view_native: [plugins: [LiveViewNative.SwiftUI]],
    live_view_native_style_sheet: [parsers: [swiftui: LiveViewNative.SwiftUI.RulesParser]],
    phoenix_template: [
      format_encoders: [
        swiftui: Phoenix.HTML.Engine
      ]
    ]
  ]
)

KinoLiveViewNative.start([])
I think I'm setting the parser correctly :thinking_face: Going to try this in a non-livebook environment to see if it still happens. If anyone sees the issue I'd appreciate a pointer! :slightly_smiling_face:
THREAD:
Carson Katri
  [8 minutes ago](https://dockyard.slack.com/archives/C02E1GA5THB/p1704820406536949?thread_ts=1704820362.221439&cid=C02E1GA5THB)
Try live_view_native_style_sheet -> live_view_native_stylesheet
Brooklin Myers
  [7 minutes ago](https://dockyard.slack.com/archives/C02E1GA5THB/p1704820466775299?thread_ts=1704820362.221439&cid=C02E1GA5THB)
:man-facepalming: That's going to be it.

Brooklin Myers
  [12:16 PM](https://dockyard.slack.com/archives/C02E1GA5THB/p1704820608288789)
[@alex.zholtkevych](https://dockyard.slack.com/team/U04AHJJTRGC)
 can you create an issue? Looks like we have an unfinished sentence on our live_view_native_stylesheet docs.
I have no stones to throw, 
[@Carson Katri](https://dockyard.slack.com/team/U04FLNQF8P4)
 caught the exact same thing on my content last week :sweat_smile:
https://files.slack.com/files-pri/T024L9T6N-F06CX6F3Y4W/screenshot_2024-01-09_at_12.15.15___pm.png
THREAD:
Brooklin Myers
  [5 minutes ago](https://dockyard.slack.com/archives/C02E1GA5THB/p1704820699533409?thread_ts=1704820608.288789&cid=C02E1GA5THB)
Also I think the examples are out of date. The following code:
  def class("star-red", _target) do
    ~RULES"""
    background(alignment: .leading){:star-red}
    """
  end
Gives the following error:
** (SyntaxError) styling-and-customizing-views.livemd#cell:eu6fsifwxg3jvq77:35: Unsupported input:
   |

   |

Expected a modifier name, but got '{:star-red}'

alex.zholtkevych
  [4 minutes ago](https://dockyard.slack.com/archives/C02E1GA5THB/p1704820735996289?thread_ts=1704820608.288789&cid=C02E1GA5THB)
Should I assign to 
[@Carson Katri](https://dockyard.slack.com/team/U04FLNQF8P4)
?

Carson Katri
  [4 minutes ago](https://dockyard.slack.com/archives/C02E1GA5THB/p1704820744233579?thread_ts=1704820608.288789&cid=C02E1GA5THB)
Probably 
[@bcardarella](https://dockyard.slack.com/team/U024L9T6Q)
 or 
[@Nduati Kuria](https://dockyard.slack.com/team/U0623D3RFMJ)

alex.zholtkevych
  [4 minutes ago](https://dockyard.slack.com/archives/C02E1GA5THB/p1704820774197269?thread_ts=1704820608.288789&cid=C02E1GA5THB)
OK, will do that on LVN board, not LVN SwiftUI

bcardarella
  [1 minute ago](https://dockyard.slack.com/archives/C02E1GA5THB/p1704820913882779?thread_ts=1704820608.288789&cid=C02E1GA5THB)
I'm in a meeting, I'll follow up after

Carson Katri
  [< 1 minute ago](https://dockyard.slack.com/archives/C02E1GA5THB/p1704820962412139?thread_ts=1704820608.288789&cid=C02E1GA5THB)
[@Brooklin Myers](https://dockyard.slack.com/team/U02SW830GSY)
 I think the syntax there should be background(alignment: .leading, content: :"star-red")
If you get the latest version of the LVN VS Code extension, you can get autocomplete for the modifiers. (edited)
bcardarella commented 8 months ago

I don't believe this is still valid.