Announcement

Collapse
No announcement yet.

Is it possible to native debug like typescript projects?

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

  • Is it possible to native debug like typescript projects?

    So, with a typescript project, I can set a breakpoint in my ts/tsx files, have it hit and step through. Is this functionality possible with Bridge.Net?

    As part of an effort to make development more seamless, I'm experimenting with converting an existing typescript/react application to Bridge.Net and I have done the following:
    Create a Bridge.Net library
    Create a MVC application, set up a default route that returns was would have been in the index.html emitted by the Bridge.Net library.
    Change the Bridge.Net library output to write to the wwwroot/dist of the MVC application
    (Yes, I end up with a useless index.html in the dist folder - any chance we could get an option to suppress the generation of the index.html file?)

    This works, I can click Run and my Bridge application is started. I can even put breakpoints in my controllers to debug the backend API calls. But I am missing the piece of stepping through the Bridge code. I realize this is asking for a lot, I'm not really expecting this to be possible, but I figured it doesn't hurt to ask.

  • #2
    But I am missing the piece of stepping through the Bridge code.
    Bridge will generate source maps for the app (if enabled in bridge.json) which will allow you to step through the .cs within any of the browser developer tools such as Chrome Developer tool or Firebug on Firefox. I'm assuming IE has something like that as well.

    I believe setting breakpoints directly within Visual Studio and using IE to step into those breakpoints is also possible. I have just never tried. There might be a setting in IE that needs to be activated, but it should be possible.

    Either way, setting a breakpoint within the browser developer tools works great. Just ensure sourceMap is enabled in your bridge.json config file.

    https://github.com/bridgedotnet/Brid...tion#sourcemap

    any chance we could get an option to suppress the generation of the index.html file?
    You can disable the index.html file generation by configuring the html setting your projects bridge.json.

    https://github.com/bridgedotnet/Brid...iguration#html

    {
      "html": {
        "disabled": true
      }
    }
    Hope this helps.

    Comment


    • #3
      That's excellent news about the index file. I apologize for missing that.

      Bridge is definitely generating the inline source maps (I can see them in the files) and Chrome happily lets me hit breakpoints, but Visual Studio is definitely confused by the whole situation. I've gone back and forth with the TypeScript projects I have trying to figure out what settings might be necessary to make this work. If I discover it, I'll definitely let people know whatever it may be.

      Comment


      • #4
        For what it's worth, it definitely can have breakpoints hit in the cs file inside Chrome, that works just fine. I'm guessing that its unable to tie back to the IDE because the files are being output from another project, so there's some confusion as to where the symbols would come from?

        That is - I have BridgeApp with "output" set to "../MVCApp/wwwroot/dist", and when I run MVCApp it's blisfully unaware that the BridgeApp exists. (There is a dependency added so that BridgeApp compiles before MVCApp, but seems to not help)

        Comment

        Working...
        X