sveltejs / svelte

web development for the rest of us
https://svelte.dev
MIT License
80.31k stars 4.28k forks source link

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

Open 0xdevalias opened 1 year ago

0xdevalias commented 1 year ago

Describe the problem

Currently, while debugging applications using Chrome DevTools, developers often face the challenge of navigating through not only their own code but also through extensive third-party library or framework code. This situation arises particularly in projects with complex structures and numerous dependencies, leading to a cumbersome and time-consuming debugging process.

Describe the proposed solution

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

Alternatives considered

1. Manual Filtering in Chrome DevTools:

The first alternative involves the use of manual filtering within Chrome DevTools. This method requires developers to individually specify scripts or code segments to be skipped during debugging. While this provides a basic level of control, it is inefficient and time-consuming, particularly in larger projects with numerous dependencies. Each developer must set up these filters, leading to inconsistent experiences and increased setup time for each debugging session.

2. Community Plugins or Extensions:

Another option is to use community-developed plugins or extensions that offer functionality similar to x_google_ignoreList. This approach could be a quick fix, providing an interim solution without requiring significant development effort from our team. However, it depends heavily on the reliability and continued support of these third-party solutions. There's also a risk of these plugins not being fully compatible with all versions of Chrome or other browsers, and they may not integrate as seamlessly as a native solution would.

Evaluation of Alternatives:

Conclusion:

While both of these alternatives offer some benefits, they fall short in terms of efficiency, consistency, and reliability compared to the proposed implementation of x_google_ignoreList in our sourcemaps. The native integration of x_google_ignoreList with Chrome DevTools ensures a more streamlined and uniform debugging experience, aligning our project with modern web development practices.

Importance

would make my life easier

See Also

0xdevalias commented 1 year ago

Originally posted by @0xdevalias in https://github.com/facebook/react/issues/27774#issuecomment-1836969520