vtfuture/RequireJSDotNet

Make PathHelpers class to be public for IEntryPointResolver implementation

Opened this issue · 5 comments

Hello.
Can you change class modifier from internal to public for PathHelpers class?
I need to implement new IEntryPointResolver (#31) interface. And I should duplicate path logic which already in this internal helper class.

That class is internal for a very good reason: the methods that it contains are implementation details that I don't intend to support as a public API. What exactly are you after?

Well. I need to integrate RequireJsNET with MvcCodeRouting library. To do this I wrote an implementation of the IEntryPointResolver.

Hi @CezarCretu

I too am now writing my own IEntryPointResolver to support having a different .js file loaded when a mobile version of the .cshtml file is loaded.

For instance, when Player/Index is loaded on a desktop, it loads Index.cshtml, but when that same controller action is called on a mobile, Index.mobile.cshtml is loaded. Since a different view is being loaded, I need the ability to load a different set of javascript code.

No problem, I will just write my own IEntryPointResolver and trigger off of viewContext.DisplayMode.DisplayModeId == "Mobile".

But then I run into the same thing that @lvv83 is asking for above. I need to get the Controller and the Action for the request. We don't need to get access to any other details. In fact, maybe the signature of IEntryPointResolver should change to include these things as part of its interface. I would imagine you can't do too much interesting with the entry point resolver without knowing the controller, action and area of the request. So either we have to duplicate the code in our project, or we get it passed in as part of the information provided to make the resolver decision, or it is available through one of the supplied classes like GetRoutingInfo().

Thanks for listening.
Greg

Sorry @gregveres, I am no longer maintaining/using this library. You can try pinging @stefanprodan or @cristipufu, maybe they can help.

Ok, thanks for the heads up. Good luck with your other projects. @CezarCretu