Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump major versions of client dependencies #529

Merged
merged 10 commits into from
Aug 11, 2023
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React from 'react';
import PropTypes from 'prop-types';
import Immutable from 'immutable';
import _ from 'lodash';
import BaseComponent from 'libs/components/BaseComponent';
import { injectIntl } from 'react-intl';
import BaseComponent from 'libs/components/BaseComponent';
Copy link
Contributor

Choose a reason for hiding this comment

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

It's just a linting issue.

import SelectLanguage from 'libs/i18n/selectLanguage';
import { defaultMessages, defaultLocale } from 'libs/i18n/default';
import CommentForm from './CommentForm/CommentForm';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// The 0.5s must correspond to the 500s in:
// client/app/bundles/comments/components/CommentBox/CommentList.jsx:58
.elementEnter {
opacity: 0.01;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ export default class CommentList extends BaseComponent {
const commentNodes = $$comments.map(($$comment, index) => {
const nodeRef = React.createRef(null);
return (
// `key` is a React-specific concept and is not mandatory for the
// purpose of this tutorial. if you're curious, see more here:
// http://facebook.github.io/react/docs/multiple-components.html#dynamic-children
<CSSTransition
key={$$comment.get('id') || index}
Copy link
Contributor

Choose a reason for hiding this comment

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

I am concerned that this is a good key. Though it works in our case I think it is better to make ids like comment_123.

nodeRef={nodeRef}
Expand All @@ -74,7 +71,7 @@ export default class CommentList extends BaseComponent {
// For animation with TransitionGroup
// https://reactcommunity.org/react-transition-group/transition-group
// The 500 must correspond to the 0.5s in:
// client/app/bundles/comments/components/CommentBox/CommentBox.module.scss:6
// client/app/bundles/comments/components/CommentBox/CommentBox.module.scss:8
return (
<div>
{this.errorWarning()}
Expand Down
5 changes: 5 additions & 0 deletions client/app/controllers/comments_controller.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { Controller } from '@hotwired/stimulus';
import * as ActionCable from '@rails/actioncable';
import * as marked from 'marked';
import { gfmHeadingId } from 'marked-gfm-heading-id';
import { mangle } from 'marked-mangle';

marked.use(gfmHeadingId());
marked.use(mangle());

export default class extends Controller {
static targets = ['commentList', 'commentAuthor', 'commentText', 'commentRefresh', 'alertDiv', 'errorList'];
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@
"fs": false
},
"browserslist": [
"defaults",
">1%",
"last 5 versions",
"safari >= 7",
"Firefox ESR",
"not IE 11"
],
"jest": {
Expand Down
Loading