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

Docs: Explicitly mention string-dedent as the current polyfill? #80

Open
JoshuaKGoldberg opened this issue Aug 3, 2023 · 5 comments
Open

Comments

@JoshuaKGoldberg
Copy link

JoshuaKGoldberg commented Aug 3, 2023

Coming over from dmnd/dedent#76, @G-Rath mentioned that string-dedent is used in the REPL. I don't that package or the word "polyfill" mentioned anywhere else in the proposal.

Could string-dedent be mentioned in the README.md as the current polyfill for the package? Right now it's unclear what folks would want to be using for the current proposal's behavior.

@ljharb
Copy link
Member

ljharb commented Aug 3, 2023

It’s only stage 2, there really shouldn’t be any polyfills yet.

@G-Rath
Copy link

G-Rath commented Aug 3, 2023

As I said in my original issue:

I realise that string-dedent is apparently the polyfill (I don't know if its technically official, but it is the library used in the REPL),

Polyfill or not, there appears to exist a library that matches this proposal - happy to use another term to refer to it; though my impression overall is that this is primarily waiting for reviewers to sign off / champions to re-present more than anything

@JoshuaKGoldberg
Copy link
Author

JoshuaKGoldberg commented Aug 3, 2023

It’s only stage 2, there really shouldn’t be any polyfills yet.

Err, that's not how I interpreted https://tc39.es/process-document under Implementation Types Expected* for stage 1. The asterisk there is * This column does not indicate a requirement for advancement, but simply a general expectation.

Is there more detail mentioned anywhere in TC39 docs around polyfill timing? If there is and it's contrary to that process document I can file an issue / send a docs PR.

@ljharb
Copy link
Member

ljharb commented Aug 4, 2023

No, and attempts to refine this have received pushback - i already have an open PR.

To be clear, a package that matches the proposal without mutating builtins is fine at any stage - it’s just that before stage 3, the shape may change at any time, often drastically.

Although i use the term “polyfill” to mean such a function and “shim” to mean a self-installing one, enough people still assume the term polyfill includes the self-installation (which is the problematic part).

@jridgewell
Copy link
Member

👋 I'm the proposal champion and author of string-dedent. The library isn't meant to be a polyfill (it doesn't mutate globals, it's just helper function you can use). I wrote it to so experiment with what behaviors produced good outputs, and to guide how to write the spec text for the proposal.

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

4 participants