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

Deprecate Symbol.species #13

Open
ilias-t opened this issue Jun 3, 2020 · 5 comments
Open

Deprecate Symbol.species #13

ilias-t opened this issue Jun 3, 2020 · 5 comments

Comments

@ilias-t
Copy link
Member

ilias-t commented Jun 3, 2020

Given this proposal aims to remove the ability to use Symbol.species to subclass, and since the proposal is now in stage 1, would it make sense to deprecate Symbol.species at least in documentation like MDN to signal this intended behavior and reduce future usage of it?

@mhofman
Copy link
Member

mhofman commented Jun 3, 2020

I actually just audited our codebase and found one instance where we're testing for the existence of Symbol.species to determine if the environment is ES6 compatible. Admittedly not great, but I'm sure lots of other similar cases exist in the wild.

Also, I believe we don't want to prevent people from building their own species type subclassing.

@syg
Copy link
Collaborator

syg commented Jun 3, 2020

@ilias-t Note that Stage 1 is, IMO, a much weaker signal than deprecation. We're still unsure if the machinery can be removed at all due to web compat. It is jumping the gun to mark it as a legacy or deprecated feature currently.

@ljharb
Copy link
Member

ljharb commented Jun 3, 2020

@mhofman fwiw in the cases i've seen, "ES6 compatible" can mean a different thing; no engine that has symbols lacks Symbol.iterator, but every other well-known Symbol is "missing despite Symbol support" in at least one version of at least one engine.

@ilias-t
Copy link
Member Author

ilias-t commented Jun 4, 2020

Even if it’s too early to deprecate, I’d suggest that the main goal here should be to signal a warning to developers that it may be a risk to depend on this moving forward.

@codehag
Copy link
Collaborator

codehag commented Jul 23, 2020

@ilias-t if I am not mistaken, the use case you are describing might not be in danger. What is being proposed for removal is how it interacts with subclassing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants