Bump React from 16.14.0 to 18.1.0
This commit is contained in:
parent
f804c00920
commit
83b21e90d2
226 changed files with 531 additions and 610 deletions
|
@ -1,23 +1,26 @@
|
|||
import './public-path';
|
||||
import loadPolyfills from '../mastodon/load_polyfills';
|
||||
import { start } from '../mastodon/common';
|
||||
|
||||
import loadPolyfills from 'mastodon/load_polyfills';
|
||||
import { start } from 'mastodon/common';
|
||||
|
||||
start();
|
||||
|
||||
function loaded() {
|
||||
const TimelineContainer = require('../mastodon/containers/timeline_container').default;
|
||||
const React = require('react');
|
||||
const ReactDOM = require('react-dom');
|
||||
const mountNode = document.getElementById('mastodon-timeline');
|
||||
const { createRoot } = require('react-dom/client');
|
||||
const { default: TimelineContainer } = require('mastodon/containers/timeline_container');
|
||||
|
||||
const mountNode = document.getElementById('mastodon-timeline');
|
||||
|
||||
if (mountNode !== null) {
|
||||
const root = createRoot(mountNode);
|
||||
const props = JSON.parse(mountNode.getAttribute('data-props'));
|
||||
ReactDOM.render(<TimelineContainer {...props} />, mountNode);
|
||||
|
||||
root.render(<TimelineContainer {...props} />);
|
||||
}
|
||||
}
|
||||
|
||||
function main() {
|
||||
const ready = require('../mastodon/ready').default;
|
||||
const { default: ready } = require('mastodon/ready');
|
||||
ready(loaded);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import './public-path';
|
||||
|
||||
import { delegate } from '@rails/ujs';
|
||||
import ready from '../mastodon/ready';
|
||||
import ready from 'mastodon/ready';
|
||||
|
||||
const batchCheckboxClassName = '.batch-checkbox input[type="checkbox"]';
|
||||
|
||||
|
@ -110,21 +111,23 @@ ready(() => {
|
|||
}
|
||||
});
|
||||
|
||||
const React = require('react');
|
||||
const ReactDOM = require('react-dom');
|
||||
const { createRoot } = require('react-dom/client');
|
||||
|
||||
[].forEach.call(document.querySelectorAll('[data-admin-component]'), element => {
|
||||
const componentName = element.getAttribute('data-admin-component');
|
||||
const { locale, ...componentProps } = JSON.parse(element.getAttribute('data-props'));
|
||||
|
||||
import('../mastodon/containers/admin_component').then(({ default: AdminComponent }) => {
|
||||
return import('../mastodon/components/admin/' + componentName).then(({ default: Component }) => {
|
||||
ReactDOM.render((
|
||||
<AdminComponent locale={locale}>
|
||||
<Component {...componentProps} />
|
||||
</AdminComponent>
|
||||
), element);
|
||||
});
|
||||
Promise.all([
|
||||
import('mastodon/containers/admin_component'),
|
||||
import('mastodon/components/admin/' + componentName),
|
||||
]).then(({ default: AdminComponent }, { default: Component }) => {
|
||||
const root = createRoot(element);
|
||||
|
||||
root.render((
|
||||
<AdminComponent locale={locale}>
|
||||
<Component {...componentProps} />
|
||||
</AdminComponent>
|
||||
));
|
||||
}).catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
import './public-path';
|
||||
|
||||
import escapeTextContentForBrowser from 'escape-html';
|
||||
import loadPolyfills from '../mastodon/load_polyfills';
|
||||
import ready from '../mastodon/ready';
|
||||
import { start } from '../mastodon/common';
|
||||
import loadKeyboardExtensions from '../mastodon/load_keyboard_extensions';
|
||||
import loadPolyfills from 'mastodon/load_polyfills';
|
||||
import ready from 'mastodon/ready';
|
||||
import { start } from 'mastodon/common';
|
||||
import loadKeyboardExtensions from 'mastodon/load_keyboard_extensions';
|
||||
import 'cocoon-js-vanilla';
|
||||
|
||||
start();
|
||||
|
@ -25,16 +26,16 @@ window.addEventListener('message', e => {
|
|||
});
|
||||
|
||||
function main() {
|
||||
const IntlMessageFormat = require('intl-messageformat').default;
|
||||
const { timeAgoString } = require('../mastodon/components/relative_timestamp');
|
||||
const { delegate } = require('@rails/ujs');
|
||||
const emojify = require('../mastodon/features/emoji/emoji').default;
|
||||
const { getLocale } = require('../mastodon/locales');
|
||||
const { delegate } = require('@rails/ujs');
|
||||
const { createBrowserHistory } = require('history');
|
||||
const { default: IntlMessageFormat } = require('intl-messageformat');
|
||||
const { createRoot } = require('react-dom/client');
|
||||
const Rellax = require('rellax');
|
||||
const { timeAgoString } = require('mastodon/components/relative_timestamp');
|
||||
const { default: emojify } = require('mastodon/features/emoji/emoji');
|
||||
const { getLocale } = require('mastodon/locales');
|
||||
|
||||
const { messages } = getLocale();
|
||||
const React = require('react');
|
||||
const ReactDOM = require('react-dom');
|
||||
const Rellax = require('rellax');
|
||||
const { createBrowserHistory } = require('history');
|
||||
|
||||
const scrollToDetailedStatus = () => {
|
||||
const history = createBrowserHistory();
|
||||
|
@ -99,8 +100,9 @@ function main() {
|
|||
});
|
||||
|
||||
const content = document.createElement('div');
|
||||
const root = createRoot(content);
|
||||
|
||||
ReactDOM.render(<MediaContainer locale={locale} components={reactComponents} />, content);
|
||||
root.render(<MediaContainer locale={locale} components={reactComponents} />);
|
||||
document.body.appendChild(content);
|
||||
scrollToDetailedStatus();
|
||||
})
|
||||
|
|
|
@ -1,23 +1,27 @@
|
|||
import './public-path';
|
||||
import loadPolyfills from '../mastodon/load_polyfills';
|
||||
import { start } from '../mastodon/common';
|
||||
|
||||
import loadPolyfills from 'mastodon/load_polyfills';
|
||||
import { start } from 'mastodon/common';
|
||||
|
||||
start();
|
||||
|
||||
function loaded() {
|
||||
const ComposeContainer = require('../mastodon/containers/compose_container').default;
|
||||
const React = require('react');
|
||||
const ReactDOM = require('react-dom');
|
||||
const { createRoot } = require('react-dom/client');
|
||||
const { default: ComposeContainer } = require('mastodon/containers/compose_container');
|
||||
|
||||
const mountNode = document.getElementById('mastodon-compose');
|
||||
|
||||
if (mountNode !== null) {
|
||||
const root = createRoot(mountNode);
|
||||
const props = JSON.parse(mountNode.getAttribute('data-props'));
|
||||
ReactDOM.render(<ComposeContainer {...props} />, mountNode);
|
||||
|
||||
root.render(<ComposeContainer {...props} />);
|
||||
}
|
||||
}
|
||||
|
||||
function main() {
|
||||
const ready = require('../mastodon/ready').default;
|
||||
const { default: ready }= require('mastodon/ready');
|
||||
|
||||
ready(loaded);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue