question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New bundling strategy makes it impossible to debug and apply patches

See original GitHub issue

Hi folks!

Congrats on the 4.0.0 release 🥳 🎈

We’ve been upgrading our codebase, and we’re coming across a handful of issues. We’ve managed to get to the bottom of most of them, but we’re no longer able to debug in the same way that we were able to previously.

I believe that this is result of two significant changes:

Issue 1

First, the React Admin output is minified.

In v3, the code was transpiled down from TS to JS,with little or no other code transformation being applied. Since v4 the code is also being minified, which causes a lot of problems with debugging.

No longer can we jump into our node_modules and run debuggers and logs to observe what’s happening with our code. It also means that it’s impossible to use tools like patch-package to make any small bug fixes that may not be addressed until future versions of RA.

I believe that minification is an application-level concern, and library authors shouldn’t need to perform this step. It’s up to developers to decide on how they want to bundle their code for deployment. It makes a lot of sense to revert this change, though I’m also interested to hear what the benefits are of this new approach.

Issue 2

The other issue, which may have just been a little oversight is that we’re no longer able to click on an export to get directed to the source code, instead, it’s reverted to taking us to the types again.

I don’t think that I’ll be able to replicate this via a CodeSandbox, but I’ll whip up a before/after video

Before

image

After

Shows what the output of the ESM bundle looks like image

Edit:

Removing --minify from the build script prevents the output from being minified, which is good, but keeps the entire output contained in a single index.js file. Are there code splitting concerns to be had with compiling the entire output into a single file?

Other information:

Environment

  • React-admin version:
  • Last version that did not exhibit the issue (if applicable):
  • React version:
  • Browser:
  • Stack trace (in case of a JS error):

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
djhicommented, Apr 27, 2022

FYI, the src directory is still included in the packages. Can’t you configure your bundler and patch-package to use it?

1reaction
djhicommented, Apr 25, 2022

Those are good points, thank you for reporting them. I’ll discuss with the team to see what we can do

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debug a JavaScript or TypeScript app - Visual Studio (Windows)
Visual Studio provides support for debugging JavaScript and TypeScript apps in Visual Studio.
Read more >
Shrink, obfuscate, and optimize your app - Android Developers
If your debug symbols footprint is too large, use SYMBOL_TABLE instead of FULL to decrease the file size. If your project builds an...
Read more >
9 Running and Debugging Java Application Projects
To run the application outside of the IDE, you must first use the Clean and Build command so that the project's JAR file...
Read more >
Best practices for tracing and debugging microservices - Raygun
This term describes how application code is compiled and delivered. Monoliths are compiled and/or packaged into a single binary, or a bundle ......
Read more >
Elastic Beanstalk rolling environment configuration updates
Use AWS Elastic Beanstalk to apply configuration changes that require instances ... In a rolling update, each batch of instances is terminated before...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found