Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Feature: Set UI panel defaults from the Plugin

Đang mở
#532 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
38/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
typescript, vite
Lĩnh vực
devtools, tooling

Hướng nghiên cứu

Bắt đầu với điểm vào DevTools({ ... }) được hiển thị trong vite.config.ts, sau đó truy vết cách các tùy chọn UI, phím tắt và context window.VITE_DEVTOOLS_CLIENT_CONTEXT đến được panel. Xác định ranh giới tùy chọn mặc định được hỗ trợ và cách các instance mới hoặc có storage đã bị xóa áp dụng ranh giới đó; hoàn thành có nghĩa là các giá trị mặc định UI do plugin cung cấp hoạt động mà không cần thiết lập panel thủ công.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement
Clear and concise description of the problem

Not being able to define the UI defaults for the devtools panel in such a way that can live in your codebase- means that every fresh instance needs a developer to go into the panel and setup those desired codebase defaults, before any actual dev-server usage can properly happen.

This stemmed from me wanting to disable the default Cmd + K global keyboard trigger and figuring out that such a thing had to be manually done by every dev on the team in across their browsers. This becomes worse if you are using worktrees and launching the dev server and passing in the --port flag since you'd need to go through all this again.

Also, as someone who needs to regularly clear their web storage, for clean runs - its becoming annoying that this needs to keep being done.

Suggested solution

I think having an object in the vite plugin for setting the default UI options would make sense.

Something like:

// vite.config.ts
import { DevTools } from '@vitejs/devtools'
import Inspect from 'vite-plugin-inspect'
import { defineConfig } from 'vitest/config'

export default defineConfig(() => {
  return {
    plugins: [
      DevTools({
        // like this
        uiOptions: {
          shortcuts: {
            open:  "Cmd+K"
          }
        }
      }),
      Inspect(),
    ],
  }
})
Alternative

I think TanStack Devtools gets around this by having the devtools be a component that's mounted into the framework's tree, so that means the defaults are set on the component itself - <Devtools config={{ openHotkey: [] }} />. This wouldn't make sense here since the devtools are injected in by vite and not by the UI-framework.

You could try and hack something in by having a dev-only script be fired to check for window.__VITE_DEVTOOLS_CLIENT_CONTEXT__ and if so try and work with that - but this definitely feels like a hack/work-around.

Additional context

No response

Validations
Ngôn ngữ chính
TypeScript
Star
1.2k
Fork
91
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
21

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của vitejs/devtools

Tất cả issue của vitejs/devtools

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.