Skip to content

CPLAT-4304 Expose React Fragments#303

Merged
rmconsole7-wk merged 23 commits into3.1.0-wipfrom
CPLAT-4304-react-fragments
Jun 28, 2019
Merged

CPLAT-4304 Expose React Fragments#303
rmconsole7-wk merged 23 commits into3.1.0-wipfrom
CPLAT-4304-react-fragments

Conversation

@joebingham-wk
Copy link
Contributor

@joebingham-wk joebingham-wk commented Jun 13, 2019

Hold: This PR is reliant upon the interop introduced in react-dart#188 within react-dart. Until it is merged, the CI will fail.

Motivation

React 16 brings with it a common pattern in React for a component to return multiple elements. Fragments let you group a list of children without adding extra nodes to the DOM.

Changes

  • Add aFragment component that can be used to wrap React elements.
  • Update the Component2 examples to use Fragment where possible.
  • Write test coverage

Release Notes

  • Add the Fragment API.

Review

See CONTRIBUTING.md for more details on review types (+1 / QA +1 / +10) and code review process.

Please review:
@aaronlademann-wf @kealjones-wk @greglittlefield-wf @sydneyjodon-wk

QA Checklist

  • Tests were updated and provide good coverage of the changeset and other affected code
  • Manual testing was performed if needed

Merge Checklist

While we perform many automated checks before auto-merging, some manual checks are needed:

  • A Client Platform member has reviewed these changes
  • There are no unaddressed comments - this check can be automated if reviewers use the "Request Changes" feature
  • For release PRs - Version metadata in Rosie comment is correct

@aviary-wf
Copy link

Security Insights

No security relevant content was detected by automated scans.

Action Items

  • Review PR for security impact; comment "security review required" if needed or unsure
  • Verify aviary.yaml coverage of security relevant code

Questions or Comments? Reach out on Slack: #support-infosec.

@joebingham-wk joebingham-wk added the Hold Hold merges label Jun 13, 2019
Copy link
Contributor

@kealjones-wk kealjones-wk 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 nits, overall looks good.

pubspec.yaml Outdated
url: https://github.com/cleandart/react-dart.git
ref: 5.1.0-wip
url: git@github.com:cleandart/react-dart.git
ref: CPLAT-4304-react-fragments
Copy link
Contributor

@kealjones-wk kealjones-wk Jun 17, 2019

Choose a reason for hiding this comment

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

Remember to change this back this before merges

import '../../demo_components.dart';

ReactElement progressBasicDemo() => Dom.div()(
ReactElement progressBasicDemo() => Fragment()(
Copy link
Contributor

Choose a reason for hiding this comment

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

Sick.

..addTestId('DummyButton')
)('oh hai');
}
} No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

#nit always end files with a blank line

Copy link
Contributor

Choose a reason for hiding this comment

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

@sydneyjodon-wk this is a setting in WebStorm you can enable.

pubspec.yaml Outdated
git:
url: https://github.com/cleandart/react-dart.git
ref: 5.1.0-wip
url: git@github.com:cleandart/react-dart.git
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
url: git@github.com:cleandart/react-dart.git
url: https://github.com/cleandart/react-dart.git

This should get CI working again

Copy link
Contributor

@aaronlademann-wf aaronlademann-wf left a comment

Choose a reason for hiding this comment

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

Some formatting issues that need to be addressed - but I thought running ddev format was already set up to use over_react_format?

Copy link
Contributor

@aaronlademann-wf aaronlademann-wf left a comment

Choose a reason for hiding this comment

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

Just some cleanup needed, then I'm ready to plus one @sydneyjodon-wk

implements builder_helpers.UiProps {
// Initialize to a JsBackedMap so that copying can be optimized
// when converting props during ReactElement creation.
// TODO 3.0.0-wip generate JsBackedMap-based implementation used when no backing map is provided, like we do for Component2
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like it is already doing this... so the TODO can be removed.

@@ -0,0 +1,31 @@
import 'package:over_react/src/component_declaration/component_base.dart'
Copy link
Contributor

Choose a reason for hiding this comment

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

This file needs the copyright block:

// Copyright 2019 Workiva Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

@@ -0,0 +1,33 @@
import 'package:over_react/over_react.dart';
Copy link
Contributor

Choose a reason for hiding this comment

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

This file needs the copyright block:

// Copyright 2019 Workiva Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

@@ -0,0 +1,70 @@
// Copyright 2016 Workiva Inc.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Copyright 2016 Workiva Inc.
// Copyright 2019 Workiva Inc.

Copy link
Contributor

@aaronlademann-wf aaronlademann-wf left a comment

Choose a reason for hiding this comment

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

+1

evanweible-wf and others added 2 commits June 27, 2019 08:48
CPLAT-6244: DO NOT MERGE: Upgrade to analyzer 0.36.x and build_web_compilers 2.x
rmconsole-readonly-wk and others added 5 commits June 27, 2019 15:25
RM-53250 RM-53249 Release over_react 2.4.4+dart2
* master:
  Changelog entry for v2.4.4
  over_react_2.4.4+dart2
  Update base image to Dart2.4
  Add dev_dep on build_resolvers.
  Remove coverage dep as it is currently unused.
  Upgrade to analyzer 0.36.x and build_web_compilers 2.x
  Changelog entry for v2.4.3
  over_react_2.4.3+dart2
  Run CI on the dev channel as well.
  Add more detailed warning message
  Fix another typo
  Fix typo
  Warn consumers if part directive is present, but no generations were found
  Update handler chain util tests.
  Reduce callback constant boilerplate
  Add explicit dynamic return types, use new typedef syntax
  Use local methods for better stack traces, add return type to fix lints
  Remove duplicated doc comments, which get inherited
  Remove CallbackUtil generic parameter, use covariant to add chainFromList typing
@kealjones-wk
Copy link
Contributor

+10

Copy link
Contributor

@aaronlademann-wf aaronlademann-wf left a comment

Choose a reason for hiding this comment

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

+1

@kealjones-wk
Copy link
Contributor

@Workiva/release-management-p

@rmconsole7-wk rmconsole7-wk merged commit aa2d12e into 3.1.0-wip Jun 28, 2019
@rmconsole7-wk rmconsole7-wk deleted the CPLAT-4304-react-fragments branch June 28, 2019 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.