@@ -65,8 +65,9 @@ def import_js_from_url(
6565 allow_children:
6666 Whether or not these components can have children.
6767 """
68- if url in _URL_WEB_MODULE_CACHE :
69- module = _URL_WEB_MODULE_CACHE [url ]
68+ key = f"{ url } { resolve_exports } { resolve_exports_depth } { unmount_before_update } "
69+ if key in _URL_WEB_MODULE_CACHE :
70+ module = _URL_WEB_MODULE_CACHE [key ]
7071 else :
7172 module = _module_from_url (
7273 url ,
@@ -75,7 +76,7 @@ def import_js_from_url(
7576 resolve_exports_depth = resolve_exports_depth ,
7677 unmount_before_update = unmount_before_update ,
7778 )
78- _URL_WEB_MODULE_CACHE [url ] = module
79+ _URL_WEB_MODULE_CACHE [key ] = module
7980 return _vdom_from_web_module (module , export_names , fallback , allow_children )
8081
8182
@@ -117,8 +118,9 @@ def import_js_from_file(
117118 allow_children:
118119 Whether or not these components can have children.
119120 """
120- if name in _FILE_WEB_MODULE_CACHE :
121- module = _FILE_WEB_MODULE_CACHE [name ]
121+ key = f"{ name } { resolve_exports } { resolve_exports_depth } { unmount_before_update } "
122+ if key in _FILE_WEB_MODULE_CACHE :
123+ module = _FILE_WEB_MODULE_CACHE [key ]
122124 else :
123125 module = _module_from_file (
124126 name ,
@@ -129,7 +131,7 @@ def import_js_from_file(
129131 unmount_before_update = unmount_before_update ,
130132 symlink = symlink ,
131133 )
132- _FILE_WEB_MODULE_CACHE [name ] = module
134+ _FILE_WEB_MODULE_CACHE [key ] = module
133135 return _vdom_from_web_module (module , export_names , fallback , allow_children )
134136
135137
@@ -168,8 +170,9 @@ def import_js_from_string(
168170 allow_children:
169171 Whether or not these components can have children.
170172 """
171- if name in _STRING_WEB_MODULE_CACHE :
172- module = _STRING_WEB_MODULE_CACHE [name ]
173+ key = f"{ name } { resolve_exports } { resolve_exports_depth } { unmount_before_update } "
174+ if key in _STRING_WEB_MODULE_CACHE :
175+ module = _STRING_WEB_MODULE_CACHE [key ]
173176 else :
174177 module = _module_from_string (
175178 name ,
@@ -179,7 +182,7 @@ def import_js_from_string(
179182 resolve_exports_depth = resolve_exports_depth ,
180183 unmount_before_update = unmount_before_update ,
181184 )
182- _STRING_WEB_MODULE_CACHE [name ] = module
185+ _STRING_WEB_MODULE_CACHE [key ] = module
183186 return _vdom_from_web_module (module , export_names , fallback , allow_children )
184187
185188
0 commit comments