File tree Expand file tree Collapse file tree 6 files changed +60
-1
lines changed Expand file tree Collapse file tree 6 files changed +60
-1
lines changed Original file line number Diff line number Diff line change
1
+ set noparent
2
+ file:/tools/OWNERS_VM
3
+ file:/tools/OWNERS_WEB
4
+ file:/OWNERS
Original file line number Diff line number Diff line change
1
+ This package contains experimental dynamic modules API.
2
+
3
+ ## Status: experimental
4
+
5
+ ** NOTE** : This package is currently experimental and not published or
6
+ included in the SDK.
7
+
8
+ Do not take dependency on this package unless you are prepared for
9
+ breaking changes and possibly removal of this code at any point in time.
Original file line number Diff line number Diff line change
1
+ # Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
2
+ # for details. All rights reserved. Use of this source code is governed by a
3
+ # BSD-style license that can be found in the LICENSE file.
4
+
5
+ include : package:lints/recommended.yaml
6
+
7
+ analyzer :
8
+ errors :
9
+ import_internal_library : ignore
Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
2
+ // for details. All rights reserved. Use of this source code is governed by a
3
+ // BSD-style license that can be found in the LICENSE file.
4
+
5
+ import 'dart:typed_data' show Uint8List;
6
+ import 'dart:_internal' as internal;
7
+
8
+ /// Load a dynamic module from [uri] and execute its entry point method.
9
+ ///
10
+ /// Entry point method is a no-argument method annotated with
11
+ /// `@pragma('dyn-module:entry-point')` .
12
+ ///
13
+ /// This API is experimental, can be changed or removed
14
+ /// without a notice.
15
+ ///
16
+ /// Returns a future containing the result of the entry point method.
17
+ Future <Object ?> loadModuleFromUri (Uri uri) =>
18
+ internal.loadDynamicModule (uri: uri);
19
+
20
+ /// Load a dynamic module from [bytes] and execute its entry point method.
21
+ ///
22
+ /// Entry point method is a no-argument method annotated with
23
+ /// `@pragma('dyn-module:entry-point')` .
24
+ ///
25
+ /// This API is experimental, can be changed or removed
26
+ /// without a notice.
27
+ ///
28
+ /// Returns a future containing the result of the entry point method.
29
+ Future <Object ?> loadModuleFromBytes (Uint8List bytes) =>
30
+ internal.loadDynamicModule (bytes: bytes);
Original file line number Diff line number Diff line change
1
+ name : dynamic_modules
2
+ # This package is not intended for consumption on pub.dev. DO NOT publish.
3
+ publish_to : none
4
+
5
+ environment :
6
+ sdk : ' >=3.3.0 <4.0.0'
Original file line number Diff line number Diff line change @@ -347,7 +347,8 @@ abstract class Target {
347
347
bool allowPlatformPrivateLibraryAccess (Uri importer, Uri imported) =>
348
348
importer.isScheme ("dart" ) ||
349
349
(importer.isScheme ("package" ) &&
350
- importer.path.startsWith ("dart_internal/" ));
350
+ (importer.path.startsWith ("dart_internal/" ) ||
351
+ importer.path.startsWith ("dynamic_modules/" )));
351
352
352
353
/// Whether the `native` language extension is supported within the library
353
354
/// with the given import [uri] .
You can’t perform that action at this time.
0 commit comments