Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue fix pack #9

Merged
merged 1 commit into from
Dec 18, 2014

Conversation

ohadschn
Copy link
Contributor

Data tables - ported all computed to pureComputed and inlined attribute map computed to increase efficiency in code paths that don't require it.
demo.thml - added perPage dropdown and modified search box to filter after each keypress.

Data tables - ported all computed to pureComputed and inlined attribute map computed to increase efficiency in code paths that don't require it.
demo.thml - added perPage dropdown and modified search box to filter after each keypress.
@@ -0,0 +1 @@
{"version":3,"file":"knockout-datatable.min.js","sources":["knockout-datatable.js"],"names":["__indexOf","indexOf","item","i","l","this","length","DataTable","rows","options","sortField","Error","recordWord","recordWordPlural","sortDir","perPage","filterFn","unsortedClass","descSortClass","ascSortClass","ko","observable","currentPage","filter","loading","filtering","subscribe","_this","observableArray","rowAttributeMap","pureComputed","attrMap","key","row","hasOwnProperty","toLowerCase","filteredRows","sort","a","b","aVal","bVal","utils","unwrapObservable","pagedRows","pageIndex","slice","pages","Math","ceil","leftPagerClass","rightPagerClass","total","from","to","recordsText","showNoData","showLoading","sortClass","column","primitiveCompare","computed","item1","item2","toString","prototype","toggleSort","field","prevPage","page","nextPage","gotoPage","pageClass","defaultMatch","val","_results","push","some","isObservable","filterVar","specials","_ref","split","forEach","word","words","join","conditionals","rowAttr","call","match"],"mappings":"CAAA,WACE,GAAIA,MAAeC,SAAW,SAASC,GAAQ,IAAK,GAAIC,GAAI,EAAGC,EAAIC,KAAKC,OAAYF,EAAJD,EAAOA,IAAO,GAAIA,IAAKE,OAAQA,KAAKF,KAAOD,EAAM,MAAOC,EAAK,OAAO,GAEpJE,MAAKE,UAAY,WAmBf,QAASA,GAAUC,EAAMC,GACvB,GAAyB,MAArBA,EAAQC,UACV,KAAM,IAAIC,OAAM,8BAElBN,MAAKI,SACHG,WAAYH,EAAQG,YAAc,SAClCC,iBAA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MAAM,KACZF,EAASK,EAAM,IAAM,WAC1B,OAAQA,EAAM,GAAGlD,eACf,IAAK,MACL,IAAK,OACH,OAAO,CACT,KAAK,KACL,IAAK,QACH,OAAO,CACT,KAAK,QACL,IAAK,OACL,IAAK,OACL,IAAK,YACH,MAAO,OACT,SACE,MAAOkD,GAAM,GAAGlD,mBAIfZ,EAAOqD,KAAKQ,KAGvB7D,EAASA,EAAO+D,KAAK,KACrBb,EAAepE,KAAKoE,aACb,SAAU9C,GACf,MAAO,UAASM,GACd,GAAIsD,GAAcvD,EAAK0C,CAmBvB,OAlBAa,GAAe,WACb,GAAIZ,EACJA,KACA,KAAK3C,IAAOgD,GACVN,EAAMM,EAAShD,GACf2C,EAASC,KAAK,SAAUjD,GACtB,MAAO,UAASK,EAAK0C,GACnB,GAAIc,EACJ,QAAIA,EAAU7D,EAAME,kBAAkBG,EAAIG,gBACjCyB,EAAkBxC,GAAG0D,aAAa7C,EAAIuD,IAAYvD,EAAIuD,KAAavD,EAAIuD,GAAWd,IAElF,IAGVrE,MAAM2B,EAAK0C,GAEhB,OAAOC,IACNc,KAAK9D,GACA3B,EAAUyF,KAAKF,GAAc,GAAS,IAAkB,KAAXhE,EAA8B,MAAbU,EAAIyD,MAAgBzD,EAAIyD,MAAMnE,GAAUkD,EAAalD,EAAQU,EAAKN,EAAME,oBAAsB,KAErKxB,QAIAE,OAIRkF,KAAKpF"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed for the end user? I.e., should we add this file to the bower.json's ignore section so it doesn't get installed when someone bower installs the datatable?

cmbankester added a commit that referenced this pull request Dec 18, 2014
Covered a few other computeds, updated the demo to showcase changing perPage
@cmbankester cmbankester merged commit 8bd0fd4 into immense:feature/pure-computeds Dec 18, 2014
@cmbankester
Copy link
Contributor

Thanks for this! Really helped us out. Great change to the demo!

@ohadschn
Copy link
Contributor Author

Hey it was the least I could do :)
Regarding the source map file, seeing as the end user is a developer I think it's helpful. My thinking is this: either go coffeescript alone, or if generated files are included might as well have the source maps too.

@ohadschn
Copy link
Contributor Author

Sorry for being such a noob, but where can I see the change?

@cmbankester
Copy link
Contributor

Hmm. Well, I'm trying to be as lean as possible with what gets installed via bower install. I actually removed the coffeescript file as well (take a look at the bower.json on the release branch). If you think I should revert and let the source map make it to the installed component, just let me know how it'd be useful (I don't really use sourcemaps) and I can change it back.

The changes are currently sitting in the release branch.

@cmbankester
Copy link
Contributor

@ohadschn I went ahead and reverted, since it can't do any harm to have them in there. I'm just not certain on their use.

@ohadschn
Copy link
Contributor Author

Source map files are super useful when you want to debug minified js files. It basically allows you to deploy minified files with all their benefits, but come debugging time you can place breakpoints and the likes in the debug (non-minified) file. It looks like even coffeescript debugging is supported, so you might want to put it back: https://developer.chrome.com/devtools/docs/javascript-debugging#source-maps. The developer can always choose what they want, it's not like there's a size issue...

@cmbankester
Copy link
Contributor

@ohadschn This is all sitting in master now. If you're using bower, you should be able to get the updates by specifying version 0.5.0 in your bower.json.

Somewhat relatedly, do you want me to add you to the Contributors list? I'll link it to your GitHub page (or somewhere else, if you'd rather).

@ohadschn
Copy link
Contributor Author

Fantastic! I see you've made some more improvements along the way - good stuff!
I'm not using bower but I'll take a look into it, sounds like the right thing to do.
I don't think my tiny contribution gives me the right to be on that page, but it's your call - my GitHub page is fine :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants