Repository navigation
[RFC]: add symbol/to-string-tag #8482
Copy link
Copy link
Labels
AcceptedRFC feature request which has been accepted.RFC feature request which has been accepted.FeatureIssue or pull request for adding a new feature.Issue or pull request for adding a new feature.Good First IssueA good first issue for new contributors!A good first issue for new contributors!JavaScriptIssue involves or relates to JavaScript.Issue involves or relates to JavaScript.RFCRequest for comments. Feature requests and proposed changes.Request for comments. Feature requests and proposed changes.difficulty: 1Low degree of difficulty. Should be straightforward to implement and/or resolve.Low degree of difficulty. Should be straightforward to implement and/or resolve.priority: NormalNormal priority concern or feature request.Normal priority concern or feature request.
Description
Description
This RFC proposes adding the package symbol/to-string-tag.
The package should be very similar to the following existing packages:
symbol/has-instancesymbol/iteratorsymbol/async-iteratorsymbol/is-concat-spreadable
The primary difference is that the package should export Symbol.toStringTag if it exists.
Related Issues
None.
Questions
No.
Other
When adding this package, one should do the following:
- copy one of the existing packages mentioned above
- rename the copied package
- find and replace the package name (e.g.,
has-instance=>to-string-tag) - find and replace the variable name (e.g.,
HasInstanceSymbol=>ToStringTagSymbol) - ensure the copyright years are 2025
- update the descriptions according to the symbol's purpose (see MDN)
- update examples to reflect the symbol's purpose (see existing packages for inspiration)
- run tests, benchmarks, and examples to ensure that everything passes
- go back through and check that there are no copy-paste mistakes
Checklist
- I have read and understood the Code of Conduct.
- Searched for existing issues and pull requests.
- The issue name begins with
RFC:.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
AcceptedRFC feature request which has been accepted.RFC feature request which has been accepted.FeatureIssue or pull request for adding a new feature.Issue or pull request for adding a new feature.Good First IssueA good first issue for new contributors!A good first issue for new contributors!JavaScriptIssue involves or relates to JavaScript.Issue involves or relates to JavaScript.RFCRequest for comments. Feature requests and proposed changes.Request for comments. Feature requests and proposed changes.difficulty: 1Low degree of difficulty. Should be straightforward to implement and/or resolve.Low degree of difficulty. Should be straightforward to implement and/or resolve.priority: NormalNormal priority concern or feature request.Normal priority concern or feature request.
Activity
stdlib-bot commentedon Nov 9, 2025
👋 Important: PLEASE READ 👋
This issue has been labeled as a good first issue and is available for anyone to work on.
If this is your first time contributing to an open source project, some aspects of the development process may seem unusual, arcane, or some combination of both.
Before working on this issue and opening a pull request, please read the project's contributing guidelines. These guidelines and the associated development guide provide important information, including links to stdlib's Code of Conduct, license policy, and steps for setting up your local development environment.
To reiterate, we strongly encourage you to refer to our contributing guides before beginning work on this issue. Failure to follow our guidelines significantly decreases the likelihood that you'll successfully contribute to stdlib and may result in automatic closure of a pull request without review.
Setting up your local development environment is a critical first step, as doing so ensures that automated development processes for linting, license verification, and unit testing can run prior to authoring commits and pushing changes. If you would prefer to avoid manual setup, we provide pre-configured development containers for use locally or in GitHub Codespaces.
We place a high value on consistency throughout the stdlib codebase. We encourage you to closely examine other packages in stdlib and attempt to emulate the practices and conventions found therein.
In short, the more effort you put in to ensure that your contribution looks and feels like stdlib—including variables names, bracket spacing, line breaks, etc—the more likely that your contribution will be reviewed and ultimately accepted. We encourage you to closely study the codebase before beginning work on this issue.
✨ Thank you again for your interest in stdlib, and we look forward to reviewing your future contributions. ✨
suraj9562 commentedon Nov 10, 2025
kgryte commentedon Nov 10, 2025
kaushal-kumar-it commentedon Nov 16, 2025
@kgryte Whenever you get a moment, could you please review my PR? Thanks.
farazghani commentedon Nov 20, 2025
Implemented @stdlib/symbol/to-string-tag in PR #8560. Includes docs, types, examples, tests, and passes all lint/doctest checks. Let me know if anything needs updates!
Ankit-raj-11 commentedon Nov 27, 2025
Hi @kgryte,
I'd like to work on this issue and request assignment. Here's my proposed approach:
Approach to solve [RFC]: add
symbol/to-string-tag:Study existing symbol packages - Examine
symbol/has-instance,symbol/iteratorinlib/node_modules/@stdlib/symbol/Copy template package - Use existing symbol package as template for consistency
Rename and update references:
symbol/to-string-tagpackage.jsonwith new nameHasInstanceSymbol->ToStringTagSymbolUpdate documentation:
Symbol.toStringTagTesting & Validation:
npm testnpm run examplesnpm run lintpassesSubmit PR with title: "feat: add symbol/to-string-tag"
My background: Full-stack developer with experience in open source (Kibana, Rocket.Chat), strong JavaScript/TypeScript skills, familiar with stdlib patterns.
Thanks!
necromancerrr commentedon Jul 25, 2026
Hi! I want to work on this. I'll model symbol/to-string-tag on an existing sibling package (e.g. symbol/has-instance) and make sure tests, benchmarks, and examples pass. Could I be assigned? PR to follow, thanks!