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

Merged

Conversation

idainatovych
Copy link
Contributor

Rebased and edited version of #1201

@idainatovych idainatovych force-pushed the BeatC-moving-conference-init-to-react-1 branch from fb5b087 to 6f2861d Compare December 26, 2016 12:52
@idainatovych idainatovych mentioned this pull request Dec 27, 2016
@paweldomas
Copy link
Member

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:

[modules/URL/ConferenceUrl.js] : Stored original conference URL: https://pawel.jitsi.net/someroom
app.bundle.js:83346 [modules/URL/ConferenceUrl.js] : Conference URL for invites: https://pawel.jitsi.net/someroom

But it should say:

[modules/URL/ConferenceUrl.js] : Stored original conference URL: https://pawel.jitsi.net/someroom?arg1=234#config.blabla=2
app.bundle.js:83346 [modules/URL/ConferenceUrl.js] : Conference URL for invites: https://pawel.jitsi.net/someroom

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.

@idainatovych idainatovych force-pushed the BeatC-moving-conference-init-to-react-1 branch from 6f2861d to ed1aa70 Compare January 4, 2017 15:48
@idainatovych
Copy link
Contributor Author

@paweldomas Updated this PR with the changes related to stripping URL query parameters.

@lyubomir lyubomir self-assigned this Jan 4, 2017
return () => {
init();
};
}
Copy link
Contributor

@lyubomir lyubomir Jan 9, 2017

Choose a reason for hiding this comment

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

  1. 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.

Copy link
Contributor

Choose a reason for hiding this comment

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

  1. The coding style requires sorting by alphabetical order.

url
= match[1] /* URL protocol */
+ '://enso.hipchat.me/'
+ url.substring(regex.lastIndex);
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. 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.

  2. 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();
Copy link
Contributor

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();
}

/**
Copy link
Contributor

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: () => {
Copy link
Contributor

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
Copy link
Contributor

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);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. The file react/features/conference/actions.js is not used!

  2. It was copied into react/features/conference/functions.js and modified further.

APP.settings.setAvatarUrl((avatarUrl || '').trim());
APP.settings.setDisplayName((name || '').trim(), true);
}
}
Copy link
Contributor

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()) {
Copy link
Contributor

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() {
Copy link
Contributor

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:

  1. It is dispatched by App.web.js on componentWillMount. However, AbstractApp dispatches appWillMount on componentWillMount. Whatever App.web.js does with appInit can already be done on appWillMount.

  2. It's not really a Redux action that anyone else can intercept or reduce so calling it a Redux action is superfluous.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@lyubomir lyubomir force-pushed the BeatC-moving-conference-init-to-react-1 branch from 6f2ed66 to f1ed580 Compare January 11, 2017 19:52
@lyubomir lyubomir force-pushed the BeatC-moving-conference-init-to-react-1 branch from f1ed580 to 0936d54 Compare January 12, 2017 16:38
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants