Code Monkey home page Code Monkey logo

Comments (4)

DanTup avatar DanTup commented on June 18, 2024

This is tricky.. We only show it when the service.reloadSources service is available, however Flutter web pretends that Hot Reload is available and hot restarts.

It would be better IMO if the extension doesn't need to make assumptions about which devices on which SDKs pretend to support hot restart but don't (Dart-Code versions are quite independent of SDK versions) - it feels like adding technical debt. It would be better if we use the existing mechanisms (presence of services) to know when the functionality is available and if the rules every change, nothing needs updating in Dart-Code (and therefore older versions of Dart-Code would also behave as expected).

There were some comments about this at flutter/flutter#39950 (comment) but I don't think I entirely understand the reasons.

from dart-code.

jacob314 avatar jacob314 commented on June 18, 2024

Fyi @elliette. We should stop pretending we support hot reload when we don't on the web. I didn't realize we were pretending as DevTools makes it look like it is able to accurately detect that the web doesn't support hot reload.

from dart-code.

DanTup avatar DanTup commented on June 18, 2024

I was only thinking about Flutter when I wrote the above, but now I'm wondering if we have a similar but slightly different issue for non-Flutter web, because the condition there is different (for non-Flutter, we assume the VM always has the VM Service's reload service.. but maybe that's also untrue for non-Flutter web).

So for Flutter web, I think we shouldn't register the reloadSources service, but for non-Flutter maybe we're lacking a way to know if Hot Reload is available. Dart-Code doesn't really distinguish between a Dart VM or DWDS, and assumes for a Dart (non-Flutter) project we can call reloadSources without any service explicitly being registered (since the Dart VM does not register a service for it, it's just a native method).

from dart-code.

elliette avatar elliette commented on June 18, 2024

My understanding based on the comments in flutter/flutter#39950, it seems like this was originally done to support Flutter's r hot-key on web (which normally triggers a hot-reload but for web triggers the hot-restart).

@yjbanov is this correct? I wonder if it would make sense to support r triggering hot-restart, without registering reloadSources for web.

from dart-code.

Related Issues (20)

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.