-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Moving conference init to react (rebased) #1204
Moving conference init to react (rebased) #1204
Conversation
fb5b087
to
6f2861d
Compare
There is a problem where the original URL stored by the ConferenceUrl is stripped from the parameters. When I enter pawel.jitsi.net/someroom?arg1=234#config.blabla=2 I see in the logs:
But it should say:
It's possible that the "jwt" token param could be lost as well, but I haven't tried that. I guess that it gets lost during routing here, but my knowledge about react is limited and you will probably know better. |
6f2861d
to
ed1aa70
Compare
@paweldomas Updated this PR with the changes related to stripping URL query parameters. |
…hub.com/BeatC/jitsi-meet into BeatC-BeatC-moving-conference-init-to-react-1
return () => { | ||
init(); | ||
}; | ||
} |
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.
- The file react/features/app/actions.web.js is practically a copy of 158 lines from react/features/app/actions.native.js with the addition of a simple function. As per the coding style, this is unacceptable.
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.
- The coding style requires sorting by alphabetical order.
url | ||
= match[1] /* URL protocol */ | ||
+ '://enso.hipchat.me/' | ||
+ url.substring(regex.lastIndex); |
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.
-
The file react/features/app/functions.web.js is practically a copy of a 117 lines from react/features/app/functions.native.js with the additions of functions. As per the coding style, this is unacceptable.
-
The copied parts have been modified with incorrect indentations.
|
||
// XXX Temporary solution. Until conference.js hasn't been moved | ||
// to the react app we shouldn't use JitsiMeetJS from react app. | ||
return Promise.resolve(); |
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.
The file react/features/base/lib-jitsi-meet/actions.web.js is practically a copy of ~55 lines from react/features/base/lib-jitsi-meet/actions.native.js with a modification of ~10 lines. As per the coding style, this is unacceptable.
this._updateRoomname(); | ||
} | ||
|
||
/** |
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 personally removed the method _onUpdateRoomname and its uses. You've brought back the method but not its uses.
|
||
/** | ||
* Register route for Conference (page). | ||
*/ | ||
RouteRegistry.register({ | ||
component: Conference, | ||
path: '/:room' | ||
path: '/:room', | ||
onEnter: () => { |
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.
The coding style requires sorting by alphabetical order.
/** | ||
* Register route for WelcomePage. | ||
*/ | ||
RouteRegistry.register({ | ||
component: WelcomePage, | ||
path: '/' | ||
path: '/', | ||
onEnter |
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.
The coding style requires sorting by alphabetical order.
|
||
// Initialize the conference URL handler | ||
APP.ConferenceUrl = new ConferenceUrl(window.location); | ||
} |
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.
-
The file react/features/conference/actions.js is not used!
-
It was copied into react/features/conference/functions.js and modified further.
APP.settings.setAvatarUrl((avatarUrl || '').trim()); | ||
APP.settings.setDisplayName((name || '').trim(), true); | ||
} | ||
} |
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 believe you're not getting the idea of the file functions.js of a feature. It's supposed to (1) export functions out of the feature and/or (2) declare feature-internal/private functions that are used in multiple other files. If you're using the function of a feature only in one file of the same feature, then the function should be in the filewhich uses it and it should be private to that file (most likely).
* @returns {void} | ||
*/ | ||
function onEnter(nextState, replace) { | ||
if (!APP.settings.isWelcomePageEnabled()) { |
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.
Both react/features/welcome/route.js and react/features/conference/route.js are supposed to be platform-agnostic (as the simple .js file extension suggests). You put APP and/or imported from modules/ in them which cannot possibly run on mobile.
* | ||
* @returns {Function} | ||
*/ | ||
export function appInit() { |
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 this "action" is pointless and I believe it should be removed:
-
It is dispatched by
App.web.js
oncomponentWillMount
. However,AbstractApp
dispatchesappWillMount
oncomponentWillMount
. WhateverApp.web.js
does withappInit
can already be done onappWillMount
. -
It's not really a Redux action that anyone else can intercept or reduce so calling it a Redux action is superfluous.
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'm fully agree with you. It's a temporary solution because app initialization is not fully integrated in new app. And in one of further PRs based on this one I refactored this action to just function.
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.
@lyubomir And also as far as I understand from the codebase we shouldn't initialize the conference until we move to the Conference
(in old app we did initialization on the WelcomePage
but it was senseless because we did it again when user went to the conference because page was reloaded and all app initialization was run again). In new app we're trying to get rid of page reloading because it improves the UX.
6f2ed66
to
f1ed580
Compare
f1ed580
to
0936d54
Compare
Rebased and edited version of #1201