Skip to content

Conversation

@GuzekAlan
Copy link
Collaborator

No description provided.

@GuzekAlan GuzekAlan changed the base branch from feat/add-phoenix-adapter-basics to feat/use-phoenix-in-realtime-js December 2, 2025 16:02
@GuzekAlan GuzekAlan changed the title fix(realtime): make RealtimePresence work with phoenixAdapter fix(realtime): add phoenixAdapter, change RealtimePresence, add github as dependency Dec 2, 2025
@GuzekAlan GuzekAlan changed the title fix(realtime): add phoenixAdapter, change RealtimePresence, add github as dependency feat(realtime): add phoenixAdapter, change RealtimePresence, add github as dependency Dec 2, 2025
@GuzekAlan GuzekAlan marked this pull request as ready for review December 2, 2025 16:16
Copy link
Collaborator

Choose a reason for hiding this comment

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

that's for future I think, but once we expose constants in phoenix fork, if we add something to those constants we should spread original one (and add more) or reexport them from this file for consistency

Comment on lines 203 to 208
/**
* @private
*/
getPresence(): Presence {
return this.presence
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

nitpick: not needed

*
*/
function transformState(state: State): RealtimePresenceState {
state = cloneDeep(state)
Copy link
Collaborator

Choose a reason for hiding this comment

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

question: is cloning needed here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Both of these functions are copied from the RealtimePresence and I haven't changed how they work. Once we have working sutff and tests to ensure nofing breaks we can modify and reafctor already existing code.

Comment on lines 256 to 258
function cloneDeep(obj: { [key: string]: any }) {
return JSON.parse(JSON.stringify(obj))
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

nitpick: you should make it generic, as this should return the same type on input

}

function cloneDeep(obj: { [key: string]: any }) {
return JSON.parse(JSON.stringify(obj))
Copy link
Collaborator

Choose a reason for hiding this comment

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

nitpick: i don't like that method of cloning

maybe this? mdn says it's supported by majors browsers, but we could still polyfill this just in case

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

same as above

}

trigger(type: string, payload: object, ref?: string): void {
//@ts-ignore - trigger should be public
Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh okay I thought those were the ones you've added before I made the PR to the subabase/phoenix

Comment on lines 158 to 163
/**
* @private
*/
getChannel(): Channel {
return this.channel
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

these private functions. They are not used in the class so either they should be deleted or made public.

@GuzekAlan GuzekAlan merged commit 3d9a08a into feat/use-phoenix-in-realtime-js Dec 4, 2025
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.

3 participants