-
Notifications
You must be signed in to change notification settings - Fork 119
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
SignalR + NancyFX + Self-Hosting - HttpContext #311
Comments
If Nancy hasn't changed dramatically i suspect this will help. http://blogs.lessthandot.com/index.php/webdev/serverprogramming/squishit-and-nancy-part-deux/ |
If not let me know I haven't tried this particular combination. |
My implementation of your example only appears to make things worse. I found that your original implementation of PathTranslator did all of the regular links correct, it's just the dynamic ones I am having issues with. However, when I copied your code and modified it so that it left http links alone so that I can map directly to http://mysite/signalr/hubs I encounter an error elsewhere in Squishit in FileSystemResolver:
The error indicates that "URI formats are not supported." with Path |
Hmm OK this is definitely a gap. There's a method called BuildAbsolutePath that uses HttpContext directly, it should probably get its information from the path translator or simliar. I will try to look into this in the near future, if you could upload a sample project somewhere that would be very helpful. |
The URI formats are not supported message - assuming you are trying to use add which assumes you are adding a normal file. You will want to use AddRemote("~/signalr/hubs", "http;//mysite/signalr/hubs", true) as a workaround - this is what AddDynamic uses under the hood https://github.com/jetheredge/SquishIt/blob/master/SquishIt.Framework/Base/BundleBase.cs#L246-250 If you get a chance to throw together a sample project I would really like to see it so I can ensure the change to that BuildAbsolutePath method works. I am not going to make the change otherwise, because I envision it as a breaking change for anyone who is already using Nancy + SquishIt (new method and possibly a rename of the IPathTranslator interface). Email is alex dot ullrich at gmail if you don't want to upload the project here. |
I am working on a sample project for your use by cutting down my current project to a functioning example |
Fantastic, thanks! Once you have a path provider in place, does
Work in the meantime? |
I remembered I had a test project to get things working with SignalR, the initial way I did things was slightly different (though I think what I have above might be more correct?)
Not sure if poking around in there will help or not since its not using Nancy, but it might glean some other useful info I've forgotten |
Passing Null into .AddRemote and adding .ForceRelease() does not make SquishIt happy. When ResolveAppRelativePathToFileSystem(string file) is called file == null. When I try returning the null back to SqushIt from the NancyPathTranslator, SquishIt FileSystemResolver.Resolve throws an error. When I attempt calling AddRemote as follows: In addition, using the NancyPathTranslator produces links to the other files as follows: |
I made a change so that AddDynamic will use the IPathTranslator interface. Method it consumes is called BuildAbsolutePath. You can try with the package available here to see if it works: http://www.nuget.org/packages/SquishIt/0.9.8.1-alpha2 You are mostly going to be on your own figuring out the nancy issues. I do not use nancy for anything, and debugging it is more than I have time for at the moment. Injecting nancy's root path provider into your translator should give you all you need but I really have no idea. With all the translation activity now confined to that interface you should be able to figure it out by debugging your implementation. I will try updating my nancy sample project again sometime soon, but it could be a while. |
I thought of another potential issue with nancy deployments today. SquishIt's bundle cache is backed by HttpRuntime.Cache which would obviously not be available. I will try to get that hidden behind an interface but its another thing that I have no idea how to replace in Nancy. Going to reach out to a few people to see if they'd be willing/able to help with a push to fix this kind of thing for v1.0 - I would really like to put out a SquishIt.Nancy package that has implementations of all the relevant interfaces but I'm not sure I'm up to the task. Let me know if this is something you'd have the bandwidth to help with over the next few months. |
I'm attempting to use AddDynamic with the ~/signalr/hubs path, but since this is a NancyFX project there is no HttpContext. I attempted to use AddRemote, but SquishIt turns my relative path into signalr/hubs which gets appended onto whichever subdirectory it is in rather than the site root. Is there any way to work around this?
The text was updated successfully, but these errors were encountered: