Feature: Set UI panel defaults from the Plugin
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
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ả
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
- Follow our Code of Conduct
- Read the Contributing Guide.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
- 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
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của vitejs/devtools
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
vitejs/devtools#589 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Rolldown "Run build with devtools" produces a development build (inherits the dev server's NODE_ENV)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
vitejs/devtools#261 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
feat(oxc): add rule timing stats to the lint inspectorCó thể đã có người làm @yuyinws đã nhận 8 ngày trước. Đang mởenhancement
vitejs/devtools#584 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
pending triage
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của vitejs/devtools
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
rohitg00/agentmemory#1428 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
boxlite-ai/boxlite#1729 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Detect Deno tasks from deno.jsonĐang mởdetectors enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
SM260845/readme-gen#1 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
angular/angularfire#3774 ·
Maintainer thường phản hồi trong vòng 2 ngày