Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make module update reactive by rpc functions #104

Merged
merged 2 commits into from
Jan 23, 2024

Conversation

LoTwT
Copy link
Contributor

@LoTwT LoTwT commented Jan 23, 2024

Description

This PR is to make module update reactive by rpc functions.

The original issue is devtools-next #177. It is expected that after loading lazy-load resources, eg. changing routes with vue-router, the Graph.vue should update in real-time which is powered by vite-plugin-inspect.

This plugin has a similar problem.

What I do in this PR

  • add vue-router in the playground to match the repro
  • add a simple middleware in vite dev server which is used for checking if some new resources will be loading ( ❗❗❗I'm not sure if it's an appropriate way to do this. )
  • add a new moduleUpdated rpc function for server and client communication and trigger refetch in client-side

Check procedures

  • nr dev:client
  • cd playground && nr dev
  • click the RouterLink Other to load a laze-load resource
  • Other.vue will show on the /__inspect in real-time

Linked Issues

Additional context

@antfu antfu merged commit 662c262 into antfu-collective:main Jan 23, 2024
@LoTwT LoTwT deleted the reactive-module-update branch January 23, 2024 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants