@@ -38,7 +38,7 @@ def install(
38
38
ignore_installed : bool = False ,
39
39
fallback : Optional [str ] = None ,
40
40
# dynamically installed modules probably won't have a mount so we default to False
41
- has_mount : bool = False ,
41
+ exports_mount : bool = False ,
42
42
) -> Union [Module , List [Module ]]:
43
43
return_one = False
44
44
if isinstance (packages , str ):
@@ -51,10 +51,11 @@ def install(
51
51
manage .build (packages , clean_build = False )
52
52
53
53
if return_one :
54
- return Module (pkg_names [0 ], fallback = fallback , has_mount = has_mount )
54
+ return Module (pkg_names [0 ], fallback = fallback , exports_mount = exports_mount )
55
55
else :
56
56
return [
57
- Module (pkg , fallback = fallback , has_mount = has_mount ) for pkg in pkg_names
57
+ Module (pkg , fallback = fallback , exports_mount = exports_mount )
58
+ for pkg in pkg_names
58
59
]
59
60
60
61
@@ -74,7 +75,7 @@ class Module:
74
75
``./some-other-installed-module.js``.
75
76
fallack:
76
77
What to display while the modules is being loaded.
77
- has_mount :
78
+ exports_mount :
78
79
Whether the module exports a ``mount`` function that allows components to
79
80
be mounted directly to the DOM. Such a mount function enables greater
80
81
flexibility in how custom components can be implemented.
@@ -90,7 +91,7 @@ class Module:
90
91
"url" ,
91
92
"fallback" ,
92
93
"exports" ,
93
- "has_mount " ,
94
+ "exports_mount " ,
94
95
"check_exports" ,
95
96
"_export_names" ,
96
97
)
@@ -100,11 +101,11 @@ def __init__(
100
101
url_or_name : str ,
101
102
source_file : Optional [Union [str , Path ]] = None ,
102
103
fallback : Optional [str ] = None ,
103
- has_mount : bool = False ,
104
+ exports_mount : bool = False ,
104
105
check_exports : bool = True ,
105
106
) -> None :
106
107
self .fallback = fallback
107
- self .has_mount = has_mount
108
+ self .exports_mount = exports_mount
108
109
self .check_exports = check_exports
109
110
110
111
self .exports : Set [str ] = set ()
@@ -126,9 +127,9 @@ def __init__(
126
127
else :
127
128
raise ValueError (f"{ url_or_name !r} is not installed or is not a URL" )
128
129
129
- if check_exports and has_mount and "mount" not in self .exports :
130
+ if check_exports and exports_mount and "mount" not in self .exports :
130
131
raise ValueError (
131
- f"Module { url_or_name !r} does not export 'mount' but has_mount =True"
132
+ f"Module { url_or_name !r} does not export 'mount' but exports_mount =True"
132
133
)
133
134
134
135
def declare (
@@ -157,7 +158,7 @@ def declare(
157
158
self .url ,
158
159
name ,
159
160
has_children = has_children ,
160
- has_mount = self .has_mount ,
161
+ exports_mount = self .exports_mount ,
161
162
fallback = fallback or self .fallback ,
162
163
)
163
164
@@ -190,10 +191,10 @@ def __init__(
190
191
module : str ,
191
192
name : str ,
192
193
has_children : bool = True ,
193
- has_mount : bool = False ,
194
+ exports_mount : bool = False ,
194
195
fallback : Optional [str ] = None ,
195
196
) -> None :
196
- if IDOM_CLIENT_MODULES_MUST_HAVE_MOUNT .current and not has_mount :
197
+ if IDOM_CLIENT_MODULES_MUST_HAVE_MOUNT .current and not exports_mount :
197
198
# This check is not perfect since IDOM_CLIENT_MODULES_MUST_HAVE_MOUNT can be
198
199
# set after Import instances have been constructed. A more comprehensive
199
200
# check can be introduced if that is shown to be an issue in practice.
@@ -203,7 +204,7 @@ def __init__(
203
204
self ._name = name
204
205
self ._constructor = make_vdom_constructor (name , has_children )
205
206
self ._import_source = ImportSourceDict (
206
- source = module , fallback = fallback , hasMount = has_mount
207
+ source = module , fallback = fallback , exportsMount = exports_mount
207
208
)
208
209
209
210
def __call__ (
0 commit comments