Announcement

Collapse
No announcement yet.

Calling into our Bridge.NET code from JavaScript while using RequireJS...

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Calling into our Bridge.NET code from JavaScript while using RequireJS...

    We've been working to get our massive project to load the code on demand. For the most part, we think we have succeeded! We have a custom plugin that helps control the modules that are produced, and we're basically a module per class.

    However, we have some JavaScript code that calls back into the Bridge.NET code. These are usually methods on static classes. It used to be the fully qualified namespace, like My.Really.Long.Namespace.SomeClass.SomeMethod(); Now, however, that doesn't work. Previously, our classes were reachable from the global context in JavaScript. If you went to the console window, you could enter things directly. Right now we can't seem to find them! We believe it has to do with how RequireJS wraps the Bridge.define calls, but we're not sure. Our modules look like:


    Bridge.assembly("Rio.UI.Moduled", function ($asm, globals) {
        "use strict";
    
        define("Rio_Facade_Data_Core_PersonName", function () {
            var Rio_Facade_Data_Core_PersonName = { };
            Bridge.define("Rio.Facade.Data.Core.PersonName", {
    How do we reach that code now?
Working...
X