flexx
flexx copied to clipboard
Allow .map assets
Hi!
I'm very new to flexx so maybe I'm completely on the wrong track ;)
I was trying to use interact.js with flexx by loading it with the associate_asset
function.
The library includes a source mapping URL which flexx refuses to load (due to it having .map
as a file ending):
ValueError: Asset names always end in .js or .css
Maybe it is useful to include .map to the allowed file extensions (flexx/app/_assetstore.py:346
):
if not name.lower().endswith(('.js', '.css', '.map')):
raise ValueError('Asset names always end in .js, .css or .map')
I agree! Would you be up for creating a PR for this?
Sorry for the late reply! I will look into creating a PR but can't promise much.
Is there some documentation on how the asset store is working? Just adding '.map' seems like a dirty fix because it seems there are different to_html functionalities for the different asset types.
Is there some kind of IRC channel where I can ask some questions?
Is there some documentation on how the asset store is working?
Other than the comments in the code, no. Sorry.
Just adding '.map' seems like a dirty fix because it seems there are different to_html functionalities for the different asset types.
You're right. js and css can be embedded in HTML, and thus an app can be exported as a single HTML document. This wont work for .map files. So we need to think about this more carefully. I think we can still make it work; in to_html()
we can probably just ignore .map
assets. I think that that is the only place where we need to add an extra elif
clause
Is there some kind of IRC channel where I can ask some questions?
There is a gitter channel: https://gitter.im/zoofIO/flexx