-
Notifications
You must be signed in to change notification settings - Fork 774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve source map support #3739
Conversation
🦋 Changeset detectedLatest commit: 513ab63 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/5860269554/npm-package-wrangler-3739 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/5860269554/npm-package-wrangler-3739 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/5860269554/npm-package-wrangler-3739 dev path/to/script.js Additional artifacts:npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/5860269554/npm-package-cloudflare-pages-shared-3739 Note that these links will no longer work once the GitHub Actions artifact expires. |
Hey! 👋 Thank you opening this PR! This looks like a big improvement in developer experience. 😃 Would you be able to take a look at the failing checks? |
f4c7334
to
f97228c
Compare
I fixed the lint issues, but the only failed test that I see is a timeout issue. |
We probably don't want the changeset for |
f97228c
to
af17af7
Compare
af17af7
to
513ab63
Compare
That's a good point, I removed it. |
Looks like the |
Hey again! 👋 |
The |
For me (on MacOS, Wrangler 3.9.0), the stacktraces are from the caches folder. Not super helpful:
|
Hey @ssttevee! 👋 The breakpoint debugging work is now pretty much complete. As part of this, we simplified and improved lots of our source mapping logic. From your list of functional changes, I think the only things still missing are:
Given the code this PR touches has changed significantly, we think it would be unfair to ask you to update this PR. As such, we're planning to implement these changes ourselves in the next few working days, using parts of this PR if possible. Would you prefer we made these changes in your fork, or on a new branch? We'll make sure you're a co-author on any commits regardless. 🙂 |
@jbergstroem, would you be able to open a new issue for this? |
hi @ssttevee 👋 just following up on @mrbbot 's comment -- would you prefer we made these changes in your fork, or on a new branch? if we don't hear from you in the next couple of days we'll just go ahead and do the work on a new branch, but let us know if you prefer otherwise! also as @mrbbot noted, we'll make sure you're a co-author on any commits regardless :) |
Sorry I missed this, but I wouldn't mind either way and thanks for keeping me as a co-author. :) There was one more thing I wanted to address in this pr that I never got around to, which is debugging support in vscode. |
Hey! 👋 #4423 is now ready, and should provide the rest of the functionality added by this PR. Thanks again for submitting this! |
What this PR solves / how to test:
This PR improves on #3140.
There are a few functional changes:
wrangler.toml
now properly translates tracesprocess.cwd()
Error.stack
strings are also parsed and translatedSourceMapConsumer
is managed in auseEffect
and recreated whenever the script is reloadedNetwork.loadNetworkResource
CDP commands can now load source files referenced in translated tracesDev Tools Before:
![image](https://private-user-images.githubusercontent.com/434125/260061363-5098e0d1-0b81-45dd-96d0-200e783e86cb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxMzA5ODAsIm5iZiI6MTczOTEzMDY4MCwicGF0aCI6Ii80MzQxMjUvMjYwMDYxMzYzLTUwOThlMGQxLTBiODEtNDVkZC05NmQwLTIwMGU3ODNlODZjYi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwOVQxOTUxMjBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1lYjI1ZWFiNDEzN2Q5NzY1ODhlMDA0ZjI4ODRiYmFhNjk0MjJiYTI0NGYwMzk1ZDYwNjI1MmRjNTIwMDNmZGMzJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.SCY6a7rTkq0uFIDxFVB7J8wXgduij95jK_Xv8j09aD8)
Dev Tools After:
![image](https://private-user-images.githubusercontent.com/434125/260057612-c3516b19-8146-4586-a807-7ba7bba9d6c8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxMzA5ODAsIm5iZiI6MTczOTEzMDY4MCwicGF0aCI6Ii80MzQxMjUvMjYwMDU3NjEyLWMzNTE2YjE5LTgxNDYtNDU4Ni1hODA3LTdiYTdiYmE5ZDZjOC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwOVQxOTUxMjBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT03MmRjY2YwZjZkNDhhZTUzZWQ4NjA3NmEwNmVlNzJmMzNmODc3ODE1OTY3MTJjZGEzZGM2MDRlMTUyY2I2YWJjJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.DTOJUyxBHak1PHYarBz-saxNGw4OH1F21mV8jdp-eEw)
Terminal Before:
![image](https://private-user-images.githubusercontent.com/434125/260061257-c2ca28e7-10ee-4a3a-9e5f-90d59e2cb272.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxMzA5ODAsIm5iZiI6MTczOTEzMDY4MCwicGF0aC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pZ25hdHVyZT05ZTY1NzA4ZjQ0Y2ExZWI1YTBlNDI0MWRmOGE2Zjc3Yjc2ZWQ1ZmJiZmJhMzI4YjI5NDkyNzM2NmQ1OGQ0YWY5JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.DcbTZhRPgHcT2Ho0btCANHihAYTm3ROT42MED1GEP6A)
To test:
npm start -w wrangler dev ../../fixtures/worker-ts/src/index.ts
curl localhost:8787/error
Author has included the following, where applicable:
Reviewer is to perform the following, as applicable: