Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Register
Sign in
Toggle navigation
Menu
Open sidebar
Tiger Ton
mastodon
Commits
83b21e90
Commit
83b21e90
authored
3 years ago
by
Yamagishi Kazutoshi
Committed by
GitHub
2 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Bump React from 16.14.0 to 18.1.0
parent
f804c009
Changes
226
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
app/javascript/mastodon/components/blurhash.js
+2
-2
app/javascript/mastodon/components/blurhash.js
app/javascript/mastodon/components/button.js
+2
-2
app/javascript/mastodon/components/button.js
app/javascript/mastodon/components/check.js
+0
-2
app/javascript/mastodon/components/check.js
app/javascript/mastodon/components/column.js
+2
-2
app/javascript/mastodon/components/column.js
app/javascript/mastodon/components/column_back_button.js
+2
-2
app/javascript/mastodon/components/column_back_button.js
app/javascript/mastodon/components/column_back_button_slim.js
+0
-1
...javascript/mastodon/components/column_back_button_slim.js
app/javascript/mastodon/components/column_header.js
+2
-2
app/javascript/mastodon/components/column_header.js
app/javascript/mastodon/components/common_counter.js
+0
-1
app/javascript/mastodon/components/common_counter.js
app/javascript/mastodon/components/display_name.js
+2
-2
app/javascript/mastodon/components/display_name.js
app/javascript/mastodon/components/domain.js
+0
-1
app/javascript/mastodon/components/domain.js
app/javascript/mastodon/components/dropdown_menu.js
+6
-6
app/javascript/mastodon/components/dropdown_menu.js
app/javascript/mastodon/components/edited_timestamp/index.js
+2
-2
app/javascript/mastodon/components/edited_timestamp/index.js
app/javascript/mastodon/components/error_boundary.js
+2
-2
app/javascript/mastodon/components/error_boundary.js
app/javascript/mastodon/components/gifv.js
+3
-3
app/javascript/mastodon/components/gifv.js
app/javascript/mastodon/components/hashtag.js
+3
-3
app/javascript/mastodon/components/hashtag.js
app/javascript/mastodon/components/icon.js
+2
-2
app/javascript/mastodon/components/icon.js
app/javascript/mastodon/components/icon_button.js
+5
-5
app/javascript/mastodon/components/icon_button.js
app/javascript/mastodon/components/icon_with_badge.js
+0
-1
app/javascript/mastodon/components/icon_with_badge.js
app/javascript/mastodon/components/inline_account.js
+2
-2
app/javascript/mastodon/components/inline_account.js
app/javascript/mastodon/components/intersection_observer_article.js
+4
-4
...ript/mastodon/components/intersection_observer_article.js
with
41 additions
and
47 deletions
+41
-47
app/javascript/mastodon/components/blurhash.js
+
2
-
2
View file @
83b21e90
// @ts-check
import
{
decode
}
from
'
blurhash
'
;
import
React
,
{
useRef
,
useEffect
}
from
'
react
'
;
import
{
memo
,
useRef
,
useEffect
}
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
/**
...
...
@@ -62,4 +62,4 @@ Blurhash.propTypes = {
dummy
:
PropTypes
.
bool
,
};
export
default
React
.
memo
(
Blurhash
);
export
default
memo
(
Blurhash
);
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/button.js
+
2
-
2
View file @
83b21e90
import
React
from
'
react
'
;
import
{
PureComponent
}
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
classNames
from
'
classnames
'
;
export
default
class
Button
extends
React
.
PureComponent
{
export
default
class
Button
extends
PureComponent
{
static
propTypes
=
{
text
:
PropTypes
.
node
,
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/check.js
+
0
-
2
View file @
83b21e90
import
React
from
'
react
'
;
const
Check
=
()
=>
(
<
svg
width
=
'
14
'
height
=
'
11
'
viewBox
=
'
0 0 14 11
'
>
<
path
d
=
'
M11.264 0L5.26 6.004 2.103 2.847 0 4.95l5.26 5.26 8.108-8.107L11.264 0
'
fill
=
'
currentColor
'
fillRule
=
'
evenodd
'
/>
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/column.js
+
2
-
2
View file @
83b21e90
import
React
from
'
react
'
;
import
{
PureComponent
}
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
{
supportsPassiveEvents
}
from
'
detect-passive-events
'
;
import
{
scrollTop
}
from
'
../scroll
'
;
export
default
class
Column
extends
React
.
PureComponent
{
export
default
class
Column
extends
PureComponent
{
static
propTypes
=
{
children
:
PropTypes
.
node
,
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/column_back_button.js
+
2
-
2
View file @
83b21e90
import
React
from
'
react
'
;
import
{
PureComponent
}
from
'
react
'
;
import
{
FormattedMessage
}
from
'
react-intl
'
;
import
PropTypes
from
'
prop-types
'
;
import
Icon
from
'
mastodon/components/icon
'
;
import
{
createPortal
}
from
'
react-dom
'
;
export
default
class
ColumnBackButton
extends
React
.
PureComponent
{
export
default
class
ColumnBackButton
extends
PureComponent
{
static
contextTypes
=
{
router
:
PropTypes
.
object
,
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/column_back_button_slim.js
+
0
-
1
View file @
83b21e90
import
React
from
'
react
'
;
import
{
FormattedMessage
}
from
'
react-intl
'
;
import
ColumnBackButton
from
'
./column_back_button
'
;
import
Icon
from
'
mastodon/components/icon
'
;
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/column_header.js
+
2
-
2
View file @
83b21e90
import
React
from
'
react
'
;
import
{
PureComponent
}
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
{
createPortal
}
from
'
react-dom
'
;
import
classNames
from
'
classnames
'
;
...
...
@@ -13,7 +13,7 @@ const messages = defineMessages({
});
export
default
@
injectIntl
class
ColumnHeader
extends
React
.
PureComponent
{
class
ColumnHeader
extends
PureComponent
{
static
contextTypes
=
{
router
:
PropTypes
.
object
,
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/common_counter.js
+
0
-
1
View file @
83b21e90
// @ts-check
import
React
from
'
react
'
;
import
{
FormattedMessage
}
from
'
react-intl
'
;
/**
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/display_name.js
+
2
-
2
View file @
83b21e90
import
React
from
'
react
'
;
import
{
PureComponent
}
from
'
react
'
;
import
ImmutablePropTypes
from
'
react-immutable-proptypes
'
;
import
PropTypes
from
'
prop-types
'
;
import
{
autoPlayGif
}
from
'
mastodon/initial_state
'
;
export
default
class
DisplayName
extends
React
.
PureComponent
{
export
default
class
DisplayName
extends
PureComponent
{
static
propTypes
=
{
account
:
ImmutablePropTypes
.
map
.
isRequired
,
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/domain.js
+
0
-
1
View file @
83b21e90
import
React
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
IconButton
from
'
./icon_button
'
;
import
{
defineMessages
,
injectIntl
}
from
'
react-intl
'
;
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/dropdown_menu.js
+
6
-
6
View file @
83b21e90
import
React
from
'
react
'
;
import
{
Children
,
PureComponent
,
cloneElement
}
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
ImmutablePropTypes
from
'
react-immutable-proptypes
'
;
import
IconButton
from
'
./icon_button
'
;
...
...
@@ -12,7 +12,7 @@ import { CircularProgress } from 'mastodon/components/loading_indicator';
const
listenerOptions
=
supportsPassiveEvents
?
{
passive
:
true
}
:
false
;
let
id
=
0
;
class
DropdownMenu
extends
React
.
PureComponent
{
class
DropdownMenu
extends
PureComponent
{
static
contextTypes
=
{
router
:
PropTypes
.
object
,
...
...
@@ -178,7 +178,7 @@ class DropdownMenu extends React.PureComponent {
}
export
default
class
Dropdown
extends
React
.
PureComponent
{
export
default
class
Dropdown
extends
PureComponent
{
static
contextTypes
=
{
router
:
PropTypes
.
object
,
...
...
@@ -313,7 +313,7 @@ export default class Dropdown extends React.PureComponent {
const
open
=
this
.
state
.
id
===
openDropdownId
;
const
button
=
children
?
React
.
cloneElement
(
React
.
Children
.
only
(
children
),
{
const
button
=
children
?
cloneElement
(
Children
.
only
(
children
),
{
ref
:
this
.
setTargetRef
,
onClick
:
this
.
handleClick
,
onMouseDown
:
this
.
handleMouseDown
,
...
...
@@ -335,7 +335,7 @@ export default class Dropdown extends React.PureComponent {
);
return
(
<
React
.
Fragment
>
<>
{
button
}
<
Overlay
show
=
{
open
}
placement
=
{
dropdownPlacement
}
target
=
{
this
.
findTarget
}
>
...
...
@@ -350,7 +350,7 @@ export default class Dropdown extends React.PureComponent {
onItemClick
=
{
this
.
handleItemClick
}
/
>
<
/Overlay
>
<
/
React.Fragment
>
<
/
>
);
}
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/edited_timestamp/index.js
+
2
-
2
View file @
83b21e90
import
React
from
'
react
'
;
import
{
PureComponent
}
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
{
FormattedMessage
,
injectIntl
}
from
'
react-intl
'
;
import
Icon
from
'
mastodon/components/icon
'
;
...
...
@@ -18,7 +18,7 @@ const mapDispatchToProps = (dispatch, { statusId }) => ({
export
default
@
connect
(
null
,
mapDispatchToProps
)
@
injectIntl
class
EditedTimestamp
extends
React
.
PureComponent
{
class
EditedTimestamp
extends
PureComponent
{
static
propTypes
=
{
statusId
:
PropTypes
.
string
.
isRequired
,
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/error_boundary.js
+
2
-
2
View file @
83b21e90
import
React
from
'
react
'
;
import
{
PureComponent
}
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
{
FormattedMessage
}
from
'
react-intl
'
;
import
{
version
,
source_url
}
from
'
mastodon/initial_state
'
;
import
StackTrace
from
'
stacktrace-js
'
;
export
default
class
ErrorBoundary
extends
React
.
PureComponent
{
export
default
class
ErrorBoundary
extends
PureComponent
{
static
propTypes
=
{
children
:
PropTypes
.
node
,
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/gifv.js
+
3
-
3
View file @
83b21e90
import
React
from
'
react
'
;
import
{
PureComponent
}
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
export
default
class
GIFV
extends
React
.
PureComponent
{
export
default
class
GIFV
extends
PureComponent
{
static
propTypes
=
{
src
:
PropTypes
.
string
.
isRequired
,
...
...
@@ -19,7 +19,7 @@ export default class GIFV extends React.PureComponent {
this
.
setState
({
loading
:
false
});
}
componentWillReceiveProps
(
nextProps
)
{
UNSAFE_
componentWillReceiveProps
(
nextProps
)
{
if
(
nextProps
.
src
!==
this
.
props
.
src
)
{
this
.
setState
({
loading
:
true
});
}
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/hashtag.js
+
3
-
3
View file @
83b21e90
// @ts-check
import
React
from
'
react
'
;
import
{
Component
}
from
'
react
'
;
import
{
Sparklines
,
SparklinesCurve
}
from
'
react-sparklines
'
;
import
{
FormattedMessage
}
from
'
react-intl
'
;
import
PropTypes
from
'
prop-types
'
;
...
...
@@ -9,7 +9,7 @@ import ShortNumber from 'mastodon/components/short_number';
import
Skeleton
from
'
mastodon/components/skeleton
'
;
import
classNames
from
'
classnames
'
;
class
SilentErrorBoundary
extends
React
.
Component
{
class
SilentErrorBoundary
extends
Component
{
static
propTypes
=
{
children
:
PropTypes
.
node
,
...
...
@@ -68,7 +68,7 @@ const Hashtag = ({ name, href, to, people, uses, history, className }) => (
<
div
className
=
{
classNames
(
'
trends__item
'
,
className
)}
>
<
div
className
=
'
trends__item__name
'
>
<
Permalink
href
=
{
href
}
to
=
{
to
}
>
{
name
?
<
React
.
Fragment
>
#
<
span
>
{
name
}
<
/span></
React
.
Fragment
>
:
<
Skeleton
width
=
{
50
}
/>
}
{
name
?
<>
#
<
span
>
{
name
}
<
/span></
>
:
<
Skeleton
width
=
{
50
}
/>
}
<
/Permalink
>
{
typeof
people
!==
'
undefined
'
?
<
ShortNumber
value
=
{
people
}
renderer
=
{
accountsCountRenderer
}
/> : <Skeleton width=
{100}
/
>
}
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/icon.js
+
2
-
2
View file @
83b21e90
import
React
from
'
react
'
;
import
{
PureComponent
}
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
classNames
from
'
classnames
'
;
export
default
class
Icon
extends
React
.
PureComponent
{
export
default
class
Icon
extends
PureComponent
{
static
propTypes
=
{
id
:
PropTypes
.
string
.
isRequired
,
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/icon_button.js
+
5
-
5
View file @
83b21e90
import
React
from
'
react
'
;
import
{
PureComponent
}
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
classNames
from
'
classnames
'
;
import
Icon
from
'
mastodon/components/icon
'
;
import
AnimatedNumber
from
'
mastodon/components/animated_number
'
;
export
default
class
IconButton
extends
React
.
PureComponent
{
export
default
class
IconButton
extends
PureComponent
{
static
propTypes
=
{
className
:
PropTypes
.
string
,
...
...
@@ -44,7 +44,7 @@ export default class IconButton extends React.PureComponent {
deactivate
:
false
,
}
componentWillReceiveProps
(
nextProps
)
{
UNSAFE_
componentWillReceiveProps
(
nextProps
)
{
if
(
!
nextProps
.
animate
)
return
;
if
(
this
.
props
.
active
&&
!
nextProps
.
active
)
{
...
...
@@ -126,9 +126,9 @@ export default class IconButton extends React.PureComponent {
}
let
contents
=
(
<
React
.
Fragment
>
<>
<
Icon
id
=
{
icon
}
fixedWidth
aria
-
hidden
=
'
true
'
/>
{
typeof
counter
!==
'
undefined
'
&&
<
span
className
=
'
icon-button__counter
'
><
AnimatedNumber
value
=
{
counter
}
obfuscate
=
{
obfuscateCount
}
/></
span
>
}
<
/
React.Fragment
>
<
/
>
);
if
(
href
)
{
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/icon_with_badge.js
+
0
-
1
View file @
83b21e90
import
React
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
Icon
from
'
mastodon/components/icon
'
;
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/inline_account.js
+
2
-
2
View file @
83b21e90
import
React
from
'
react
'
;
import
{
PureComponent
}
from
'
react
'
;
import
ImmutablePropTypes
from
'
react-immutable-proptypes
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
makeGetAccount
}
from
'
mastodon/selectors
'
;
...
...
@@ -15,7 +15,7 @@ const makeMapStateToProps = () => {
};
export
default
@
connect
(
makeMapStateToProps
)
class
InlineAccount
extends
React
.
PureComponent
{
class
InlineAccount
extends
PureComponent
{
static
propTypes
=
{
account
:
ImmutablePropTypes
.
map
.
isRequired
,
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/intersection_observer_article.js
+
4
-
4
View file @
83b21e90
import
React
from
'
react
'
;
import
{
cloneElement
,
Component
}
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
scheduleIdleTask
from
'
../features/ui/util/schedule_idle_task
'
;
import
getRectFromEntry
from
'
../features/ui/util/get_rect_from_entry
'
;
...
...
@@ -6,7 +6,7 @@ import getRectFromEntry from '../features/ui/util/get_rect_from_entry';
// Diff these props in the "unrendered" state
const
updateOnPropsForUnrendered
=
[
'
id
'
,
'
index
'
,
'
listLength
'
,
'
cachedHeight
'
];
export
default
class
IntersectionObserverArticle
extends
React
.
Component
{
export
default
class
IntersectionObserverArticle
extends
Component
{
static
propTypes
=
{
intersectionObserverWrapper
:
PropTypes
.
object
.
isRequired
,
...
...
@@ -115,14 +115,14 @@ export default class IntersectionObserverArticle extends React.Component {
data
-
id
=
{
id
}
tabIndex
=
'
0
'
>
{
children
&&
React
.
cloneElement
(
children
,
{
hidden
:
true
})}
{
children
&&
cloneElement
(
children
,
{
hidden
:
true
})}
<
/article
>
);
}
return
(
<
article
ref
=
{
this
.
handleRef
}
aria
-
posinset
=
{
index
+
1
}
aria
-
setsize
=
{
listLength
}
data
-
id
=
{
id
}
tabIndex
=
'
0
'
>
{
children
&&
React
.
cloneElement
(
children
,
{
hidden
:
false
})}
{
children
&&
cloneElement
(
children
,
{
hidden
:
false
})}
<
/article
>
);
}
...
...
This diff is collapsed.
Click to expand it.
Prev
1
2
3
4
5
6
…
12
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets