-
Notifications
You must be signed in to change notification settings - Fork 3
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
A generator to generate the Worker js
automatically based on the @IsolateManagerWorker()
anotation
#12
Labels
enhancement
New feature or request
Comments
Instead of adding an import and a import 'functions.dart';
import 'package:isolate_manager/isolate_manager.dart';
main() {
IsolateManagerFunction.workerFunction(add);
} |
lamnhan066
changed the title
A generator to generate the Worker
A generator to generate the Worker May 14, 2024
js
automatically based on the @IsolateManagerFunction()
anotationjs
automatically based on the @IsolateManagerWorker()
anotation
lamnhan066
added a commit
that referenced
this issue
Jun 18, 2024
Target dart2wasm failed: ProcessException: Process exited abnormally with exit code 64: *NOTE*: Compilation to WasmGC is experimental. The support may change, or be removed, with no advance notice. Unhandled exception: Null check operator used on a null value #0 SummaryCollector._readReceiver (package:vm/transformations/type_flow/summary_collector.dart:1072) #1 RuntimeTypeTranslatorImpl.visitTypeParameterType (package:vm/transformations/type_flow/summary_collector.dart:2807) #2 TypeParameterType.accept (package:kernel/ast.dart:12638) #3 RuntimeTypeTranslatorImpl.translate (package:vm/transformations/type_flow/summary_collector.dart:2710) #4 SummaryCollector._typeCheck (package:vm/transformations/type_flow/summary_collector.dart:1254) #5 SummaryCollector.visitAsExpression (package:vm/transformations/type_flow/summary_collector.dart:1675) #6 AsExpression.accept (package:kernel/ast.dart:7667) #7 SummaryCollector._visit (package:vm/transformations/type_flow/summary_collector.dart:970) #8 SummaryCollector._visitArguments (package:vm/transformations/type_flow/summary_collector.dart:988) #9 SummaryCollector.visitFunctionInvocation (package:vm/transformations/type_flow/summary_collector.dart:1965) #10 FunctionInvocation.accept (package:kernel/ast.dart:6095) #11 SummaryCollector._visit (package:vm/transformations/type_flow/summary_collector.dart:970) #12 SummaryCollector._visitArguments (package:vm/transformations/type_flow/summary_collector.dart:988) #13 SummaryCollector.visitStaticInvocation (package:vm/transformations/type_flow/summary_collector.dart:2151) #14 StaticInvocation.accept (package:kernel/ast.dart:6608) #15 SummaryCollector._visit (package:vm/transformations/type_flow/summary_collector.dart:970) #16 SummaryCollector.visitReturnStatement (package:vm/transformations/type_flow/summary_collector.dart:2425) #17 ReturnStatement.accept (package:kernel/ast.dart:10206) #18 SummaryCollector._visitWithoutResult (package:vm/transformations/type_flow/summary_collector.dart:973) #19 List.forEach (dart:core-patch/growable_array.dart:416) #20 SummaryCollector.visitBlock (package:vm/transformations/type_flow/summary_collector.dart:2268) #21 Block.accept (package:kernel/ast.dart:9247) #22 SummaryCollector._visitWithoutResult (package:vm/transformations/type_flow/summary_collector.dart:973) #23 SummaryCollector.createSummary (package:vm/transformations/type_flow/summary_collector.dart:834) #24 TypeFlowAnalysis.getSummary (package:vm/transformations/type_flow/analysis.dart:1784) #25 _DirectInvocation._processFunction (package:vm/transformations/type_flow/analysis.dart:398) #26 _DirectInvocation.process (package:vm/transformations/type_flow/analysis.dart:287) #27 _WorkList.processInvocation (package:vm/transformations/type_flow/analysis.dart:1663) #28 _WorkList.process (package:vm/transformations/type_flow/analysis.dart:1606) #29 TypeFlowAnalysis.process (package:vm/transformations/type_flow/analysis.dart:1811) #30 transformComponent (package:vm/transformations/type_flow/transformer.dart:121) #31 compileToModule (package:dart2wasm/compile.dart:156) <asynchronous suspension> #32 generateWasm (package:dart2wasm/generate_wasm.dart:24) <asynchronous suspension> #33 main (file:///Volumes/Work/s/w/ir/x/w/sdk/pkg/dart2wasm/bin/dart2wasm.dart:10)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To Do
build_runner
command.dart run isolate_manager:generate
command.Concept:
This is a function to add 2 integers:
The parameter
add
is optional, the name of the function will be used if it's not specified. To create thejs
inside a subfolder likeworkers
, change the nameadd
toworkers/add
.After running the above command, a temp file will be created with the current file's contents. An import will be added at the beginning and a
main
will be created at the end of the script like this:Then run the
dart compile js "path/to/tempFile.dart" -o "web/add.js" -O4
command.Removes the temp File.
Completed.
The text was updated successfully, but these errors were encountered: