canjs / can-connect

Model layer utilities for every JavaScript framework! Assemble real-time, high performance, restful data connections.
https://canjs.com/doc/can-connect.html
MIT License
29 stars 16 forks source link

Add a debugging guide #347

Open chasenlehara opened 7 years ago

chasenlehara commented 7 years ago

@frank-dspeed commented on Mon Jul 24 2017

or if your using async values that are undefined at first like a promis always return the promis directly and use isResolved alternate method when your function uses resolve wrapp it with if

{{#if entitiesList}}
  {{#each entitiesList}}
  {{/each}}
{{/if}}

we could also add some wrong examples for canDefine and canConnect there this are the places where most trouble happens in canjs

I think it would be useful if we created a can-connect debugging guide. I think we should create a new “guides” section in the can-connect docs and add a Debugging page under that. I think it would make sense to start adding more “guide” content under that section, such as the existing Creating Behaviors docs.

frank-dspeed commented 7 years ago

@chasenlehara i am for adding npm module debug to all can libs like define on all places and then we can debug all stuff well i did that for can define https://github.com/direktspeed/can-define-debug/commit/f390eb00a44bc25d8a6ae636f12c4b0058766166

it helped me a lot https://www.npmjs.com/package/debug

i use it also backend side for all projects i did forks of every can package but don't published them and can this way debug them all

a commun method that i use then is i add to the init of my app that if env DEBUG exists in the node start line then i add directly in the init the settings to the localstorage in browser

because you need to filter out very verbose things like babel :) they all are using that module and if you do something like DEBUG=* you get with steal and babel a lot of fun :)

so DEBUG=,-babe is most importent if you debug whole projects if you debug only a single component turn on debug for babel is also cool