element-web/src/components/views/auth
Travis Ralston 20a615396b Implementation of new potential skinning mechanism
With a switch to Only One Webpack™ we need a way to help developers generate the component index without a concurrent watch task. The best way to do this is to have developers import their components, but how do they do that when we support skins? The answer in this commit is to change skinning.

Skinning now expects to receive your list of overrides instead of the react-sdk+branded components. For Riot this means we send over *only* the Vector components and not Vector+react-sdk. 

Components can then be annotated with the `replaceComponent` decorator to have them be skinnable. The decorator must take a string with the dot path of the component because we can't reliably calculate it ourselves, sadly. 

The decorator does a call to `getComponent` which is where the important part of the branded components not including the react-sdk is important: if the branded app includes the react-sdk then the decorator gets executed before the skin has finished loading, leading to all kinds of fun errors. This is also why the skinner lazily loads the react-sdk components to avoid importing them too early, breaking the app.

The decorator will end up receiving null for a component because of the getComponent loop mentioned: the require() call is still in progress when the decorator is called, therefore we can't error out. All usages of getComponent() within the app are safe to not need such an error (the return won't be null, and developers shouldn't use getComponent() after this commit anyways).

The AuthPage, being a prominent component, has been converted to demonstrate this working. Changes to riot-web are required to have this work.

The reskindex script has also been altered to reflect these skinning changes - it no longer should set the react-sdk as a parent. The eventual end goal is to get rid of `getComponent()` entirely as it'll be easily replaced by imports.
2019-12-12 19:48:45 -07:00
..
AuthBody.js Add modal look to authentication flows 2019-01-22 20:44:49 -06:00
AuthFooter.js Migrate away from React.createClass for auth and views/auth. React 16 :D 2019-08-30 10:27:51 +01:00
AuthHeader.js Migrate away from React.createClass for auth and views/auth. React 16 :D 2019-08-30 10:27:51 +01:00
AuthHeaderLogo.js Extract auth header logo to new component 2019-01-22 22:41:10 -06:00
AuthPage.js Implementation of new potential skinning mechanism 2019-12-12 19:48:45 -07:00
CaptchaForm.js Migrate string refs over to createRef 2019-12-08 12:16:17 +00:00
CountryDropdown.js ToUpper the country code 2019-06-01 09:12:09 -06:00
CustomServerDialog.js Remove unneeded help about identity servers 2019-10-28 15:38:28 +00:00
InteractiveAuthEntryComponents.js Migrate string refs over to createRef 2019-12-08 12:16:17 +00:00
LanguageSelector.js Use mx_AuthBody prefix for consistency 2019-01-31 10:06:35 -06:00
ModularServerConfig.js Cull some easily fixable errors which make the console a mess 2019-10-03 21:47:19 +01:00
PasswordLogin.js Login: Add way to change HS from SSO Homeserver 2019-09-11 17:44:04 +01:00
RegistrationForm.js Tweak identity server warning text 2019-10-28 14:23:11 +00:00
ServerConfig.js Cull some easily fixable errors which make the console a mess 2019-10-03 21:47:19 +01:00
ServerTypeSelector.js Update ServerTypeSelector for new matrix.org CS API URL 2019-10-23 13:13:32 -06:00
SignInToText.js Apply PR feedback 2019-09-11 17:44:04 +01:00
Welcome.js Implementation of new potential skinning mechanism 2019-12-12 19:48:45 -07:00