https://linen.dev logo
Join Discord
Powered by
# haxe-ui
  • b

    bright-gpu-74537

    04/23/2023, 7:48 AM
    i mean, does anyone know how hot reloading works in HL?
  • b

    bright-gpu-74537

    04/23/2023, 7:51 AM
    you defo shouldnt need hscript, that dep is long gone
  • b

    bright-gpu-74537

    04/23/2023, 7:51 AM
    unless the haxelib.json still refs it by mistake?
  • b

    bright-gpu-74537

    04/23/2023, 7:51 AM
    it doesnt
  • p

    powerful-morning-89

    04/23/2023, 8:41 AM
    It just patches functions that have changed (but closures will still use the old version of the function). I think it can also deal with things like new static variables.
  • s

    swift-action-11460

    04/23/2023, 8:43 AM
    hi.
  • s

    swift-action-11460

    04/23/2023, 8:43 AM
    i am new coder
  • s

    swift-action-11460

    04/23/2023, 8:43 AM
    what should i need to start learn first?
  • s

    swift-action-11460

    04/23/2023, 8:43 AM
    am new for coding friday night funkin mod
  • p

    powerful-morning-89

    04/23/2023, 8:49 AM
    Wrong channel, and probably wrong server too. Iirc there's a dedicated server for FNF modding somewhere.
  • b

    bright-gpu-74537

    04/23/2023, 9:09 AM
    yeah, you might have more luck in #165234904815239168, but keep in mind: > 6) Whilst we absolutely love to see new programmers getting started, we DO NOT provide support for individual games. If you are looking for support that requires knowledge of specific games like FNF (or others) you'll likely have better luck asking in their server. šŸ™‚
  • s

    swift-action-11460

    04/23/2023, 9:10 AM
    oh okay thank you šŸ™‚
  • b

    bright-gpu-74537

    04/23/2023, 9:10 AM
    so does it like, rerun function something? I mean, say i had a function goes:
    b = new Button(); b.text="A";
    and then it changes it to
    b = new Button(); b.text="B";
    then how will it know to rerun that function?
  • b

    bright-gpu-74537

    04/23/2023, 9:10 AM
    no probs... good luck! šŸ™‚
  • s

    swift-action-11460

    04/23/2023, 9:10 AM
    lf i have more problem about coding i can ask here?
  • b

    bright-gpu-74537

    04/23/2023, 9:12 AM
    #162395145352904705 is likely a better place for haxe / programming specific questions, there is also #596744553030090880 (and #502857487888809985 ), this channel is generally for haxeui (a framework) type questions
  • s

    swift-action-11460

    04/23/2023, 9:12 AM
    oh ok
  • p

    powerful-morning-89

    04/23/2023, 9:13 AM
    It doesn't. Rerunning things that need to be rerun is up to the dev. The reason why hotreloading just works in eg Flutter, is because Flutter is designed to support hot reloading.
  • b

    bright-gpu-74537

    04/23/2023, 9:14 AM
    so i dont get it then, how would / could hot loading work, it sounds like the main thing it could do is if you had a, say, button handler, and changed the code, then hot reloading would work in that handler?
  • b

    bright-gpu-74537

    04/23/2023, 9:15 AM
    is there any sort of event or something that HL spits out when something has changed?
  • p

    powerful-morning-89

    04/23/2023, 9:16 AM
    You're supposed to invoke a native function at the end of each frame which returns
    true
    if a hot reload has happened.
  • b

    bright-gpu-74537

    04/23/2023, 9:17 AM
    oooooohhhh...
  • b

    bright-gpu-74537

    04/23/2023, 9:18 AM
    so thats probably all quite doable then really, just need to sort of "be clever" and reload the components when a reload has happened
  • p

    powerful-morning-89

    04/23/2023, 9:33 AM
    The main problem is that HaxeUI's design is not very hot-reload friendly. Eg the layout is usually built once in a constructor or a main function or something, and there's not really a way for haxeui to call that again when a hot reload has happened. By contrast Flutter has a mostly stateless design, eg:
    Copy code
    dart
    void main() => runApp(MyApp());
    
    class MyApp extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        return const Center(child: Text('Hello', textDirection: TextDirection.ltr));
      }
    }
    When a hot reload happens here, the Flutter runtime can just rebuild the entire widget tree behind the scenes.
  • b

    bright-gpu-74537

    04/23/2023, 9:35 AM
    > Eg the layout is usually built once in a constructor or a main function or something but this could be moved out of the constructor into a separate function, and that could be called in the constructor, no?
  • p

    powerful-morning-89

    04/23/2023, 9:36 AM
    Yes.
  • r

    refined-greece-48002

    04/23/2023, 10:46 AM
    Essentially I'm just un-initializing and re-initializing my whole UI manually whenever it detects the hot reload
  • r

    refined-greece-48002

    04/23/2023, 10:47 AM
    but a lot of the time changing code in `@:bind`'d functions will make the hot reload crash everything pretty brutally
  • r

    refined-greece-48002

    04/23/2023, 10:47 AM
    like, corrupt characters in the stack trace, vscode acting like there are breakpoints where there aren't level brutal :D
  • p

    powerful-morning-89

    04/23/2023, 10:56 AM
    That sounds like a nice case of memory corruption.
1...164316441645...1687Latest