Giter VIP home page Giter VIP logo

react-prod-sourcemaps's Issues

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

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

See Also

Tangentially related issues for improving modern debugging support:

[ERR_REQUIRE_ESM]: require() of ES Module when using CJS

Seems that we have an error originating from yargs when importing the package in CJS

Error [ERR_REQUIRE_ESM]: require() of ES Module /home/runner/work/sentry/sentry/node_modules/string-width/index.js from /home/runner/work/sentry/sentry/node_modules/jest-cli/node_modules/cliui/build/index.cjs not supported. 
Instead change the require of index.js in /home/runner/work/sentry/sentry/node_modules/jest-cli/node_modules/cliui/build/index.cjs to a dynamic import() which is available in all CommonJS modules.     

at Object.<anonymous> (/home/runner/work/sentry/sentry/node_modules/jest-cli/node_modules/cliui/build/index.cjs:291:21)    
at Object.<anonymous> (/home/runner/work/sentry/sentry/node_modules/jest-cli/node_modules/yargs/build/index.cjs:1:59901)    
at Object.<anonymous> (/home/runner/work/sentry/sentry/node_modules/jest-cli/node_modules/yargs/index.cjs:5:30)     
at _yargs (/home/runner/work/sentry/sentry/node_modules/jest-cli/build/run.js:30:39)     
at buildArgv (/home/runner/work/sentry/sentry/node_modules/jest-cli/build/run.js:143:26)     
at Object.run (/home/runner/work/sentry/sentry/node_modules/jest-cli/build/run.js:118:24)     
at Object.<anonymous> (/home/runner/work/sentry/sentry/scripts/test.js:27:6)

feat: sourcemaps for react-dom/profiling

We currently do not provide sourcemaps for react-dom/profiling bundle. It would be useful if we could provide these as they might be used by a lot of folks + the current remapping behavior is slightly confusing. e.g. I only noticed this after using strict mode in our webpack build step at Sentry and have it throw and error before I noticed a webpack resolve alias for react-dom to react-dom/profiling...

@markerikson iirc you mentioned we could add these somewhat trivially? I would be happy to look into building these and checking them into the repo, wdyt?

Bundling doesn't seem to be right

When trying to integrate the Vite plugin, I get this error:

webclient on  update-react-sourcemaps-tool [!] via  v18.16.0 
❯ pnpm build

> [email protected] build /Users/calebjasik/Git/defined.net/webclient
> vite build && pnpm post-build

failed to load config from /Users/calebjasik/Git/defined.net/webclient/vite.config.ts
error during build:
file:///Users/calebjasik/Git/defined.net/webclient/vite.config.ts.timestamp-1694618874841-ea67fb622aaf5.mjs:3
import { ViteReactSourcemapsPlugin } from "file:///Users/calebjasik/Git/defined.net/webclient/node_modules/.pnpm/@[email protected]_patch_hash=jpyptpvw6t3tnchzyqe4intg7m/node_modules/@acemarke/react-prod-sourcemaps/lib/index.js";
         ^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Named export 'ViteReactSourcemapsPlugin' not found. The requested module 'file:///Users/calebjasik/Git/defined.net/webclient/node_modules/.pnpm/@[email protected]_patch_hash=jpyptpvw6t3tnchzyqe4intg7m/node_modules/@acemarke/react-prod-sourcemaps/lib/index.js' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'file:///Users/calebjasik/Git/defined.net/webclient/node_modules/.pnpm/@[email protected]_patch_hash=jpyptpvw6t3tnchzyqe4intg7m/node_modules/@acemarke/react-prod-sourcemaps/lib/index.js';
const { ViteReactSourcemapsPlugin } = pkg;

    at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)
 ELIFECYCLE  Command failed with exit code 1.

webclient on  update-react-sourcemaps-tool [!] via  v18.16.0 
❯ 

which matches the errors described in https://arethetypeswrong.github.io/?p=%40acemarke%2Freact-prod-sourcemaps%400.0.5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.