{"id":14669,"date":"2016-05-29T10:50:47","date_gmt":"2016-05-29T14:50:47","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=14669"},"modified":"2016-05-29T10:58:33","modified_gmt":"2016-05-29T14:58:33","slug":"make-paw-extensible-with-javascript-core","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2016\/05\/29\/make-paw-extensible-with-javascript-core\/","title":{"rendered":"Making Paw Extensible With JavaScript Core"},"content":{"rendered":"<p><a href=\"https:\/\/medium.com\/ios-os-x-development\/make-your-app-extensible-with-javascript-core-7074061f2b05\">Micha Mazaheri<\/a>:<\/p>\n<blockquote cite=\"https:\/\/medium.com\/ios-os-x-development\/make-your-app-extensible-with-javascript-core-7074061f2b05\"><p>There was a dilemma on the choice of the scripting language. Sketch exposes an <a href=\"https:\/\/github.com\/ccgus\/CocoaScript\">CocoaScript<\/a> interface that lets users mix JavaScript with a syntax inspired by Objective-C, and gives access to all available OS X APIs. This would have been a serious security concern for Paw being a place where developers may store their production server credentials: letting 3rd party have unrestricted access to the app didn&rsquo;t feel right.<\/p><p>[&#8230;]<\/p><p>Since OS X 10.9 \/ iOS 7, the JavaScript Core framework exposes great Objective-C to JavaScript bindings (it had a C API before). This meant objects from either language would be bridged to the other by just following a simple protocol and following a few rules for memory management. The whole thing would run in a JavaScript Virtual Machine we would fully control. We would create JavaScript APIs to let 3rd parties safely access the data we wanted to expose.<\/p><\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Micha Mazaheri: There was a dilemma on the choice of the scripting language. Sketch exposes an CocoaScript interface that lets users mix JavaScript with a syntax inspired by Objective-C, and gives access to all available OS X APIs. This would have been a serious security concern for Paw being a place where developers may store [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[346,30,32,54,1385,71],"class_list":["post-14669","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-javascript","tag-mac","tag-macapp","tag-objective-c","tag-paw","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/14669","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=14669"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/14669\/revisions"}],"predecessor-version":[{"id":14671,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/14669\/revisions\/14671"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=14669"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=14669"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=14669"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}