Comments (4)
Hi, there.
I'm trying to resolve a similar problem in vite-plugin-inspect
first. I'm not sure if the solution is appropriate. If you are interested in this issue, please check vite-plugin-inspect #104. ๐
from devtools-next.
description
After the vite-plugin-inspect #104 merged, I tried to resolve this issue. I made a demo to test if it can use the RPC function defined in the vite-plugin-inspect
. The code is as follows
// client/src/pages/graph.vue
async function foo() {
const hot = await getViteHotContext()
if (hot) {
createRPCClient('vite-plugin-inspect', hot, {
async moduleUpdated() {
console.log('module-update')
try {
const root = await bridgeRpc.root()
bridgeRpc.getGraph().then((res) => {
parseGraphRawData(res, root)
}).catch(e => console.log('getGraph-error', e))
}
catch (error) {
console.log('update-error', error)
}
},
})
}
}
onMounted(() => {
foo()
})
The console.log('module-update')
was triggered successfully. However, when calling the APIs of bridgeRpc
, it will result in a timeout
error and the errors are as follows:
questions
- The limit of using
bridgeRpc
, if there are some attentions that should be particularly paid to? - The
moduleUpdated
RPC function is defined in thevite-plugin-inspect
, but the RPC client available is registered with the namevite-plugin-vue-devtools
in this repo. I'm not sure usingcreateRPCClient
directly in theclient
is a more appropriate way. ๐ข
from devtools-next.
description
After the vite-plugin-inspect #104 merged, I tried to resolve this issue. I made a demo to test if it can use the RPC function defined in the
vite-plugin-inspect
. The code is as follows// client/src/pages/graph.vue async function foo() { const hot = await getViteHotContext() if (hot) { createRPCClient('vite-plugin-inspect', hot, { async moduleUpdated() { console.log('module-update') try { const root = await bridgeRpc.root() bridgeRpc.getGraph().then((res) => { parseGraphRawData(res, root) }).catch(e => console.log('getGraph-error', e)) } catch (error) { console.log('update-error', error) } }, }) } } onMounted(() => { foo() })The
## questions * The limit of using `bridgeRpc`, if there are some attentions that should be particularly paid to? * The `moduleUpdated` RPC function is defined in the `vite-plugin-inspect`, but the RPC client available is registered with the name `vite-plugin-vue-devtools` in this repo. I'm not sure using `createRPCClient` directly in the `client` is a more appropriate way. ๐ขconsole.log('module-update')
was triggered successfully. However, when calling the APIs ofbridgeRpc
, it will result in atimeout
error and the errors are as follows:
Try to add timeout: -1
to the vite-dev-rpc
option. See context:
from devtools-next.
@webfansplz timeout:-1
doesn't work. Before, I tried the original communication way of vite using server.ws.send
and import.meta.hot.on
, but the bridgeRpc
still doesn't work yet. ๐ข
from devtools-next.
Related Issues (20)
- Error: Dynamic require of "crypto" is not supported HOT 5
- "Open In Editor" needs some attention HOT 4
- Differentiate between `vue inspector` and `component tree inspector` HOT 9
- Bug(kit): parse state field types does not work as expected
- When inspecting an component, clicking on the green rectangle causes the event to propagate downwards
- When selecting the component in devtool, the select state cannot be restored after refreshing the page
- TypeError: Cannot read properties of undefined (reading 'root') HOT 7
- fail to run `dev` script in a new-cloned repo
- Add integration with Vee-Validate
- Add integration with Vee-Validate
- Add integration with @tanstack/vue-query HOT 4
- Cannot view components HOT 3
- Be compatible with the esm-only unocss.
- ๅคไธช App ๅฎไพ็ๆถๅ๏ผ็นๅป component ็ๆถๅๆฅ้ HOT 4
- After upgrading to the latest version v7.0.26, there are build exceptions.
- ๅบ่ฏฅ่ฏๅซ้กต้ขไธๆๆ็ app ๅฎไพ HOT 6
- Open component in editor opens others editor instead of VSCode HOT 3
- How to catch component's event? HOT 2
- Autofix.ci App Not Installed
- Browser Extension HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from devtools-next.