{"id":19332454,"url":"https://github.com/yuchi/hyperloop-macros","last_synced_at":"2025-04-22T23:32:54.830Z","repository":{"id":19668494,"uuid":"22921980","full_name":"yuchi/hyperloop-macros","owner":"yuchi","description":"Sweet.js macros to accelerate Hyperloop development","archived":false,"fork":false,"pushed_at":"2014-09-16T09:41:39.000Z","size":392,"stargazers_count":6,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-19T11:11:49.907Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"songhuizhang/FE-Interview-Questions","license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yuchi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-13T16:07:25.000Z","updated_at":"2015-10-25T07:10:57.000Z","dependencies_parsed_at":"2022-08-24T14:07:41.385Z","dependency_job_id":null,"html_url":"https://github.com/yuchi/hyperloop-macros","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuchi%2Fhyperloop-macros","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuchi%2Fhyperloop-macros/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuchi%2Fhyperloop-macros/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuchi%2Fhyperloop-macros/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yuchi","download_url":"https://codeload.github.com/yuchi/hyperloop-macros/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250340575,"owners_count":21414584,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T02:45:52.969Z","updated_at":"2025-04-22T23:32:54.549Z","avatar_url":"https://github.com/yuchi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Hyperloop Macros\n================\n\n[![Build Status](https://img.shields.io/travis/yuchi/hyperloop-macros.svg?style=flat-square)](https://travis-ci.org/yuchi/hyperloop-macros)\n[![Dependencies](https://david-dm.org/yuchi/hyperloop-macros/dev-status.svg?style=flat-square)](https://david-dm.org/yuchi/hyperloop-macros#info=devDependencies)\n[![Available on NPM](https://img.shields.io/npm/v/hyperloop-macros.svg?style=flat-square)](https://www.npmjs.org/package/hyperloop-macros)\n\n[Sweet.js][sjs] macros to accelerate Hyperloop development.\n\nBy now only utilities for Objective-C and Java were implemented;\n\n[sjs]: http://sweetjs.org/\n\n## Installation\n\n```bash\n# Install in your project\nnpm install --save-dev hyperloop-macros\n# Compile your source\nsjs my_hyperloop_source.js --module hyperloop-macros/obj-c\n```\n\n## Usage\n\n### Common\n\n```js\n// Activate Hyperloop for this file\nuse hyperloop;\n```\n\n### Objective-C\n\nSee the [example application](examples/obj-c/tableViewController).\n\n```js\n// The `native` keyword makes the class compile to Hyperloop\nclass native LocDelegate\n  // For clarity `implements` is (also) aliased as extends\n  extends NSObject\n  // Protocol the class responds to\n  protocol CLLocationManagerDelegate {\n\n  // Objective-C style message definition (copy-paste-proof)\n  - (void) locationManager:(CLLocationManager *) locationManager\n        didUpdateLocations:(NSArray *) locations {\n\n    // Casting is done with the `as` keyword, but for arguments is not necessary\n    var locationsRecasted = locations as (NSArray *);\n\n    // Message passing is activated with `@` in dot-notation style\n    locationManager@startUpdatingLocation();\n\n    // Since the second argument we follow Swift’s form\n    locationManager@allowDeferredLocationUpdatesUntilTraveled(null, timeout: null);\n\n    // But Hyperloop supports actual dot notation too!\n    locationManager.startUpdatingLocation();\n\n    // so do we! Attention! not for 1 argument methods!\n    // see https://github.com/appcelerator/hyperloop-ios/issues/82\n    locationManager.allowDeferredLocationUpdatesUntilTraveled(null, timeout: null);\n  }\n}\n```\n\n### Java\n\n```js\n// `import`s let you skip the package later in the code\nimport java.lang.Runnable;\nimport java.lang.Object;\nimport java.lang.Import;\n\n// The `native` keyword makes the class compile to Hyperloop\nclass native public com.company.MyRunnable\n  extends Object\n  implements Runnable {\n\n  // Java style properties...\n  String aField;\n  String anotherField;\n\n  // And transparent transformation of expressions!\n  int aPrimitive = 42;\n\n  // Java style annotations...\n  @Override\n  // Method modifiers and return types\n  public void run() {\n    console.log('Here we are!');\n  }\n\n  // And Java style method arguments too!\n  public Integer someOtherMethod(Integer boxed, int unboxed) {\n    // Casting is done with the `as` keyword\n    return (boxed as int) + unboxed;\n  }\n}\n```\n\n### C++\n\n\u003e TODO\n\n## License\n\nThis library, *Hyperloop Macros*, is free software (\"Licensed Software\"); you can\nredistribute it and/or modify it under the terms of the [GNU Lesser General\nPublic License](http://www.gnu.org/licenses/lgpl-2.1.html) as published by the\nFree Software Foundation; either version 2.1 of the License, or (at your\noption) any later version.\n\nThis library is distributed in the hope that it will be useful, but WITHOUT ANY\nWARRANTY; including but not limited to, the implied warranty of MERCHANTABILITY,\nNONINFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General\nPublic License for more details.\n\nYou should have received a copy of the [GNU Lesser General Public\nLicense](http://www.gnu.org/licenses/lgpl-2.1.html) along with this library; if\nnot, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth\nFloor, Boston, MA 02110-1301 USA\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuchi%2Fhyperloop-macros","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyuchi%2Fhyperloop-macros","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuchi%2Fhyperloop-macros/lists"}