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

feat: deprecate support for 15, support react 16 features #1107

Merged
merged 4 commits into from
Dec 21, 2019

Conversation

acao
Copy link
Member

@acao acao commented Dec 16, 2019

  • use UNSAFE_ for one componentWillUpdateProps
  • refactor another componentWillUpdateProps via @ryan-m-walker's PR
  • deprecate peer resolution for react 15
  • dev dependencies bumped to react 16
  • react-test-renderer and enzyme bumped to react 16
  • add test coverage via @ryan-m-walker's PR as well, as codecov was failing the PR because of a drop in test coverage

BREAKING CHANGE: Deprecate support for React 15. Please use React 16.8 or greater for hooks support.

thanks @ryan-m-walker for doing most of this!

@acao acao force-pushed the feat/deprecate-react-15 branch from 27ced8e to a2d38e3 Compare December 16, 2019 22:08
- use UNSAFE_ for one componentWillUpdateProps
- refact for another componentWillUpdateProps
- deprecate peer resolution for react 15
- dev dependencies bumped to react 16
- react-test-renderer and enzyme bumped to react 16

Created-By: @ryan-m-walker, @acao
BREAKING CHANGE: Deprecate support for React 15. Please use React 16.8 or greater for hooks support.
@acao acao force-pushed the feat/deprecate-react-15 branch from a2d38e3 to 92a4093 Compare December 16, 2019 22:09
@codecov
Copy link

codecov bot commented Dec 16, 2019

Codecov Report

Merging #1107 into master will increase coverage by 1.69%.
The diff coverage is 94.11%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1107      +/-   ##
==========================================
+ Coverage      44%   45.69%   +1.69%     
==========================================
  Files          64       64              
  Lines        3000     3040      +40     
  Branches      650      660      +10     
==========================================
+ Hits         1320     1389      +69     
+ Misses       1409     1399      -10     
+ Partials      271      252      -19
Impacted Files Coverage Δ
packages/graphiql/src/components/QueryHistory.js 70% <100%> (+33.46%) ⬆️
packages/graphiql/src/components/GraphiQL.js 38.99% <80%> (+6.46%) ⬆️
...kages/graphql-language-service-parser/src/Rules.ts 1.12% <0%> (+1.12%) ⬆️
packages/graphiql/src/utility/QueryStore.js 57.57% <0%> (+3.03%) ⬆️
packages/graphiql/src/components/QueryEditor.js 58.33% <0%> (+3.57%) ⬆️
packages/graphiql/src/utility/fillLeafs.js 4.91% <0%> (+4.91%) ⬆️
packages/graphiql/src/components/ExecuteButton.js 45% <0%> (+5%) ⬆️
packages/graphiql/src/components/VariableEditor.js 58.73% <0%> (+6.34%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update de4005b...e1b6ebb. Read the comment docs.

@@ -114,6 +89,22 @@ export class QueryHistory extends React.Component {
);
}

updateHistory = (query, variables, operationName) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed in other areas that public methods were marked with a Public API comment which I didn't add here. Could you add it in for me?

e.g.:

Copy link
Member Author

Choose a reason for hiding this comment

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

sure yes! we are about to deprecate this “plugin api” possibly

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah I figured this would go away once we moved to more React 16 patterns anyways but good to make it clear and consistent until then

Copy link
Member Author

Choose a reason for hiding this comment

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

yep! this reminded me i need to add a deprecation notice

@acao acao requested a review from a team December 17, 2019 15:57
@acao
Copy link
Member Author

acao commented Dec 17, 2019

@ryan-m-walker this increases the test coverage for GraphiQL itself by almost 6%, awesome!

Copy link
Member

@benjie benjie left a comment

Choose a reason for hiding this comment

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

This seems to be removing support for React 15 rather than deprecating it. If that's the intent, please can you rewrite the PR title and description to make this clear. If it's not then I think we're going to need to be very careful about some of these changes.

'GraphiQL 0.18.0 and after is not compatible with React 15 or below.',
'If you are using a CDN source (jsdelivr, unpkg, etc), follow this example:',
'https://github.com/graphql/graphiql/blob/master/examples/graphiql-cdn/index.html#L49',
].join('\n'),
Copy link
Member

Choose a reason for hiding this comment

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

This error is misleading; e.g. if they were to use React 17 or 18 in the future.

Copy link
Member Author

Choose a reason for hiding this comment

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

we will likely remove this before react 17. i can add a todo for that

// eslint-disable-next-line no-console
const logger = console.log;

if (!React.version || !React.version.indexOf('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.

Is React.version a public API? I couldn't find it in the React docs (didn't look for long though)

Copy link
Member Author

Choose a reason for hiding this comment

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

yes it’s widely used

Copy link
Member Author

Choose a reason for hiding this comment

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

9674C3E4-58C7-4A4A-A687-FAF0EAF2C683

from very early on its been an available APi!

@acao acao changed the title feat: deprecate react 15 support, support react 16 features feat: deprecate support for 15, support react 16 features Dec 17, 2019
@acao
Copy link
Member Author

acao commented Dec 17, 2019

@benjie after this PR, GraphiQL will not work with React 15, and we will soon use hooks which means 16.8 will be the minimum

@acao acao merged commit bc4b6fc into master Dec 21, 2019
@acao acao deleted the feat/deprecate-react-15 branch December 28, 2019 22:21
@acao acao added this to the GraphiQL-1.0.0-beta milestone Mar 14, 2020
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