Skip to content
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

Enhance RTDB v2 Triggers #1153

Merged
merged 8 commits into from
Jun 28, 2022
Merged

Enhance RTDB v2 Triggers #1153

merged 8 commits into from
Jun 28, 2022

Conversation

colerogers
Copy link
Contributor

@colerogers colerogers commented Jun 21, 2022

  • Export Change from common/change.ts since we're using it in both v1 & v2 functions
  • Yank reinterpretCast from Change namespace
  • Rename the triggers onValue*

Copy link
Contributor

@taeold taeold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: This is verbatim copy of the existing code right? Do we worry about having to worry about divergence of the code or is that actually desirable in this case?

src/v2/core.ts Outdated Show resolved Hide resolved
@colerogers
Copy link
Contributor Author

@taeold Good point, I know we duplicated a bunch of the Event Handler options for better docs so I thought we should also do that here. Ended up moving it the common code path

@colerogers colerogers changed the title Export Change from v2 namespace Enhance RTDB v2 Triggers Jun 23, 2022
spec/common/core.spec.ts Outdated Show resolved Hide resolved
src/common/core.ts Outdated Show resolved Hide resolved
src/common/core.ts Outdated Show resolved Hide resolved
import { DataSnapshot } from '../common/providers/database';
import { firebaseConfig } from '../config';
import { DeploymentOptions } from '../function-configuration';
import { normalizePath } from '../utilities/path';
import { applyChange } from '../utils';

export { DataSnapshot };
export { DataSnapshot, Change };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we actually exported Change from the RDTB namespace in the past, did we? IIRC it was just exported in index.ts. We should put it in v1/index.ts and v2/index.ts as well as v2/core.ts

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good, I'll wait for the other PRs to complete first

/**
* `ChangeJson` is the JSON format used to construct a Change object.
*/
export interface ChangeJson {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be @internal? Are users actually constructing a ChangeJson?

@inlined
Copy link
Member

inlined commented Jun 28, 2022

Trying to make sure we get this in, sync launch.next and then I'll start doing some surgery. Committing rather than blocking on a comment about whether a field should be made internal. Let's talk tomorrow.

@inlined inlined merged commit 139e1d9 into master Jun 28, 2022
@inlined inlined deleted the colerogers.rtdb-bugbash branch June 28, 2022 04:20
TheIronDev added a commit that referenced this pull request Oct 23, 2022
This commit resolves faulty merge-conflicted code that did not take into
account the changes from #1153.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants