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

fix #103. update dependencies #104

Merged
merged 6 commits into from
Jan 13, 2022
Merged

Conversation

james-anderson
Copy link
Collaborator

Related to #3 update for React 16 and 17
In testing a project using React 16.4 and 17.0, I found that I had to update Babel dependencies and .babelrc files in those projects to get the project to compile with the conduit updates. It is possible it was just the way I went about testing it or that the React 16.4 project had other issues with its dependencies. If it's not just me and the projects I tested with, we may want to include the Babel dependencies in peerDependencies to produce a warning on npm install rather than compile errors when building the project. We would probably want to update the peerDependencies for React (included in this PR) due to the function name change of componentWillReceiveProps to UNSAFE_componentWillReceiveProps in conduit-rxjs-react. I considered including both versions of the function name thinking older versions of React would notice the old name and ignore the new one and newer versions would ignore the old one and use the new one, but React was throwing warnings about the old name since it will still be recognized until v18, so I just replaced it. It seems like the RxJS peerDependencies can stay as-is.

related to #3 update for React 16 and 17
Copy link
Member

@basham basham left a comment

Choose a reason for hiding this comment

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

This is really fantastic work! Do we want to also remove the package-lock.json files in this PR? It seems like it is in scope.

LICENSE.md Outdated
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2019, Indiana University
Copyright (c) 2021, Indiana University
Copy link
Member

Choose a reason for hiding this comment

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

This should stay as 2019. It should be the year in which the project was open sourced, not the current year.

