Skip to content

Consume react dart dual #83

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

Draft
wants to merge 21 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
7633da6
Upgrade to @testing-library [dom 8, react 12]
aaronlademann-wf Apr 4, 2022
71eb95d
React 18 Support
aaronlademann-wf Apr 4, 2022
52f689b
Update some deps
aaronlademann-wf Oct 22, 2024
2d515e7
new build process
kealjones-wk Oct 22, 2024
222cb47
fix bundle undefined error
kealjones-wk Oct 22, 2024
fc3a54c
Enable legacy root by default to support testing/migration
greglittlefield-wf Dec 18, 2024
f7d0bb8
Use newer react-dart branch
greglittlefield-wf Dec 18, 2024
7cde957
Fix analysis errors, revert unnecessary casts
greglittlefield-wf Dec 18, 2024
adfb293
Rebuild after fixing process.env.NODE_ENV substitution
greglittlefield-wf Dec 19, 2024
203f36e
Format
greglittlefield-wf Jan 29, 2025
14889c8
Filter out ReactDOM.render deprecation logs by default
greglittlefield-wf Jan 30, 2025
37c8dde
Track JS lockfile
greglittlefield-wf Feb 5, 2025
cc30b80
Rebuild JS
greglittlefield-wf Feb 5, 2025
94435ac
Add ESM version of current React-17-compatible RTL bundle
greglittlefield-wf Feb 10, 2025
dd1b2c3
Set up build to conditionally use React 17/18 compatible version of RTL
greglittlefield-wf Feb 10, 2025
3eb8f0c
Build JS assets
greglittlefield-wf Feb 10, 2025
39a11c6
Add example for manual testing
greglittlefield-wf Feb 11, 2025
5af2504
Add React version test setup validation test
greglittlefield-wf Feb 11, 2025
fd02c66
Pull in React 17 version for a test build - to be reverted
greglittlefield-wf Feb 11, 2025
dac2b64
Revert "Pull in React 17 version for a test build - to be reverted"
greglittlefield-wf Feb 11, 2025
ea25e6d
use new react-dart dual branch
kealjones-wk Mar 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ targets:
build_web_compilers|entrypoint:
# These are globs for the entrypoints you want to compile.
generate_for:
- example/**
- test/**.browser_test.dart
options:
# List any dart2js specific args here, or omit it.
Expand Down
14 changes: 14 additions & 0 deletions example/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

<!DOCTYPE html>
<html lang="en">
<head>
<title>RTL - React 18</title>
<script src="packages/react/react.js"></script>
<script src="packages/react/react_dom.js"></script>
<script src="packages/react_testing_library/js/react-testing-library.js"></script>
</head>
<body>
<script defer src="main.js"></script>
<script defer src="main.dart.js"></script>
</body>
</html>
28 changes: 28 additions & 0 deletions example/main.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import 'package:react/react.dart' as react;
import 'package:react_testing_library/react_testing_library.dart';
import 'package:react_testing_library/user_event.dart';

main() {
final content = react.button({
'onClick': (_) {
print('clicked');
throw TestException('intentionally thrown during onClick');
},
}, 'Hello World');
final view = render(content, autoTearDown: false);
final button = view.getByRole('button', name: 'Hello World');
try {
UserEvent.click(button);
} catch (e) {
print('Caught exception $e');
}
}

class TestException implements Exception {
final String message;

TestException(this.message);

@override
String toString() => 'TestException: $message';
}
2 changes: 2 additions & 0 deletions example/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
console.log('window.React.version', window.React.version);
console.log('window.rtl', window.rtl);
Loading