Skip to content

Commit 5530a8d

Browse files
Merge pull request #240 from Workiva/2.0.0-dev
CPLAT-4160 v2.0.0 (Dart 2)
2 parents f922d0c + feebb25 commit 5530a8d

File tree

268 files changed

+23177
-6000
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

268 files changed

+23177
-6000
lines changed

.travis.yml

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
language: dart
2-
dist: precise
32
dart:
4-
- "1.24.3"
5-
env:
6-
- DARTIUM_EXPIRATION_TIME="1577836800"
7-
with_content_shell: true
8-
before_install:
9-
- export DISPLAY=:99.0
10-
- ./tool/setup_dartium.sh
11-
- export PATH=$PATH":$PWD"
12-
- sh -e /etc/init.d/xvfb start
13-
- sleep 3 # give xvfb some time to start
3+
- stable
144
script:
15-
- dart ./tool/build.dart
5+
- pub run build_runner build --delete-conflicting-outputs
166
- pub run dart_dev analyze
17-
- pub run dependency_validator --no-fatal-pins -i coverage
18-
- pub run dart_dev test --integration
19-
- ./tool/generate_coverage.sh
20-
- bash <(curl -s https://codecov.io/bash) -f coverage/coverage.lcov
7+
# TODO: Remove ignore on analyzer once the wdesk ecosystem is all on a Dart 2 compat major version and we no longer need a "pinned" dep
8+
- pub run dependency_validator --no-fatal-pins -i coverage,build_web_compilers,analyzer,build_runner,built_value_generator
9+
# run tests on ddc output
10+
- pub run build_runner test --delete-conflicting-outputs -- -P dartdevc
11+
# run tests on dart2js output
12+
- pub run build_runner test -r --delete-conflicting-outputs -- -P dart2js
13+
14+
cache:
15+
directories:
16+
- $HOME/.pub-cache
17+
- $HOME/.dart_tool/build

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,41 @@
11
# OverReact Changelog
22

3+
## 2.0.0
4+
5+
> [Complete `2.0.0` Changeset](https://github.com/Workiva/over_react/compare/1.31.0...2.0.0)
6+
7+
This release adds support for Dart 2 while retaining backwards-compatibility
8+
with Dart 1, **but it requires changes to consumer's component code.**
9+
10+
> Note: If you intend to consume this version of over_react on Dart 1 and Dart 2
11+
> in the same codebase, **do not** remove the `transformers` section from your
12+
> `pubspec.yaml`. This section is ignored on Dart 2, but will still be needed on Dart 1
13+
14+
__Breaking Changes__
15+
16+
* In order to add support for Dart 2, consumers need to update their over_react
17+
component code! Please see our [Dart 2 migration guide](https://github.com/Workiva/over_react/blob/master/doc/dart2_migration.md)
18+
for more information.
19+
20+
We've created a codemod tool that will automatically update your code:
21+
22+
```bash
23+
# On Dart 2.1.0
24+
$ pub global activate over_react_codemod ^1.0.2
25+
26+
# If you need backwards-compatibility with Dart 1:
27+
$ pub global run over_react_codemod:dart2_upgrade --backwards-compat
28+
29+
# Or, if you are okay with dropping Dart 1 support:
30+
$ pub global run over_react_codemod:dart2_upgrade
31+
```
32+
33+
The tool (and additional info) can be found here: https://github.com/Workiva/over_react_codemod/
34+
35+
* Removals:
36+
* `getJsProps()` - use `getProps()` instead
37+
* `$Props` and `$PropKeys` - see the migration guide above
38+
339
## 1.31.0
440
541
> [Complete `1.31.0` Changeset](https://github.com/Workiva/over_react/compare/1.30.2...1.31.0)

CONTRIBUTING.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Contributing
2+
3+
> We are working on a more thorough version of these contributing guidlines. For
4+
> the time being, we've documented our temporary dual-release setup that is
5+
> necessary for supporting Dart 1 and Dart 2 concurrently.
6+
7+
## Dart 1 & Dart 2 Dual-Releases
8+
9+
Long story short, we are unable to maintain a single codebase of over_react that
10+
is compatible with both Dart 1 and Dart 2. Transformers only work on Dart 1 and
11+
builders only work on Dart 2, and we can't maintain the transformer and builder
12+
together due to dependency conflicts.
13+
14+
> For more information on our Dart 2 migration, [see this guide](/doc/dart2_migration.md).
15+
16+
Fortunately, this problem can be shouldered entirely by the maintainers via a
17+
dual-release strategy (credit to the [dart2_constant](https://pub.dartlang.org/packages/dart2_constant)
18+
for the idea). The result is that consumers will depend on a version range of
19+
this library like they normally do and everything will _just work_.
20+
21+
For every _version_ we want to release, we will actually release two releases -
22+
a Dart 1 (transformer) version and a Dart 2 (builder) version. These two
23+
releases will have the same semantic version, but will have unique build
24+
suffixes. The `pub` client will then decide which one to install based on their
25+
`environment.sdk` constraints and the active Dart SDK version.
26+
27+
### Branches
28+
29+
- `master`
30+
- Dart2-only
31+
- Provides a builder
32+
- Environment constraint: `>=2.1.0 <3.0.0`
33+
34+
- `master_dart1`
35+
- Dart1-only
36+
- Provides a transformer
37+
- Environment constraint: `>=1.24.3 <2.0.0`
38+
39+
### Release Process
40+
41+
> Note that these steps are intended to be followed by Workiva employees, and as
42+
> such have some references to internal tooling.
43+
44+
For every release, do the following:
45+
46+
1. Ensure the next release versions exist in MARV:
47+
48+
Name | Branch
49+
---- | ------
50+
over_react 2.x.x-dart1 | master_dart1
51+
over_react 2.x.x | master
52+
53+
1. Trigger the `over_react 2.x.x-dart1` release first and review the PR:
54+
55+
- Ensure the updated `pubspec.yaml` version is correct, including the
56+
`-dart1` suffix.
57+
58+
- Ensure the build passes.
59+
60+
1. Trigger the `over_react 2.x.x` release second and review the PR:
61+
62+
- Ensure the updated `pubspec.yaml` version is correct.
63+
64+
- Ensure the build passes.
65+
66+
- **Add any necessary changelog updates to the Dart 2 version.**
67+
68+
1. **Merge the Dart 1 release first and publish it to pub.**
69+
70+
1. Merge the Dart 2 release second and publish it to pub.
71+
72+
1. Re-recreate the Dart 1 release in MARV (it does not get recreated
73+
automatically like the default release does).

Dockerfile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
1-
FROM google/dart:1.24.3
1+
FROM google/dart:2.1.0
2+
3+
# Expose env vars for git ssh access
4+
ARG GIT_SSH_KEY
5+
ARG KNOWN_HOSTS_CONTENT
6+
# Install SSH keys for git ssh access
7+
RUN mkdir /root/.ssh
8+
RUN echo "$KNOWN_HOSTS_CONTENT" > "/root/.ssh/known_hosts"
9+
RUN echo "$GIT_SSH_KEY" > "/root/.ssh/id_rsa"
10+
RUN chmod 700 /root/.ssh/
11+
RUN chmod 600 /root/.ssh/id_rsa
12+
RUN echo "Setting up ssh-agent for git-based dependencies"
13+
RUN eval "$(ssh-agent -s)" && \
14+
ssh-add /root/.ssh/id_rsa
215

316
WORKDIR /build/
417
ADD pubspec.yaml /build
518
RUN pub get
619
ARG BUILD_ARTIFACTS_AUDIT=/build/pubspec.lock
720
FROM scratch
8-

0 commit comments

Comments
 (0)