-
Notifications
You must be signed in to change notification settings - Fork 22
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
handle http files #23
Comments
Matt, Can you please explain why can't we just open the index.html/php file in phantomjs and live switch the debug-all.js file to debug.js and inject the bridge directly ? Instead of creating a tempfile; Maybe i miss some points though so your opinion is very appreciated. Thanks |
@revolunet Yes - that makes perfect sense, especially when adding support for remote files. I guess my only question is how should we best let the user configure the path to map the remote files to local ones. We'd need to convert the requested url's to local ones on disk, I guess some mapping configuration like: urlMapping: {
'/lib': 'app/lib'
} Any thoughts/opinions? |
Thanks Matt; but why would we need local mapping ? My naive opinion is that we can directly open the web page, analyse the loader and extract all the dependencies directly, cant we ? |
The idea with this task was to be able to JUST generate a list of files for other tasks to use. This gives a greater flexibility of what people can do next:
This keeps both this task nice and simple - I don't have to bother writing a concat/minifier/xyz next step feature that people might want to use in their build pipeline. Unfortunately these other grunt tasks won't work with 'http' url, they all are all based on files on disk, hence the need for the mapping from a http request to the local file on disk. |
Ok thanks, i understand, you're perfectly right, separations of concerns is what makes grunt so flexible and powerful. So your url mapping proposal makes sense. We just need to setup (one or more) url to path mapping in the config. Do you think the "live changing of the source" approach (using phantomjs onResourceRequested) makes sense ? Id be please to help so if i can investigate/code something, just tell me :) Thanks |
@revolunet Sorry for the lack of response on this. I started working on it last weekend and quickly hit some problems that I've not managed to solve. The problem I'm facing is that I don't get passed a networkRequest object in the onResourceRequested callback. So it's not possible for me to change the url. I spent a bit of time trying to figure out why - I have a feeling it could be due to the requests being made for filesystem urls and not http urls, but I'm not 100% sure. Feel free to take a look into this if you want to. I'm sure two people looking into it will help get it done a little quicker. |
@mattgoldspink : thanks for looking at this. We're making some tests in that direction with a different approach and will give you our results asap. From what i understand, all the dependency 'detection' is made using Ext.Loader.history when the application startsup. But this doesn't cover dependencies loaded by objects that appear later in the application, does it ? Eg: i have a button that instantiate a custom class that uses some new Ext layout or xtypes. Using ext-debug.js we can see that the files are loaded "on demand" and not on application startup and thus the dependency is not detected. How could we deal with this ? |
Hi Matt,
I'm not sure about this, but would it be possible to handle http served files instead of local files ? I mean i have some index dynamically generated (eg:php) and would be cool to analyse it directly instead of a local index.html.
if it is then we could work on a PR with that feature.
Thanks
The text was updated successfully, but these errors were encountered: