Activity

This is super useful feature that works without jawr but is broken with jawr. Source maps are used already by plenty of languages (coffeescript, typescript, less etc). They rely in having a .map file mapping the original file to the generated one.
Without jawr, the browser reads a comment in the generated file and this comment tells where to look for the mapping, which in turn leads to the original file.
In my example, I have a .js with the following automatically generated comment: //# sourceMappingURL=MyFile.js.map
With jawr, the .map file cannot be put in the js bundle, so it has to be treated as an orphan resource. The .js file served is NOT anymore in the same path as the .map file, so the browser cannot find the .map file.
Other bundling frameworks (see asp.net built-in bundling) are completely transparent on debug (by not changing the urls), so they manage to overcome this issue.

tecgoblin
added a comment - 05/Aug/15 11:49 AM - edited This is super useful feature that works without jawr but is broken with jawr. Source maps are used already by plenty of languages (coffeescript, typescript, less etc). They rely in having a .map file mapping the original file to the generated one.
Without jawr, the browser reads a comment in the generated file and this comment tells where to look for the mapping, which in turn leads to the original file.
In my example, I have a .js with the following automatically generated comment: //# sourceMappingURL=MyFile.js.map
With jawr, the .map file cannot be put in the js bundle, so it has to be treated as an orphan resource. The .js file served is NOT anymore in the same path as the .map file, so the browser cannot find the .map file.
Other bundling frameworks (see asp.net built-in bundling) are completely transparent on debug (by not changing the urls), so they manage to overcome this issue.

I tried mapping all the //.js.map to the jawr controller and now when I run jawr in debug=true it all works great, but when I try it in debug=false I get StackOverflow errors. The reason is that JAWR is trying to load this .map file gzip_1463943825/solarapparel/NORMAL/slick.css.map and it hits JawrRequestHandler:86

paranoiabla
added a comment - 24/Sep/15 11:20 PM I tried mapping all the / / .js.map to the jawr controller and now when I run jawr in debug=true it all works great, but when I try it in debug=false I get StackOverflow errors. The reason is that JAWR is trying to load this .map file gzip_1463943825/solarapparel/NORMAL/slick.css.map and it hits JawrRequestHandler:86
if (LOGGER.isDebugEnabled()) {
LOGGER.debug( "Path '" + requestedPath
+ "' does not belong to a bundle. Forwarding request to the server. " );
}
request.getRequestDispatcher(requestedPath).forward(request, response);
processed = true ;
and because it does not belong to a bundle it delegates the request to the server, which calls JAWR again, and again and again. So i guess simply mapping the map file to jawr will not really work.

The integration of map support in Jawr is not an easy task.
Some files are linked to map files (less, coffeescript, ...)
But these files can be incorporated in bundles, which can be minified.
The processors can have impact on the map files too...

So make it work with the different components is not easy.
This feature is not currently in the top priorities, but it still is considered in the roadmap.

icefox
added a comment - 25/Sep/15 3:27 PM Hi,
The integration of map support in Jawr is not an easy task.
Some files are linked to map files (less, coffeescript, ...)
But these files can be incorporated in bundles, which can be minified.
The processors can have impact on the map files too...
So make it work with the different components is not easy.
This feature is not currently in the top priorities, but it still is considered in the roadmap.
Any help on this feature is more than welcome.
Cheers,

@paranoiabla Can you explain what do you mean by 'I tried mapping all the //.js.map to the jawr controller and now when I run jawr in debug=true it all works great'? It might be sufficient for us if it works with debug=true, but in our case we cannot manage to even add the .js.map files to a bundle.

tecgoblin
added a comment - 25/Sep/15 4:24 PM @paranoiabla Can you explain what do you mean by 'I tried mapping all the //.js.map to the jawr controller and now when I run jawr in debug=true it all works great'? It might be sufficient for us if it works with debug=true, but in our case we cannot manage to even add the .js.map files to a bundle.

icefox
added a comment - 26/Sep/15 10:50 AM Hi tecgoblin,
Can you elaborate your use case?
How would you like it to work in debug mode?
Handling sourcemap in debug mode could be a first step to achieve this feature.
Cheers,

What I mean is that I simply map the spring jawr controller to map to /*/.js.also. And for that I don't see any exceptions in debug mode. In production mode however I get the exceptions (I think it's because in debug mode my javascript files are not including the .map file)

paranoiabla
added a comment - 26/Sep/15 11:37 AM What I mean is that I simply map the spring jawr controller to map to /* / .js.also. And for that I don't see any exceptions in debug mode. In production mode however I get the exceptions (I think it's because in debug mode my javascript files are not including the .map file)

Hi @icefox and thanks for caring! Ideally I would like that in debug mode the page points directly to the original Js paths, as they are in the folder structure. Ex js/thatpage/file1.js instead of /jawr/mybundleforthatpage/file1.js This would allow the browser to find the source.map and source files which are in the same folder.
If this is not possible, I would like to have jawr doing something similar by searching itself for the sourcemapping comment in the source file, understand there is a source file and expose the source file and the mapping file in a path coherent to what the comment says. So, if the comment points to a Js.map in the same folder as the .js, I would need /jawr/mybundleforthatpage/file1.js, /jawr/mybundleforthatpage/file1.js.map and /jawr/mybundleforthatpage/file1.ts (in this example the source is typescript, but it could be anything). In this case as well the browser will be able to find the source.

tecgoblin
added a comment - 26/Sep/15 11:44 AM Hi @icefox and thanks for caring! Ideally I would like that in debug mode the page points directly to the original Js paths, as they are in the folder structure. Ex js/thatpage/file1.js instead of /jawr/mybundleforthatpage/file1.js This would allow the browser to find the source.map and source files which are in the same folder.
If this is not possible, I would like to have jawr doing something similar by searching itself for the sourcemapping comment in the source file, understand there is a source file and expose the source file and the mapping file in a path coherent to what the comment says. So, if the comment points to a Js.map in the same folder as the .js, I would need /jawr/mybundleforthatpage/file1.js, /jawr/mybundleforthatpage/file1.js.map and /jawr/mybundleforthatpage/file1.ts (in this example the source is typescript, but it could be anything). In this case as well the browser will be able to find the source.