skip to content

If a teammate asks whether shipping a stage 3 TC39 JavaScript proposal to production is safe, how do you answer and what do you check?

level: seniorimportance: should knowfreq 30%

answer

  1. the stage alone does not decide
  2. recommended, not finished
  3. which engines ship it unflagged
  4. syntax spreads, an API can be wrapped
  5. what does backing out cost

basics

~20 s

Stage 3 means the design is complete and implementation is recommended, not finished: web compatibility or production feedback can still change it. Safety depends on syntax versus API, which engines ship it, and the cost of backing out.

solid answer

~50 s

It is not a yes or no on the stage alone. Stage 3 means the design is complete and implementation is recommended; changes are not expected, but web incompatibilities or production-grade implementation feedback can still force them, and a proposal can be sent back by consensus. Then I check three things. Availability: do the engines our users run ship it unflagged, or would we transpile or polyfill? Shape: syntax ties source to a transpiler's reading of the proposal and spreads across files, while an API can sit behind one wrapper. Exit cost: if it changes, is the fix one module or a rewrite, and is it confined to an app we redeploy, or in a library others depend on? A contained API in an app is usually fine. Syntax across a codebase or a public library should normally wait for Stage 4.

code

javascript · 13 lines
javascript
function groupItems(items, keyFn) {
  if (typeof Object.groupBy === "function") {
    return Object.groupBy(items, keyFn);
  }
  const groups = Object.create(null);
  for (const item of items) {
    const key = keyFn(item);
    (groups[key] ||= []).push(item);
  }
  return groups;
}

console.log(groupItems([1, 2, 3], (n) => (n % 2 ? "odd" : "even")).odd); // [ 1, 3 ]

go deeper

for a junior

Recall what Stage 3 means in plain terms: recommended for implementation, with changes not expected but still possible. Do not treat it as the same thing as being in the standard.

for a middle

Separate availability from stability. A proposal can be stable yet missing from your targets, and it can run in your target yet still change. Know that syntax needs a transpiler where an API may take a polyfill.

for a senior

Give a conditional answer from availability, shape and exit cost, and quote a real precedent. Propose concrete containment: one wrapper, tests pinning behaviour, a named owner and a way back out.

for a principal

The tradeoff is benefit now against migration risk later, and it scales with blast radius. Turn repeated one-off debates into a standing team rule, with published libraries held to a stricter bar than applications.

## What stage 3 actually says TC39, the committee behind the ECMAScript standard, moves proposals through stages. The process document describes **Stage 3** this way: "The proposal has been recommended for implementation. No changes to the proposal are expected, but some necessary changes may still occur due to web incompatibilities or feedback from production-grade implementations." Read that sentence at its stated strength. - It is strong. The design work is done, and the committee has signalled that implementers can invest in it. - It is not final. The purpose of the stage is "gaining implementation experience and discovering any web compatibility or integration issues", so finding problems is part of the plan. - It is not one-way. A proposal can be regressed to an earlier stage or withdrawn, with a rationale and the committee's consensus. - It says nothing about your runtime. Engines typically implement at stage 3 or stage 4, but whether yours has it unflagged is a separate fact. So "stage 3 means safe" and "stage 3 means unusable" are both too strong. The honest answer is a judgment built from three checks. ## The three checks 1. **Availability.** Which browsers and Node releases run this code, and do they ship the feature without a flag, a setting someone must turn on? If they do not, you are adding a transpiler, a build step that rewrites newer syntax into older, or a polyfill, script that defines a missing API. Either is a new dependency on someone's reading of an unfinished proposal. 2. **Shape.** Syntax and APIs carry different risks, covered below. 3. **Exit cost.** If the semantics change next year, what do you edit, and who has to redeploy? An app you can redeploy tonight absorbs a change easily. A published library passes the problem to consumers you do not control. ## Syntax versus API | | Syntax proposal | API proposal | |---|---|---| | Can be supplied on an old engine | Only by transpiling | By polyfill, if script can express it | | Where it ends up | Scattered through source files | Can sit behind one wrapper | | What happens if it changes | Every use site may need migration | One module usually needs editing | | Typical failure | Compiled output keeps old semantics and later differs from native behaviour | A polyfill under the proposed name collides with the eventual native one | The syntax row has a catch that is easy to miss. Transpiled code does not follow the proposal as it evolves. It keeps whatever semantics that transpiler version implemented, so nothing fails at the moment the specification moves. The difference appears later, when you upgrade the tool, or when you stop compiling and native behaviour takes over. ## Precedents worth quoting Two documented cases make the risk concrete. - **`Object.groupBy`.** In some versions of some browsers, this method was implemented as `Array.prototype.group()`. Because of web compatibility issues it is now a static method, so code written against the earlier shape would not find it there. - **Class fields.** Before the specification settled on define semantics, most transpilers compiled fields as assignments in the constructor, which caused subtle bugs after class fields were standardized. Working code changed meaning without any syntax change. ## Making it safe when the answer is yes - Put one module between the app and the proposed API, so a rename or a semantic change costs one edit. - Do not patch a global under the proposed name in code others consume. Your polyfill's semantics would then compete with whatever engines eventually ship. - Add tests pinning the exact behaviour you rely on, so a tool upgrade or a native arrival fails loudly. - Write down the exit: who owns it, and what would make you undo it. ## How to answer the teammate Do not stop at a verdict. State what stage 3 promises, ask what the feature is and where it is going, and give a conditional answer. A contained API in an application with a wrapper and tests is usually a reasonable yes. Syntax that would spread through a long-lived codebase, or anything in a public library's interface, is usually worth waiting for Stage 4 unless the benefit is large and someone owns the migration. Where a real benefit is in play, the team's standing rule should decide it, and the decision gets recorded.

  • Why is a stage 3 syntax proposal usually riskier to adopt than a stage 3 API?
    An API can sit behind one wrapper, so a change costs one edit. Syntax spreads through source files and cannot be wrapped. On older targets it also needs a transpiler, whose output keeps the semantics of that tool's version, so a later difference can surface far from any recent change.
  • Does an engine shipping a stage 3 feature mean its semantics are final?
    No. Implementation is how Stage 3 gathers the feedback that can force changes. Some browsers implemented what became `Object.groupBy` as `Array.prototype.group()`, and web compatibility issues moved it. Shipping raises confidence, but the proposal is complete only at Stage 4.
  • What evidence would move you from wait to adopt?
    The engines my users run shipping it unflagged, ideally more than one independently. No open design-level concerns in the proposal's repository, Test262 coverage in place, and use confined behind a wrapper with tests. Reaching Stage 4 would settle the design risk, leaving only availability to check.

  • Stage 3 means finished, so nothing about the proposal can still change.
  • If a transpiler supports the proposal, then it is safe to ship.
  • Once one browser ships a feature, it counts as part of the standard.
  • Stage 3 features can never be used in production by a responsible team.
  • A polyfill under the proposed global name carries no risk once native support arrives.
  • The stage number alone answers whether a feature is safe to ship.