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

CJS-5: Remove immutable #602

Merged
merged 24 commits into from
Feb 5, 2021
Merged

CJS-5: Remove immutable #602

merged 24 commits into from
Feb 5, 2021

Conversation

virdesai
Copy link
Contributor

Submit a pull request

CLA

  • I have signed the Stream CLA (required).
  • The code changes follow best practices
  • Code changes are tested (add some information if not applicable)

Description of the pull request

@github-actions
Copy link
Contributor

github-actions bot commented Jan 28, 2021

Size Change: -3.07 kB (1%)

Total Size: 214 kB

Filename Size Change
dist/browser.es.js 46.4 kB -129 B (0%)
dist/browser.full-bundle.min.js 27.3 kB -2.45 kB (8%)
dist/browser.js 46.9 kB -180 B (0%)
dist/index.es.js 46.4 kB -130 B (0%)
dist/index.js 47 kB -178 B (0%)

compressed-size-action

@vishalnarkhede vishalnarkhede changed the title Remove immutable CJS-5: Remove immutable Jan 29, 2021
test/unit/channel_state.js Outdated Show resolved Hide resolved
src/channel.ts Outdated Show resolved Hide resolved
src/channel.ts Outdated Show resolved Hide resolved
src/channel.ts Outdated Show resolved Hide resolved
src/channel.ts Outdated Show resolved Hide resolved
src/channel_state.ts Outdated Show resolved Hide resolved
src/channel_state.ts Outdated Show resolved Hide resolved
src/channel_state.ts Outdated Show resolved Hide resolved
src/channel_state.ts Outdated Show resolved Hide resolved
src/channel_state.ts Show resolved Hide resolved
src/types.ts Outdated
@@ -32,6 +31,14 @@ export type RequireOnlyOne<T, Keys extends keyof T = keyof T> = Pick<
[K in Keys]-?: Required<Pick<T, K>> & Partial<Record<Exclude<Keys, K>, undefined>>;
}[Keys];

export type RequireOnlyTwo<T, Keys extends keyof T = keyof T> = Pick<
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it used somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nah, we thought originally there'd be only 2 translation texts { en_text: 'Something', es_text: 'Translated' } but there can be more than that. but after this type rule was figured out so we left it just in case it's needed in the future for anything as it was a bit of a thought process to get to

Copy link
Contributor

Choose a reason for hiding this comment

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

Since it's not in master, might be good to remove.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if (oldReactionCounts) {
const oldReactionType = oldReactionCounts[reaction.type];
oldReactionCounts[reaction.type] = oldReactionType ? oldReactionType - 1 : 0;
messageWithReaction.reaction_counts = oldReactionCounts;
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this is a responsibility of _removeReactionFromMessage which would also prevent duplication below

Pointing this but it might actually be out of scope of this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm yeah, I think maybe it's for another PR so we can keep the scope of this to immutables

Copy link
Contributor

Choose a reason for hiding this comment

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

Good idea, SGTM

Copy link
Contributor

@ferhatelmas ferhatelmas left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@virdesai virdesai merged commit ed1c028 into master Feb 5, 2021
@delete-merged-branch delete-merged-branch bot deleted the remove-immutable branch February 5, 2021 16:02
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.

5 participants