Giter Club home page Giter Club logo

Comments (6)

cexbrayat avatar cexbrayat commented on June 9, 2024

Hi @webfansplz !

IIRC we just use the COMPONENT_EMIT event to know if an event has been emitted. I don't think we are tied to an implementation of the devtools: we just subscribe to the events emitted by the framework for the devtools. But maybe I'm misunderstanding what you are looking for?

from test-utils.

webfansplz avatar webfansplz commented on June 9, 2024

Hi @webfansplz !

IIRC we just use the COMPONENT_EMIT event to know if an event has been emitted. I don't think we are tied to an implementation of the devtools: we just subscribe to the events emitted by the framework for the devtools. But maybe I'm misunderstanding what you are looking for?

Hi @cexbrayat !

This is because calling setDevtoolsHook actually overrides the initialization of devtools. See: https://github.com/vuejs/core/blob/HEAD/packages/runtime-core/src/devtools.ts#L52-L53

from test-utils.

cexbrayat avatar cexbrayat commented on June 9, 2024

Ha OK I understand now 👍

Well TBH, I'm not a fan of adding an option to mount just to test the devtools. Maybe we can find another solution?

from test-utils.

webfansplz avatar webfansplz commented on June 9, 2024

Ha OK I understand now 👍

Well TBH, I'm not a fan of adding an option to mount just to test the devtools. Maybe we can find another solution?

I thought maybe we could add an extra judgment, if globalThis.__VUE_DEVTOOLS_GLOBAL_HOOK__ is already defined (see: https://github.com/vuejs/core/blob/HEAD/packages/runtime-core/src/renderer.ts#L340-L341), we could implement the subscription by overriding its emit method without overwriting the original devtools definition.

from test-utils.

cexbrayat avatar cexbrayat commented on June 9, 2024

Yeah maybe that could work 👍

from test-utils.

webfansplz avatar webfansplz commented on June 9, 2024

Yeah maybe that could work 👍

Thank you, I'll submit a PR to support it.

from test-utils.

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.