Giter Club home page Giter Club logo

Comments (9)

shamblett avatar shamblett commented on August 10, 2024

Hi,

Yes, I'll do this, I'm working round my packages again at the mo, just republished Wilt and I'm working on Sporran, Ill get back round to this as soon as.

from aloha.

sethladd avatar sethladd commented on August 10, 2024

Thanks for the update!

from aloha.

shamblett avatar shamblett commented on August 10, 2024

Hi,

Looking at the dart:js library I can't see any way to bind to js events, in my code at the moment i do this

' _alohaContext.bind('aloha-editable-deactivated', _jsEditableDeactivated);

This binds the aloha-editable-deactivated event to my handling callback in Dart, how would I do this with the dart:js package and/or using it with other supporting packages?

from aloha.

sethladd avatar sethladd commented on August 10, 2024

Here's one way that might work, though I haven't tested it:

_alohaContext.callMetho('on', ['aloha-editable-deactivated'], _jsEditableDeactivated);

Maybe @justinfagnani knows of a better way?

from aloha.

shamblett avatar shamblett commented on August 10, 2024

Not quite as above, but it does work -
jsnew.JsObject _alohaContextNew = jsnew.context['Aloha'];
_jsReady() {
_ready = true;
_onReady.add(null);

};

_alohaContextNew.callMethod('bind', ['aloha-ready',_jsReady]);

OK I think I'm good to go with the conversion, I'll update Aloha to use dart:js

from aloha.

justinfagnani avatar justinfagnani commented on August 10, 2024

yep, that looks right!

from aloha.

shamblett avatar shamblett commented on August 10, 2024

OK, job done, all converted to use dart:js.

This was well worthwhile, not only have we ended up using the way we are going with js interop I've learned a lot about dart:js on the way.

This was helped by the fact the debugger allows you now to see the js side of the js proxy (JsObject), when I did this originally either the way package:js worked or the the debugger worked didn't allow me to do this, either way its much better now.

from aloha.

sethladd avatar sethladd commented on August 10, 2024

@shamblett glad to hear it! If you have a time, a blog post of your experience would be a big help to the community. Or, if you like, you can update this doc with a pull request: https://github.com/dart-lang/www.dartlang.org/tree/master/src/site/articles/js-dart-interop

We can thank @jacob314 for the debugger improvements. :)

from aloha.

justinfagnani avatar justinfagnani commented on August 10, 2024

@shamblett did you notice any size or speed improvements?

from aloha.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.