Start a new topic
Answered

Source maps and class libraries

I have created my first DuoCode Binding as a Nuget package (But the question applies to normal DuoCode class libraries too)


Knockout.BindingConventions.DuoCode


Source code:

https://github.com/AndersMalmgren/Knockout.BindingConventions.DuoCode


If I enable source maps in Chrome it will complain because it cant find Binding.cs


Any fix for this?


Bonus question, my binding needs some code to run on the fly namly this line: 

https://github.com/AndersMalmgren/Knockout.BindingConventions.DuoCode/blob/master/Knockout.BindingConventions.DuoCode/Binding.cs#L13


It would be more user friendly If i did not require the user of my binding to call this line but rather that it executed directly on the fly. Any staryup attribute on the assembly level or so?


Best Answer

We have checked your package great work!

Regarding Bindings.cs and source-maps, you simply should not supply Knockout.BindingConventions.DuoCode.js.map file on release/deploy builds, it's for your own debugging purposes only.

It's kind of similar to PDB file.

In the coming version next week you will be able to use new DuoCode Project Property Page and disable .js.map file generatoin on Relese builds.


About your second question we are investigatoin it what will be the best way to allow that, and what should be the order of such executions.


I just did some trail and error with the JS attribute. You can look at my bindings here to get some ideas


https://github.com/AndersMalmgren/Knockout.DuoCode

Bindings!!!!


Where are you guys finding about this stuff... I see nothing that says i can make bindings...


Where are the docs on this stuff....


I WOULD LOVE TO GET STARTED ON THIS STUFF... How did you hear about bindings?

The problem is that in multi-assembly project there are should be a common root folder for source-maps to work.

We are working on option to define source-root folder for the compiler in next releases.


Currenly you can manualy copy your source files to the web root folder just for debugging of course.

Alternatively edit .js.map file of class library, and fix paths.


That's makes sense, but when I debug locally its the same problem that I can't debug because it's a class library, only files in the Web project works to debug
Answer

We have checked your package great work!

Regarding Bindings.cs and source-maps, you simply should not supply Knockout.BindingConventions.DuoCode.js.map file on release/deploy builds, it's for your own debugging purposes only.

It's kind of similar to PDB file.

In the coming version next week you will be able to use new DuoCode Project Property Page and disable .js.map file generatoin on Relese builds.


About your second question we are investigatoin it what will be the best way to allow that, and what should be the order of such executions.

Login or Signup to post a comment