Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2.3k
Issue 480 - Add .map file extension support to dash#478
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
6e8cbb7d02047ce9adb52656e24d481d15f2f39135191b34bc4f4c49File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -359,9 +359,6 @@ def _collect_and_register_resources(self, resources): | ||
| # for cache busting | ||
| def _relative_url_path(relative_package_path='', namespace=''): | ||
| # track the registered packages | ||
| self.registered_paths[namespace].add(relative_package_path) | ||
| module_path = os.path.join( | ||
| os.path.dirname(sys.modules[namespace].__file__), | ||
| relative_package_path) | ||
| @@ -378,11 +375,17 @@ def _relative_url_path(relative_package_path='', namespace=''): | ||
| srcs = [] | ||
| for resource in resources: | ||
| is_dynamic_resource = resource.get('dynamic', False) | ||
| if 'relative_package_path' in resource: | ||
| if isinstance(resource['relative_package_path'], str): | ||
| srcs.append(_relative_url_path(**resource)) | ||
| else: | ||
| for rel_path in resource['relative_package_path']: | ||
| paths = resource['relative_package_path'] | ||
| paths = [paths] if isinstance(paths, str) else paths | ||
| for rel_path in paths: | ||
| self.registered_paths[resource['namespace']]\ | ||
| .add(rel_path) | ||
| if not is_dynamic_resource: | ||
Marc-Andre-Rivet marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| srcs.append(_relative_url_path( | ||
| relative_package_path=rel_path, | ||
| namespace=resource['namespace'] | ||
| @@ -492,7 +495,8 @@ def serve_component_suites(self, package_name, path_in_package_dist): | ||
| mimetype = ({ | ||
| 'js': 'application/JavaScript', | ||
| 'css': 'text/css' | ||
| 'css': 'text/css', | ||
| 'map': 'application/json' | ||
Marc-Andre-Rivet marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| })[path_in_package_dist.split('.')[-1]] | ||
Marc-Andre-Rivet marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| headers = { | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -19,6 +19,8 @@ def _filter_resources(self, all_resources, dev_bundles=False): | ||
| filtered_resources = [] | ||
| for s in all_resources: | ||
| filtered_resource = {} | ||
| if 'dynamic' in s: | ||
| filtered_resource['dynamic'] = s['dynamic'] | ||
ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
| ||
| if 'namespace' in s: | ||
| filtered_resource['namespace'] = s['namespace'] | ||
| if 'external_url' in s and not self.config.serve_locally: | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| __version__ = '0.31.1' | ||
| __version__ = '0.32.0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As suggested, moved the side-effect outside of the path calculator and calling it directly below