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

Update dependencies in examples and bring them up to date #320

Merged
merged 1 commit into from
Oct 30, 2019

Conversation

nateps
Copy link
Contributor

@nateps nateps commented Oct 29, 2019

  • Update dependency versions used in server. Old version of ws has security vulnerabilities and we don't want people copying the old version
  • Use ReconnectingWebSocket in all examples so we demonstrate reconnecting by default
  • React 0.15 => 0.16 and update to more current es6 class style components
  • Use express consistently in all examples

@coveralls
Copy link

Coverage Status

Coverage remained the same at 96.69% when pulling 6142102 on update-examples into 277be09 on master.

players: React.PropTypes.array.isRequired,
selectedPlayerId: React.PropTypes.string
},
function PlayerList(props) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you intentionally leave this as a function to serve as an example of ES5 syntax, instead of converting it to a class like the examples higher up?

Though if it's to serve as an ES5 example, you can't use object destructuring (line 7) and spread syntax (line 14, though that might be ok if React has its own JS expression parser for template strings).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using just a function is how you write "stateless components" in React. In the docs they refer to it as function and class components: https://reactjs.org/docs/components-and-props.html

Here's another link about it: https://dev.to/mcarpenter/react---stateless-vs-stateful-components--5c3m

propTypes: {
selectedPlayer: React.PropTypes.object
},
function PlayerSelector({ selectedPlayer, onAddPoints }) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here, was leaving this a function intentional?

@nateps nateps merged commit c246de5 into master Oct 30, 2019
@nateps nateps deleted the update-examples branch October 30, 2019 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants