Skip to content
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

string_decoder: refactor to use private properties #47544

Closed
wants to merge 1 commit into from

Conversation

anonrig
Copy link
Member

@anonrig anonrig commented Apr 13, 2023

Mainly the changes contain converting decoder into a class and use private properties for brand validation. It comes with a caveat that I want to ask the community feedback and help.

With the following changes, the following test does not work, and is removed. Therefore, it makes this pull request a breaking change? Can we avoid that? I'm adding needs-cigtm just in case...

// Should work without 'new' keyword
const decoder2 = {};
StringDecoder.call(decoder2);
assert.strictEqual(decoder2.encoding, 'utf8');

@anonrig anonrig added semver-major PRs that contain breaking changes and should be released in the next major version. needs-citgm PRs that need a CITGM CI run. labels Apr 13, 2023
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. string_decoder Issues and PRs related to the string_decoder subsystem. labels Apr 13, 2023
lib/string_decoder.js Outdated Show resolved Hide resolved
@cjihrig
Copy link
Contributor

cjihrig commented Apr 13, 2023

Therefore, it makes this pull request a breaking change? Can we avoid that?

I don't think so. That has previously stopped other things in core from being converted to a class.

@anonrig
Copy link
Member Author

anonrig commented Apr 13, 2023

@anonrig anonrig added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 13, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 13, 2023
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@targos
Copy link
Member

targos commented Apr 17, 2023

Why did you abort the benchmark?

@anonrig
Copy link
Member Author

anonrig commented Apr 17, 2023

Why did you abort the benchmark?

@targos There was a more urgent benchmark at that time. I'll re-run it after I fix the errors in this current pull request, and CIGTM was aborted due to Node 20.

@anonrig anonrig added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 17, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 17, 2023
@nodejs-github-bot
Copy link
Collaborator

@jasnell
Copy link
Member

jasnell commented Apr 17, 2023

Unfortunately I think we need to take this through a proper runtime deprecation cycle before we can make this change. There are older versions of iconv-lite, and I'm sure other modules that this will break.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ci PRs that need a full CI run. needs-citgm PRs that need a CITGM CI run. semver-major PRs that contain breaking changes and should be released in the next major version. string_decoder Issues and PRs related to the string_decoder subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants