Skip to content

Proposal: "name" attribute in second argument of alarms.create() #999

@bershanskiy

Description

@bershanskiy

Updated based on meeting notes from 21 May 2026.

Background

Currently alarms.create() takes two optional arguments, alarmName and alarmInfo:

alarms.create(
  name,              // optional string
  alarmInfo          // optional object
)

If caller omits name, then it is assumed to be an empty string "".

Proposal

The split of arguments into two different arguments is not ergonomic.

I propose adding an optional attribute name to alarmInfo so that the following calls are equivalent:

alarms.create("kettle", {delayInMinutes: 1.5});
alarms.create({name: "kettle", delayInMinutes: 1.5});

If both places specify the same name, no behavior change is needed. If both places specify different names, then an error is thrown because the intention of the caller is not clear.

Backwards compatibility

This behavior is trivially polyfillable. It's just a bit of syntactic sugar for developer convenience.

The new syntax will likely apply the new alarm length limit unconditionally, so it will not be backwards-compatible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions