pulyaevskiy / firebase-functions-interop

Firebase Functions Interop Library for Dart.
BSD 3-Clause "New" or "Revised" License
191 stars 52 forks source link

NNBD Support #77

Closed SupposedlySam closed 2 years ago

SupposedlySam commented 3 years ago

Resolves #75

Drafting this PR until NNBD is supported in both the node_http and firebase_admin_interop.

TODO in pubspec.yaml:

  1. Remove publish_to
  2. Update dependency to the NNBD supported version of node_http
  3. Update dependency to the NNBD supported version of node_interop
sanekyy commented 2 years ago

🔥 Waiting for merge!

@pulyaevskiy can you revire this PR?

aler commented 2 years ago

@SupposedlySam I cloned https://github.com/SupposedlySam/firebase-functions-interop.git and tried to build sample functions using dart run build_runner build --output=build and got a lot of Error: Null safety features are disabled for this library. errors from dart2js.

➜  functions git:(master) dart run build_runner build --output=build                    
Precompiling executable... (9.8s)
Precompiled build_runner:build_runner.
[INFO] Generating build script completed, took 347ms
[INFO] Precompiling build script... completed, took 5.3s
[WARNING] The package `firebase_functions_interop_test` does not include some required sources in any of its targets (see their build.yaml file).
The missing sources are:
  - $package$
[INFO] Building new asset graph completed, took 736ms
[INFO] Checking for unexpected pre-existing outputs. completed, took 1ms
[INFO] build_node_compilers:entrypoint on node/clear.dart:Running dart2js with --minify --packages=.package-87e2be97884c548f61cad2867e7e0f1c -onode/clear.dart.js node/clear.dart
[INFO] build_node_compilers:entrypoint on node/index.dart:Running dart2js with --minify --packages=.package-cf8c3faa3eef4a1678495274bd4c8979 -onode/index.dart.js node/index.dart
[INFO] build_node_compilers:entrypoint on node/clear.dart:Dart2Js finished with:

Compiled 8,964,359 characters Dart to 6,034 characters JavaScript in 0.47 seconds
Dart file node/clear.dart compiled to JavaScript: node/clear.dart.js

[SEVERE] build_node_compilers:entrypoint on node/index.dart:
Dart2Js finished with:

packages/firebase_functions_interop/firebase_functions_interop.dart:203:25:
Error: Null safety features are disabled for this library.
  final js.EventAuthInfo? auth;
                        ^
packages/firebase_functions_interop/firebase_functions_interop.dart:208:15:
Error: Null safety features are disabled for this library.
  final String? authType;
              ^

I am using Dart SDK version: 2.13.4 (stable) (Wed Jun 23 13:08:41 2021 +0200) on "macos_x64"

SupposedlySam commented 2 years ago

Unfortunately I had to abandon this approach: https://github.com/pulyaevskiy/firebase-functions-interop/issues/75#issuecomment-846615166

Closing this PR. Sorry to lead you astray.