developit / developit/microbundle

Add `x_google_ignoreList` (Ignore-listing code) support to sourcemaps

Đang mở
#1,066 9 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
8.1k
Fork
358
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Introduce the `x_google_ignoreList` extension in the sourcemaps generated by this project. This will facilitate a more streamlined debugging experience in Chrome (and other supporting browsers) by automatically filtering out framework and dependency code.

## Benefit

Implementing `x_google_ignoreList` in the sourcemaps will align this project with modern web development practices, offering a more focused and efficient debugging experience for developers using Chrome DevTools. This change will particularly benefit those who regularly engage in debugging complex applications with numerous dependencies.

## Background Context

- https://developer.chrome.com/blog/devtools-modern-web-debugging/#just-my-code
- > The ignore-listing is enabled by populating an extra `x_google_ignoreList` field in the source map that Angular generates when compiling the project. The Chrome DevTools team encourages other framework authors to implement a similar change. Refer to the [Case Study: Better Angular Debugging with DevTools](https://developer.chrome.com/blog/devtools-better-angular-debugging/) post for more details.
- https://developer.chrome.com/blog/devtools-better-angular-debugging/#ignore-listing-code
- > **Ignore-listing code**
> When debugging applications using Chrome DevTools, authors generally only want to see just their code, not that of the framework underneath or some dependency tucked away in the node_modules folder.
>
> To achieve this, the DevTools team has introduced an extension to [source maps](https://developer.chrome.com/blog/sourcemaps/), called `x_google_ignoreList`. This extension is used to identify third-party sources such as framework code or bundler-generated code. When a framework uses this extension, authors now automatically avoid code that they don't want to see or step through without having to manually configure this beforehand.
>
> The `x_google_ignoreList` source map extension is supported by Chrome DevTools starting with Chrome 106.
- https://developer.chrome.com/articles/x-google-ignore-list/
- > The ignoreList source map extension
>
> Improve debugging experience in Chrome DevTools with the `ignoreList` source map extension.

> - https://developer.chrome.com/blog/new-in-devtools-120/#ignore-list-spec
> - > The [source maps specification](https://sourcemaps.info/spec.html) has [adopted](https://github.com/tc39/source-map-spec/pull/19) the `ignoreList` field instead of `x_google_ignoreList` and DevTools now supports the new name with a fallback for the old one. Frameworks and bundlers can now use the new field name.
>
> _Originally posted by @0xdevalias in https://github.com/facebook/react/issues/27774#issuecomment-1836969520_

- https://tc39.es/source-map-spec/#ignorelist

## See Also

- https://github.com/facebook/react/issues/27774
- https://github.com/markerikson/react-prod-sourcemaps/issues/19
- https://github.com/vercel/next.js/issues/41370
- https://github.com/vercel/next.js/discussions/41371
- https://github.com/vuejs/rfcs/discussions/607
- https://github.com/sveltejs/svelte/issues/9740
- https://github.com/angular/angular-cli/pull/23545
- https://nuxt.com/blog/v3-3#better-logging-in-browser-devtools
- https://github.com/nuxt/nuxt/pull/19243
- https://vitejs.dev/config/server-options.html#server-sourcemapignorelist
- https://github.com/vitejs/vite/pull/12174
- https://github.com/vitejs/vite/pull/12633
- https://github.com/vitejs/vite/pull/12694
- https://rollupjs.org/configuration-options/#output-sourcemapignorelist
- https://github.com/rollup/rollup/issues/4847
- https://github.com/rollup/rollup/pull/4846
- https://github.com/rollup/rollup/pull/4848
- https://github.com/rollup/rollup/pull/4926
- https://github.com/Rich-Harris/magic-string/issues/241
- https://github.com/Rich-Harris/magic-string/pull/240
- https://github.com/Rich-Harris/magic-string/pull/243

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

The issue names no files, tests, or entry points. Start by tracing how microbundle delegates sourcemap generation to Rollup, then compare the generated maps with the source-map ignoreList specification. Done means generated sourcemaps identify framework or dependency sources through the requested ignore-list field, with coverage for the relevant output paths.

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

Đánh giá

Công nghệ
javascript, rollup
Lĩnh vực
build-system
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

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.