-
Notifications
You must be signed in to change notification settings - Fork 545
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
enforce latin-1 encoding in source #2672
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we remove those comments it'll make debugging fetch 10x harder.
We can no longer copy and paste these comments and find where they originate from in the spec (I do this frequently when updating the impl. or fixing bugs). Since esbuild should be removing comments, it's likely a bug there. We can alternatively add a post processing script that strips these only in the bundled file.
I'm very much a -1 against this change. It'll make maintaining fetch harder for little benefit.
Not a bug in esbuild: evanw/esbuild#3117 (comment) |
Just tried it and changing the character has no effect on search/find on the spec 😄 |
something must have changed with the site then, it definitely did not work in the past... |
But I hear you. I agree too. I think this is an unnecessary change. I think we should minify the build and use source maps for proper stack traces. Not sure how Node.js internal deps handles that so I have to look into it further. |
Internal deps are kinda a nightmare: they get their own version of require that doesn't work well with multiple files (which is why undici is bundled unfortunately). |
The issue with the require we get there is that it only prepends 'internal' to the path, which means we'd have to replace every require in undici with I don't think this change should land unless it's enforced, and at that point we should just |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #2672 +/- ##
==========================================
- Coverage 85.54% 85.35% -0.20%
==========================================
Files 76 84 +8
Lines 6858 7540 +682
==========================================
+ Hits 5867 6436 +569
- Misses 991 1104 +113 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@Ethan-Arrowood I made an alternate PR that converts the bundled file to latin1 only |
I am pretty sure that can be special cased for undici, though I am not sure what undici uses as module ids if not bundled. The internal require will always be just minimal so nothing fancy like module path monkey patching would ever be supported, but prepending certain prefixes when the request comes from under |
@Ethan-Arrowood @KhafraDev what's the status of this? There are conflicts now. |
I think @KhafraDev preferred another methodology. Since he's modifying this source more than I am these days, I'm okay deferring to his preference 😄 |
Related to: nodejs/node#51605
this replaces all
’
with'
and theä
witha
in a licensing comment.Based on my research, the licensing comment change does not impact its validity. It would actually be more appropriate to have a complete License file along with the code instead of having it inlined.
I also tried out the
--minify-whitespace
flag for esbuild. This would remove comments fromnode:build
, but also remove all other whitespace. There does not seem to be an esbuild configuration option that only removes comments. We could consider another tool for that so we can retain other whitespace.