src: add setTitle() as alternative to direct assignment - #62804
src: add setTitle() as alternative to direct assignment#62804JonathanLopes404 wants to merge 6 commits into
Conversation
|
Review requested:
|
addaleax
left a comment
There was a problem hiding this comment.
Why does this introduce a new native method? Adding the new API is fine, but it should just trigger the same code paths.
|
@addaleax Updated in latest commit: setTitle now reuses the existing process.title path (removed native method). Could you please take another look? |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #62804 +/- ##
==========================================
- Coverage 90.31% 90.30% -0.01%
==========================================
Files 759 759
Lines 248312 248345 +33
Branches 46861 46866 +5
==========================================
+ Hits 224265 224276 +11
- Misses 15476 15510 +34
+ Partials 8571 8559 -12
🚀 New features to boost your workflow:
|
|
Would add a reference on bottom of the |
f0e771a to
685682f
Compare
|
I'm confused why an alias for Separately, is it expected that if i |
|
Hello @ljharb, Regarding the usefulness: the primary motivation is to support modern ESM usage. Since ESM bindings are read-only, users cannot do About |
|
I checked if there are more similar APIs that would need similar treatment and A deprecation of |
|
Fair point on the ESM usage. |
c317652 to
121f4fa
Compare
|
Need to resolve merge conflicts, otherwise I think this is good to merge. |
|
I guess I'm not super convinced this is worthwhile, especially given that Not going to block, but if the change is made, I'd prefer to go all in and fully replace |
|
I strive to never use globals and prefer to import Deprecation seems acceptable as this is a low-use API. And I agree to adding |
Implement process.setTitle(title) as a new function-based API for setting the process title, complementing the existing process.title property assignment pattern Fixes: nodejs#62797 Signed-off-by: Jonathan Lopes <jonathan15989@protonmail.com>
Add process.setTitle(title) as a new API while reusing the existing process.title assignment behavior instead of introducing a separate native code path. Signed-off-by: Jonathan Lopes <jonathan15989@protonmail.com>
Add a cross-reference at the end of the process.title section to point to process.setTitle() as the new alternative API. Signed-off-by: Jonathan Lopes <jonathan15989@protonmail.com>
0f2a967 to
144c4f1
Compare
|
Thanks for the feedback. I've updated the documentation to mark process.title as deprecated and added the getTitle method as requested. |
Implement process.setTitle(title) as a new function-based API for setting the process title, complementing the existing process.title property assignment pattern
Fixes: #62797