@@ -1,3 +1,4 @@
{
"presets": ["env", "react"]
"plugins": ["@babel/plugin-proposal-object-rest-spread"],
Copy link
Member

Choose a reason for hiding this comment

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

This plugin should already be included in the latest @babel/preset-env. So, try removing it.

Comment on lines 11 to 14
"@babel/core": "7.16.0",
"@babel/plugin-proposal-object-rest-spread": "7.16.0",
"@babel/preset-env": "7.16.4",
"@babel/preset-react": "7.16.0",
Copy link
Member

Choose a reason for hiding this comment

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

There are newer patch versions of these dependencies. Please update.

Comment on lines 11 to 14
"@babel/core": "7.16.0",
"@babel/plugin-proposal-object-rest-spread": "7.16.0",
"@babel/preset-env": "7.16.4",
"@babel/preset-react": "7.16.0",
Copy link
Member

Choose a reason for hiding this comment

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

There are newer patch versions of these dependencies. Please update.

Comment on lines 11 to 14
"@babel/core": "7.16.0",
"@babel/plugin-proposal-object-rest-spread": "7.16.0",
"@babel/preset-env": "7.16.4",
"@babel/preset-react": "7.16.0",
Copy link
Member

Choose a reason for hiding this comment

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

There are newer patch versions of these dependencies. Please update.

Comment on lines 38 to 40
"@babel/core": "7.16.0",
"@babel/plugin-proposal-object-rest-spread": "7.16.0",
"@babel/preset-env": "7.16.4",
Copy link
Member

Choose a reason for hiding this comment

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

There are newer patch versions of these dependencies. Please update.

Comment on lines 39 to 42
"@babel/core": "7.16.0",
"@babel/plugin-proposal-object-rest-spread": "7.16.0",
"@babel/preset-env": "7.16.4",
"@babel/preset-react": "7.16.0",
Copy link
Member

Choose a reason for hiding this comment

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

There are newer patch versions of these dependencies. Please update.

packages/conduit-rxjs-react/package.json Show resolved Hide resolved

1. Updated dependencies to latest version.

2. Updated React lifecycle method name for use with React 16.3 to 18.x. This is a temporary fix as opposed to a more permanent fix discussed in [Issue #3](https://github.com/indiana-university/conduit/issues/3).
Copy link
Member

Choose a reason for hiding this comment

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

Are we sure that it is "to 18.x" and not "to 17.x"? I couldn't find a source one way or another. But it seems odd that the UNSAFE methods would carry over to a second major version.

'router': 'Router',
'rxjs': 'rxjs',
router: 'Router',
rxjs: 'rxjs',
'rxjs/operators': 'rxjs.operators'
Copy link
Member

Choose a reason for hiding this comment

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

As of RxJS v7.2 (2021-07-05):

Operators are all exported at the top level, from "rxjs". From here on out, we encourage top-level imports with RxJS. Importing from rxjs/operators will be deprecated soon.

So, if we upgrade the examples to the latest RxJS, then we can clean up this "externals" line — here and in all the examples. We could also force the minimum RxJS version to be v7.2, if we wanted. It would primarily affect conduit-rxjs-react since it uses operators, while conduit-rxjs does not. But if we force a minimum version on one, we may as well do the same for the other.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

👍 Since we're forcing React updates we might as well also force RxJS updates.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Would it be appropriate to replace the references to rxjs/operators in the CHANGELOG.md files too?

Copy link
Member

Choose a reason for hiding this comment

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

The README files and examples should be updated. But operator imports mentioned in prior releases in the CHANGELOG files should be kept as-is. It should reflect the code at that point in time. This change should be mentioned in the CHANGELOG for this upcoming version.

Copy link
Member

@basham basham Dec 17, 2021

Choose a reason for hiding this comment

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

Since all operators are now a top-level import, I'd have one import line, rather than two.

// Update this:
import { interval } from 'rxjs'
import { map, startWith, switchMap } from 'rxjs/operators'

// To this (organizing imports alphabetically):
import { interval, map, startWith, switchMap } from 'rxjs'

- mention RxJS import change in changelog
- remove max version from React peerDependency for conduit-rxjs-react
Copy link
Member

@basham basham left a comment

Choose a reason for hiding this comment

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

Also:

  1. Merge multiple rxjs imports to one import in all (non-CHANGELOG) MD files. (Thanks for doing it in the JS files.)
  2. Remove package-lock.json files.


2. Updated React lifecycle method name for use with React 16.3 to 17.x. This is a temporary fix as opposed to a more permanent fix discussed in [Issue #3](https://github.com/indiana-university/conduit/issues/3).

3. Switched `rxjs/operators` imports to `rxjs` since they moved to top level in RxJS v7.2.
Copy link
Member

Choose a reason for hiding this comment

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

This could be updated with a direct link.

3. Switched `rxjs/operators` imports to `rxjs` since they moved to top level in [RxJS v7.2](https://github.com/ReactiveX/rxjs/blob/master/CHANGELOG.md#720-2021-07-05).

add package-lock.json to .gitignore
add link to RxJS v7.2 CHANGELOG
Copy link
Member

@basham basham left a comment

Choose a reason for hiding this comment

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

Just a few minor changes to the logs.


2. Updated React lifecycle method name for use with React 16.3 to 17.x. This is a temporary fix as opposed to a more permanent fix discussed in [Issue #3](https://github.com/indiana-university/conduit/issues/3).

3. Switched `rxjs/operators` imports to `rxjs` since they moved to top level in [RxJS v7.2](https://github.com/ReactiveX/rxjs/blob/master/CHANGELOG.md#720-2021-07-05).
Copy link
Member

Choose a reason for hiding this comment

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

I want to be more explicit about the new peer dependency version. Also, make this item 2, rather than item 3 in this log. That way, this conduit-rxjs-react log will start identically to the conduit-rxjs log.

2. Increased minimum peer dependency version of [RxJS to v7.2](https://github.com/ReactiveX/rxjs/blob/master/CHANGELOG.md#720-2021-07-05). Operators are now imported from the top-level `rxjs` module, since importing from `rxjs/operators` will be depreciated soon.

packages/conduit-rxjs/CHANGELOG.md Show resolved Hide resolved
Copy link
Member

@basham basham left a comment

Choose a reason for hiding this comment

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

Also, the examples are broken. The index.html files need updated versions. I'd recommend React be v16.3.0, since that's the minimum version we're asking for. And likewise, RxJS be v7.2.0. Also, note that the bundle folder for RxJS has changed. It's now under dist.

  <script crossorigin src="https://unpkg.com/[email protected]/umd/react.production.min.js"></script>
  <script crossorigin src="https://unpkg.com/[email protected]/umd/react-dom.production.min.js"></script>
  <script crossorigin src="https://unpkg.com/[email protected]/dist/bundles/rxjs.umd.min.js"></script>

@basham
Copy link
Member

basham commented Jan 3, 2022

Once this PR merges, perhaps we do one minor PR to update the publish dates in the change logs. Then we publish. These are all plenty of updates for this next release.

@james-anderson
Copy link
Collaborator Author

@basham, I've got the most recent requested changes done. I'm good with doing a minor PR to set the publish dates just before publishing.

@basham
Copy link
Member

basham commented Jan 12, 2022

@james-anderson The examples all work. It looks good to me. Thanks for all your work on this! I'll leave it to you to merge, whenever you're ready to do so. Do you want to work on the next PR and publish the changes to npm? You should still have the ability to do the publishing, if you want to do that. If not, I can take care of it. Up to you.

@james-anderson
Copy link
Collaborator Author

@basham I can do the publish date PR tomorrow and publish following the CONTRIBUTING.md steps.

@james-anderson james-anderson merged commit 8d98f5d into master Jan 13, 2022
@james-anderson james-anderson deleted the fix/update-dependencies branch January 13, 2022 16:10
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