tc39 / proposal-string-dedent

TC39 Proposal to remove common leading indentation from multiline template strings
https://tc39.es/proposal-string-dedent/
MIT License
625 stars 17 forks source link

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

Open JoshuaKGoldberg opened 1 year ago

JoshuaKGoldberg commented 1 year ago

Coming over from https://github.com/dmnd/dedent/issues/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 commented 1 year ago

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

G-Rath commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

👋 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.