77d7908a Changed limit-service to TypeScript and moved Ghost's queries out of it
Now it is here, the package can be what it should have been. It is TypeScript on
the golden path, built like every other package, so a browser bundler can drop
what an app does not use and the workaround forcing it through the pre-bundler is
gone again. The interface every caller uses is unchanged.
The queries that count members, staff, newsletters and emails have moved into
Ghost. They were never the limit service's to hold: what a staff user is, and
that Contributors do not count towards one, is Ghost's schema. The service asks
for a number now and is handed one, which is the same reason Admin can answer the
same questions over HTTP without either side knowing how the other does it.
Resolving limits is a pure function and the service only holds its result, so
limits can be rebuilt and swapped rather than mutated while something reads them.
A limit that cannot be applied is reported instead of dropped: before, the first
one that could not took every limit loaded after it with it, and said nothing.
Two limits that used to go missing now apply. A name a host spelled in another
case arrives with its settings rather than as an empty shell, because the name
was matched in one form and its settings read under another. And a name this
build has never heard of is honoured rather than discarded, so a host can switch
a feature off before the release that knows about it ships. The pinned tests show
both changes; nothing else moved.
What kind a limit is stays inferred from the shape of its configuration, as
before. Declaring kinds is worth doing, but Ghost(Pro) already models limits and
their types in its own tables, and a second declaration here would have to agree
with that one. That is a conversation, not a detail, so it is left alone.
The documentation came across describing an API that has changed, and in one
place a method that never existed, so it is corrected alongside.
ref https://linear.app/ghost/issue/BER-3797 f1f0ae61 Changed limit-service to TypeScript and moved Ghost's queries out of it
Now it is here, the package can be what it should have been. It is TypeScript on
the golden path, built like every other package, so a browser bundler can drop
what an app does not use and the workaround forcing it through the pre-bundler is
gone again. The interface every caller uses is unchanged.
The queries that count members, staff, newsletters and emails have moved into
Ghost. They were never the limit service's to hold: what a staff user is, and
that Contributors do not count towards one, is Ghost's schema. The service asks
for a number now and is handed one, which is the same reason Admin can answer the
same questions over HTTP without either side knowing how the other does it.
Resolving limits is a pure function and the service only holds its result, so
limits can be rebuilt and swapped rather than mutated while something reads them.
A limit that cannot be applied is reported instead of dropped: before, the first
one that could not took every limit loaded after it with it, and said nothing.
Two limits that used to go missing now apply. A name a host spelled in another
case arrives with its settings rather than as an empty shell, because the name
was matched in one form and its settings read under another. And a name this
build has never heard of is honoured rather than discarded, so a host can switch
a feature off before the release that knows about it ships. The pinned tests show
both changes; nothing else moved.
What kind a limit is stays inferred from the shape of its configuration, as
before. Declaring kinds is worth doing, but Ghost(Pro) already models limits and
their types in its own tables, and a second declaration here would have to agree
with that one. That is a conversation, not a detail, so it is left alone.
The documentation came across describing an API that has changed, and in one
place a method that never existed, so it is corrected alongside.
ref https://linear.app/ghost/issue/BER-3797 1d89640d Changed limit-service to TypeScript and moved Ghost's queries out of it
Now it is here, the package can be what it should have been. It is TypeScript on
the golden path, built like every other package, so a browser bundler can drop
what an app does not use and the workaround forcing it through the pre-bundler is
gone again. The interface every caller uses is unchanged.
The queries that count members, staff, newsletters and emails have moved into
Ghost. They were never the limit service's to hold: what a staff user is, and
that Contributors do not count towards one, is Ghost's schema. The service asks
for a number now and is handed one, which is the same reason Admin can answer the
same questions over HTTP without either side knowing how the other does it.
Resolving limits is a pure function and the service only holds its result, so
limits can be rebuilt and swapped rather than mutated while something reads them.
A limit that cannot be applied is reported instead of dropped: before, the first
one that could not took every limit loaded after it with it, and said nothing.
Two limits that used to go missing now apply. A name a host spelled in another
case arrives with its settings rather than as an empty shell, because the name
was matched in one form and its settings read under another. And a name this
build has never heard of is honoured rather than discarded, so a host can switch
a feature off before the release that knows about it ships. The pinned tests show
both changes; nothing else moved.
What kind a limit is stays inferred from the shape of its configuration, as
before. Declaring kinds is worth doing, but Ghost(Pro) already models limits and
their types in its own tables, and a second declaration here would have to agree
with that one. That is a conversation, not a detail, so it is left alone.
The documentation came across describing an API that has changed, and in one
place a method that never existed, so it is corrected alongside.
ref https://linear.app/ghost/issue/BER-3797 93c41dbe Changed limit-service to TypeScript and moved Ghost's queries out of it
Now it is here, the package can be what it should have been. It is TypeScript on
the golden path, built like every other package, so a browser bundler can drop
what an app does not use and the workaround forcing it through the pre-bundler is
gone again. The interface every caller uses is unchanged.
The queries that count members, staff, newsletters and emails have moved into
Ghost. They were never the limit service's to hold: what a staff user is, and
that Contributors do not count towards one, is Ghost's schema. The service asks
for a number now and is handed one, which is the same reason Admin can answer the
same questions over HTTP without either side knowing how the other does it.
Resolving limits is a pure function and the service only holds its result, so
limits can be rebuilt and swapped rather than mutated while something reads them.
A limit that cannot be applied is reported instead of dropped: before, the first
one that could not took every limit loaded after it with it, and said nothing.
Two limits that used to go missing now apply. A name a host spelled in another
case arrives with its settings rather than as an empty shell, because the name
was matched in one form and its settings read under another. And a name this
build has never heard of is honoured rather than discarded, so a host can switch
a feature off before the release that knows about it ships. The pinned tests show
both changes; nothing else moved.
What kind a limit is stays inferred from the shape of its configuration, as
before. Declaring kinds is worth doing, but Ghost(Pro) already models limits and
their types in its own tables, and a second declaration here would have to agree
with that one. That is a conversation, not a detail, so it is left alone.
The documentation came across describing an API that has changed, and in one
place a method that never existed, so it is corrected alongside.
ref https://linear.app/ghost/issue/BER-3797