Skip to content

Conversation

@aryan7071
Copy link

@aryan7071 aryan7071 commented Nov 14, 2025

Resolves #8479

Description

This pull request implements the RFC to add support for two new packages:

1. @stdlib/symbol/replace

  • Exports Symbol.replace when supported by the environment.
  • Exports undefined in environments without native Symbol.replace support.
  • Includes documentation, examples, benchmarks, TypeScript types, and tests.
  • Mirrors the structure and conventions used by existing symbol-related packages such as:
    • symbol/iterator
    • symbol/async-iterator
    • symbol/has-instance

2. @stdlib/assert/has-replace-symbol-support

  • Provides feature detection for native Symbol.replace.
  • Exports a boolean indicating support.
  • Includes:
    • Library implementation
    • Test suite
    • Benchmarks
    • CLI (has-replace-symbol-support)
    • Examples
    • TypeScript definitions and TS tests
    • README and usage docs

This PR follows the package-creation checklist outlined in the RFC:

  • Copied from a similar existing package
  • Renamed package and variable names
  • Updated copyright years to 2025
  • Updated documentation and examples to reflect Symbol.replace
  • Verified the implementation through local testing

Related Issues


Questions

No.


Other

No additional information.


Checklist

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

This PR was authored and implemented by me. I used ChatGPT to help with formatting, code and test scaffolding, documentation consistency, and to confirm that the package layout and conventions match other stdlib packages. All final code, edits, and decisions were reviewed and approved by me before submission.


@stdlib-js/reviewers

@stdlib-bot stdlib-bot added First-time Contributor A pull request from a contributor who has never previously committed to the project repository. Needs Review A pull request which needs code review. Good First PR A pull request resolving a Good First Issue. labels Nov 14, 2025
@stdlib-bot
Copy link
Contributor

👋 Hi there! 👋

And thank you for opening your first pull request! We will review it shortly. 🏃 💨

Getting Started

Next Steps

  1. A project maintainer will approve GitHub Actions workflows for your PR.
  2. All CI checks must pass before your submission can be fully reviewed.
  3. You'll need to address any failures in linting or unit tests.

Running Tests Locally

You can use make to run any of the CI commands locally from the root directory of the stdlib repository:

# Run tests for all packages in the math namespace:
make test TESTS_FILTER=".*/@stdlib/math/.*"

# Run benchmarks for a specific package:
make benchmark BENCHMARKS_FILTER=".*/@stdlib/math/base/special/sin/.*"

If you haven't heard back from us within two weeks, please ping us by tagging the "reviewers" team in a comment on this PR.

If you have any further questions while waiting for a response, please join our Gitter channel to chat with project maintainers and other community members.

We appreciate your contribution!

Documentation Links

@stdlib-bot
Copy link
Contributor

stdlib-bot commented Nov 14, 2025

Coverage Report

Package Statements Branches Functions Lines
assert/has-replace-symbol-support $\color{green}91/91$
$color{green}+100.00%$
$\color{green}6/6$
$color{green}+100.00%$
$\color{green}1/1$
$color{green}+100.00%$
$\color{green}91/91$
$color{green}+100.00%$
symbol/replace $\color{green}90/90$
$color{green}+100.00%$
$\color{red}2/3$
$color{green}+66.67%$
$\color{green}0/0$
$color{green}+100.00%$
$\color{green}90/90$
$color{green}+100.00%$

The above coverage report was generated for the changes in this PR.

@stdlib-bot stdlib-bot added the Potential Duplicate There might be another pull request resolving the same issue. label Nov 15, 2025
@kgryte
Copy link
Member

kgryte commented Nov 18, 2025

@aryan7071 I suggest learning how to better prompt and leverage AI, as many of the changes to the existing package are undesired. As a first time contributor, I suggest spending time authoring contributions manually before using AI, as it is critical to familiarize yourself with project conventions in order to know expectations and standards.

@kgryte kgryte added Needs Changes Pull request which needs changes before being merged. and removed Needs Review A pull request which needs code review. labels Nov 18, 2025
@aryan7071
Copy link
Author

Thanks for the feedback. @kgryte sir
As a first-time contributor, I did rely too heavily on AI to speed things up, and I understand that some of the changes didn’t fully align with the project’s conventions.
I’ll take your advice and spend more time understanding the codebase, guidelines, and standards. Going forward, I’ll author contributions manually first and use AI only as a helper where appropriate not as a substitute for my own understanding.
Thanks again for the guidance. I genuinely want to improve and contribute in the right way.

@kgryte
Copy link
Member

kgryte commented Nov 18, 2025

Ref: a68d5d9

@kgryte kgryte added the autoclose: Already Resolved Pull request which should be auto-closed due proposed changes duplicating already included changes. label Nov 18, 2025
@stdlib-bot
Copy link
Contributor

Thank you for working on this pull request. However, we cannot accept your contribution as the issue this pull request seeks to resolve has already been addressed in a different pull request or commit.

Thank you again for your interest in stdlib, and we look forward to reviewing your future contributions.

@stdlib-bot stdlib-bot closed this Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autoclose: Already Resolved Pull request which should be auto-closed due proposed changes duplicating already included changes. First-time Contributor A pull request from a contributor who has never previously committed to the project repository. Good First PR A pull request resolving a Good First Issue. Needs Changes Pull request which needs changes before being merged. Potential Duplicate There might be another pull request resolving the same issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RFC]: add symbol/replace

3 participants