Skip to content

Shallowing up the Typescript surface for firebase/app and exporting default #1184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 10 commits into from

Conversation

jamesdaniels
Copy link
Member

@jamesdaniels jamesdaniels commented Aug 31, 2018

import firebase from 'firebase/app' fails for Typescript developers, but is needed for correct behavior on both browser and Node as import * as firebase from 'firebase/app' ends up with an entirely different object in Node.

The core of the matter is the types as they stand suggest that firebase/app is a CJS/AMD, when we're actually an ESM+CJS with a default export. Therefore shallowing up, exporting each namespace individually, and exporting a default namespace is more correct.

As far as I'm aware this is not a breaking change.

@jamesdaniels
Copy link
Member Author

@jshcrowthe @davideast I'm not sure if this is 100% the correct / complete answer, but this is how I was able to get things working well locally. Happy to discuss further.

@jamesdaniels jamesdaniels changed the title firebase/app-types should have a default export WIP attempt at fixing default export and missing functions on firebase/app Aug 31, 2018
@jamesdaniels jamesdaniels changed the title WIP attempt at fixing default export and missing functions on firebase/app Shallowing up the Typescript surface for firebase/app and exporting default Sep 4, 2018
@jamesdaniels jamesdaniels deleted the default_app_export branch September 6, 2018 03:44
@firebase firebase locked and limited conversation to collaborators Oct 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants