firebase-functions icon indicating copy to clipboard operation
firebase-functions copied to clipboard

Limit the exposed API to necessary methods and types

Open merlinnot opened this issue 5 years ago • 5 comments

Since we're working on a v3 release, it might be wise to revise the API of the library. Multiple types are exposed that seem not necessary, which might result in issues when internal structure of the library is modified (e.g. LegacyEvent).

It's also easier for developers when autocomplete suggests only usable types and it's not bloated with internals.

We should verify that all exported types actually belong to the API layer. This can be done by modifying the following:

https://github.com/firebase/firebase-functions/blob/18c01cbdc25d8f4fccb8847f6a4be86b6c7d4960/src/index.ts#L55-L57

in the following way:

export { Only, Necessary, Types } from './config';
export { No, Internals } from './cloud-functions';
export { Nice, And, Small } from './function-builder';

merlinnot avatar May 30 '19 22:05 merlinnot

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

google-oss-bot avatar May 30 '19 22:05 google-oss-bot

Internal bug reference: 135147671

thechenky avatar Jun 13 '19 00:06 thechenky

@merlinnot What happened to this? Chose to ask since you mention v3 and the library is now at 3.8.0.

akauppi avatar Jul 23 '20 06:07 akauppi

No one had time to pick it up, or in other words, it was/is not a priority.

merlinnot avatar Jul 23 '20 06:07 merlinnot

People probably weren't tracking a list of breaking changes to make on the next major version bump. I've created such a hotlist. We'll probably keep the export * from but will instead mark things that shouldn't be exported as @internal

inlined avatar Apr 23 '21 20:04 inlined