Update Angular embedding sample (#2147)

- Replace `package:js` usage with `dart:js_interop`
- Remove and ignore `package-lock.json` since it keeps causing security
warnings: https://github.com/flutter/samples/security/dependabot. It's
not necessary for this sample and the constraints already present in the
`package.json`.
- Update to Angular 17.1
pull/2149/head
Parker Lougheed 10 months ago committed by GitHub
parent 7dcea5e114
commit 81512c626d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -7,6 +7,7 @@
/bazel-out /bazel-out
# Node # Node
package-lock.json
/node_modules /node_modules
npm-debug.log npm-debug.log
yarn-error.log yarn-error.log

@ -1,7 +1,8 @@
/// Exposes useful functions to interop with JS from our Flutter app. /// Exposes useful functions to interop with JS from our Flutter app.
library example_js_interop; library;
export 'js_interop/counter_state_manager.dart'; export 'js_interop/counter_state_manager.dart';
export 'js_interop/helper.dart' show broadcastAppEvent; export 'js_interop/helper.dart' show broadcastAppEvent;
export 'package:js/js_util.dart' show createDartExport; // Replace with createJSInteropWrapper when updating to Dart 3.3.
export 'dart:js_util' show createDartExport;

@ -1,5 +1,6 @@
import 'dart:js_interop';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:js/js.dart';
enum DemoScreen { enum DemoScreen {
counter('counter'), counter('counter'),

@ -1,9 +1,8 @@
import 'dart:js_interop';
import 'package:js/js.dart';
import 'package:js/js_util.dart' as js_util;
/// This is a little bit of JS-interop code so this Flutter app can dispatch /// This is a little bit of JS-interop code so this Flutter app can dispatch
/// a custom JS event (to be deprecated by package:web) /// a custom JS event (to be deprecated by package:web)
library;
import 'dart:js_interop';
@JS('CustomEvent') @JS('CustomEvent')
@staticInterop @staticInterop
@ -12,8 +11,7 @@ class DomCustomEvent {
external factory DomCustomEvent.withOptions(JSString type, JSAny options); external factory DomCustomEvent.withOptions(JSString type, JSAny options);
factory DomCustomEvent._(String type, [Object? options]) { factory DomCustomEvent._(String type, [Object? options]) {
if (options != null) { if (options != null) {
return DomCustomEvent.withOptions( return DomCustomEvent.withOptions(type.toJS, options.jsify()!);
type.toJS, js_util.jsify(options) as JSAny);
} }
return DomCustomEvent.withType(type.toJS); return DomCustomEvent.withType(type.toJS);
} }

@ -7,10 +7,8 @@ environment:
sdk: ^3.2.0 sdk: ^3.2.0
dependencies: dependencies:
cupertino_icons: ^1.0.2
flutter: flutter:
sdk: flutter sdk: flutter
js: ^0.7.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:

File diff suppressed because it is too large Load Diff

@ -11,24 +11,24 @@
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
"@angular/animations": "^17.0.0", "@angular/animations": "^17.1.0",
"@angular/cdk": "^17.0.0", "@angular/cdk": "^17.1.0",
"@angular/common": "^17.0.0", "@angular/common": "^17.1.0",
"@angular/compiler": "^17.0.0", "@angular/compiler": "^17.1.0",
"@angular/core": "^17.0.0", "@angular/core": "^17.1.0",
"@angular/forms": "^17.0.0", "@angular/forms": "^17.1.0",
"@angular/material": "^17.0.0", "@angular/material": "^17.1.0",
"@angular/platform-browser": "^17.0.0", "@angular/platform-browser": "^17.1.0",
"@angular/platform-browser-dynamic": "^17.0.0", "@angular/platform-browser-dynamic": "^17.1.0",
"@angular/router": "^17.0.0", "@angular/router": "^17.1.0",
"rxjs": "~7.8.1", "rxjs": "~7.8.1",
"tslib": "^2.6.2", "tslib": "^2.6.2",
"zone.js": "~0.14.2" "zone.js": "~0.14.3"
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "^17.0.0", "@angular-devkit/build-angular": "^17.1.1",
"@angular/cli": "~17.0.0", "@angular/cli": "~17.1.1",
"@angular/compiler-cli": "^17.0.0", "@angular/compiler-cli": "^17.1.0",
"@types/jasmine": "~5.1.0", "@types/jasmine": "~5.1.0",
"jasmine-core": "~5.1.1", "jasmine-core": "~5.1.1",
"karma": "~6.4.2", "karma": "~6.4.2",
@ -36,7 +36,7 @@
"karma-coverage": "~2.2.0", "karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0", "karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0", "karma-jasmine-html-reporter": "~2.1.0",
"typescript": "~5.2.2" "typescript": "~5.3.3"
}, },
"sideEffects": false "sideEffects": false
} }

Loading…
Cancel
Save