-
Notifications
You must be signed in to change notification settings - Fork 937
update documentation to show the correct import syntax #1274
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
Conversation
@@ -83,7 +83,7 @@ var app = firebase.initializeApp({ ... }); | |||
If you are using ES6 imports or TypeScript: | |||
|
|||
``` | |||
import firebase from 'firebase'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's another instance (import firebase from 'firebase/app'
) that should be updated too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch! done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, LGTM.
Oh, hrm. Based on #1206 (comment) I guess this change isn't entirely a slam dunk (it'll break people targeting node)? I'm guessing it's still an improvement (I suspect browser usage is much more common), but maybe @jamesdaniels will want to weigh in on what we should be documenting here. Maybe we should describe both syntaxes and when to use each or something. |
Good point. It's a problem when people tries to use native es6 module in node. Native es6 module support in node is still experimental and is hidden behind a flag, so it's probably a rare use case. Anyway, I only updated the section for browser use cases, and in node use case, we only advise to use require() syntax, so we are not misleading people hopefully. |
I'll let James weigh in as he's much more familiar with the nuances here. 😁 |
@jamesdaniels Are you okay with the change? |
LGTM. Sorry I've not had the time to dig in a bit more here. This seems to be the most consistent for the moment. |
doesn't work with the typings we currently have. It works with vanilla javascript though. But to keep it consistently across javascript and typescript, I'm updating it to