Skip to content
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

Allow .map assets #469

Open
thilomichael opened this issue Jun 1, 2018 · 3 comments
Open

Allow .map assets #469

thilomichael opened this issue Jun 1, 2018 · 3 comments

Comments

@thilomichael
Copy link

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')
@almarklein
Copy link
Member

I agree! Would you be up for creating a PR for this?

@thilomichael
Copy link
Author

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?

@almarklein
Copy link
Member

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

@almarklein almarklein added this to the v0.6 milestone Sep 5, 2018
@almarklein almarklein modified the milestones: v0.6, v1.0 Oct 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants