emmanuelantony2000 / valerie

Rust front-end framework for building web apps
Apache License 2.0
336 stars 10 forks source link

input_state example is not showing the value #9

Open davnav opened 4 years ago

davnav commented 4 years ago

Describe the bug I was running the input_state example , but it's not showing the value in browser when I type in text box. ( attached screenshot)

To Reproduce Steps to reproduce the behavior:

  1. git clone the latest version as of 26th July 2.go to input_state example and create a static folder and insert the html. <!doctype html>

    Title
  2. run miniserve and go to http://127.0.0.1:8080/static/index.html

  3. type the text box with some characters.

  4. I thought it will be reflecting value , but its not. input_state_example

emmanuelantony2000 commented 4 years ago

I'll look into it asap. Found the bug, there is only one closure for a callback have to replace it with a Vec. It should fix it.

davnav commented 4 years ago

Thank you for the update. I wish I could debug it. How are you debugging it ? with rust-with-dgb ot lldb ?

On Tue, Jul 28, 2020 at 11:21 AM Emmanuel Antony notifications@github.com wrote:

I'll look into it asap. Found the bug, there is only one closure for a callback have to replace it with a Vec. It should fix it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/emmanuelantony2000/valerie/issues/9#issuecomment-665199685, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKAUNDKMZP72J5R2ETMQVDR54JI5ANCNFSM4PIA4TTQ .

-- Thanks&Regards, Naveen Davis

emmanuelantony2000 commented 4 years ago

You can use the debug crate feature in Valerie itself to get more debug info. Or you can use console_error_panic_hook manually to get a stack trace with more options.

davnav commented 4 years ago

Thanks.. I am getting this error(attached) screen . is there anyway to get Rust function or more details to debug ?

emmanuelantony2000 commented 4 years ago

I used the debug feature with one of the examples, providing an explicit panic! in one of the callback methods and I got this result.

Screenshot 2020-08-07 at 10 04 50 AM

I patched up the issue, just have to push it with some improvements to the event system.

emmanuelantony2000 commented 4 years ago

Issue was partially, patched up, but I didn't push it because I think there is more to be done.

To explain the patch in simple terms, CallbackMap will have a String, and then a Vec<Rc<...>>. But when some node removes a listener which one of them to be removed and some identity of the Rc<...> was required. Something like index or an address.