https://linen.dev logo
Join Discord
Powered by
# coconut-tink
  • l

    little-activity-86808

    03/23/2023, 11:11 AM
    ok cool
  • I am afraid I am not understanding that ๐Ÿ˜‚
    c

    cool-psychiatrist-49311

    03/29/2023, 10:30 PM
    I am afraid I am not understanding that ๐Ÿ˜‚
  • haha, ok, later I'll post some code ๐Ÿ˜
    l

    little-activity-86808

    03/30/2023, 9:52 AM
    haha, ok, later I'll post some code ๐Ÿ˜
  • Hey ya, I am doing my portfolio in coconut and I face an issue I have an object A that have a function that returns a RenderResult as it uses hxx And in object B I would like to be able to use the result of that function in a render function Something like: ```js function render() { return hxx(<div> {a.display()} </div>; } ``` With a of type A but I get as an error that it should be a string Any idea on how to convert that render result to a string? Or use RenderResult directly? Thanks๐Ÿ˜
    n

    numerous-oil-90946

    03/31/2023, 4:19 PM
    Hey ya, I am doing my portfolio in coconut and I face an issue I have an object A that have a function that returns a RenderResult as it uses hxx And in object B I would like to be able to use the result of that function in a render function Something like:
    Copy code
    js
    function render() {
        return hxx(<div>
            {a.display()}
        </div>;
    }
    With a of type A but I get as an error that it should be a string Any idea on how to convert that render result to a string? Or use RenderResult directly? Thanks๐Ÿ˜
  • It was a mistake from me, just my children attribute had String type, sorry for this ๐Ÿ˜…
    n

    numerous-oil-90946

    04/03/2023, 7:28 AM
    It was a mistake from me, just my children attribute had String type, sorry for this ๐Ÿ˜…
  • m

    melodic-guitar-37597

    04/14/2023, 10:11 AM
    (How) are you using MVCoconut? (see below)
  • a

    ambitious-knife-25690

    04/14/2023, 10:29 AM
    we have a /poll command ๐Ÿ˜„
  • m

    melodic-guitar-37597

    04/14/2023, 10:36 AM
    Ah, thanks!
  • a

    astonishing-jordan-99718

    04/28/2023, 10:41 AM
    @melodic-guitar-37597
  • t

    thousands-house-41767

    05/15/2023, 3:31 PM
    Hi! Quick question regarding tink_web and particulary the remote proxyโ€ฆ Is there a way to write an implementation and have the "headers" (interface) auto-generated to use on the client-side?
  • c

    cool-musician-79004

    05/16/2023, 5:24 AM
    Hello. Is tink_validation not possible to be used with types already defined? like this?
    Copy code
    haxe
    typedef IncomingMessage = {
      final event:String;
      final context:String;
      final payload:{
        final coordinates:{
          final column:Int;
          final row:Int;
        };
        final isInMultiAction:Bool;
        final settings:{
          final id:String;
          final remoteServer:String;
        };
      };
    };
    
    function parseMessage(message:String):IncomingMessage {
      final parsed = hammerspoon.Json.decode(message);
      final value:IncomingMessage = Validation.extract(parsed);
    }
    Gives me the following errors:
    Copy code
    /usr/local/lib/haxe/lib/tink_validation/0,2,0/src/tink/validation/macro/Macro.hx:44: characters 35-47 : Class<tink.validation.macro.GenExtractor> should be tink.typecrawler.GeneratorProvider
    /usr/local/lib/haxe/lib/tink_validation/0,2,0/src/tink/validation/macro/Macro.hx:44: characters 35-47 : ... For function argument 'gen'
    /usr/local/lib/haxe/lib/tink_validation/0,2,0/src/tink/validation/macro/Macro.hx:78: characters 35-47 : Class<tink.validation.macro.GenValidator> should be tink.typecrawler.GeneratorProvider
    /usr/local/lib/haxe/lib/tink_validation/0,2,0/src/tink/validation/macro/Macro.hx:78: characters 35-47 : ... For function argument 'gen'
    src/streamDeckButton/Messages.hx:63: characters 52-58 : Unknown<0> cannot be constructed
  • c

    cool-psychiatrist-49311

    05/23/2023, 1:40 AM
    nope, why would you want that? You can just use the implementation class for the remote
  • c

    cool-psychiatrist-49311

    05/23/2023, 1:41 AM
    You can write a macro to convert the impl classes into interface, that should be quite simple.
  • c

    cool-psychiatrist-49311

    05/23/2023, 1:41 AM
    But if you intention is to avoid referencing server-side code and libraries from the client side that macro approach won't work either
  • c

    cool-psychiatrist-49311

    05/23/2023, 1:42 AM
    You will have to have a separate script to generate the interface files but in that case you will have to run that script manually
  • t

    thousands-house-41767

    05/23/2023, 8:11 AM
    Waitโ€ฆ can I directly use the implementation class?
  • c

    cool-psychiatrist-49311

    05/23/2023, 9:25 AM
    Yes you can
  • c

    cool-musician-79004

    05/23/2023, 2:51 PM
    I think tink_cli is not capable of handling Options?
    Copy code
    haxe
      @:flag('-main')
      public var main:Option< String > = None;
    Copy code
    src/gum/Main.hx:16: characters 3-43 : tink.Stringly should be haxe.ds.Option<String>
  • c

    cool-musician-79004

    05/23/2023, 2:58 PM
    Also, I don't know why I get this warnings just with the most basic example:
    Copy code
    /usr/local/lib/haxe/lib/tink_cli/git/src/tink/cli/Macro.hx:216: characters 12-34 : Warning : use Future.irreversible() - or better yet: new Future()
    /usr/local/lib/haxe/lib/tink_cli/git/src/tink/cli/prompt/RetryPrompt.hx:30: characters 5-17 : Warning : use Future.irreversible() - or better yet: new Future()
  • c

    cool-psychiatrist-49311

    05/24/2023, 12:31 PM
    Yup I think only primitives and their array
  • c

    cool-musician-79004

    05/24/2023, 4:36 PM
    Null works. Will it be possible to allow that for arrays too?
  • c

    cool-psychiatrist-49311

    05/24/2023, 9:43 PM
    I think you can just expect empty array when user does not specify any values
  • c

    cool-musician-79004

    05/25/2023, 7:13 AM
    Then why the example uses null as initial value?
  • c

    cool-psychiatrist-49311

    05/25/2023, 10:56 AM
    iirc providing a initialization expression
    = null
    would make that flag optional
  • c

    cool-musician-79004

    05/25/2023, 4:58 PM
    Ok, then I'm in a dead end in terms of null safety. If I want them to be not optional, I need to not set them, but then it is not null safe...
  • c

    cool-musician-79004

    05/25/2023, 6:12 PM
    Ah ok, that works pretty fine
  • c

    cool-psychiatrist-49311

    05/27/2023, 2:42 AM
    I am not very sure but I guess you can put
    = []
    instead?
  • c

    cool-musician-79004

    05/27/2023, 12:29 PM
    Yes, that seems to be valid
  • c

    cool-musician-79004

    05/27/2023, 12:30 PM
    I really like it asks for the missing required arguments
  • c

    cool-musician-79004

    05/27/2023, 12:30 PM
    Is it possible to have subcommands ?