Open JoshuaKGoldberg opened 1 year ago
It’s only stage 2, there really shouldn’t be any polyfills yet.
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
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.
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).
👋 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.
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.