Title: Static binding generator creates wrong files, when two extended classes have the same name · Issue #692 · NativeScript/android · GitHub
Open Graph Title: Static binding generator creates wrong files, when two extended classes have the same name · Issue #692 · NativeScript/android
X Title: Static binding generator creates wrong files, when two extended classes have the same name · Issue #692 · NativeScript/android
Description: Problem: Static binding generator creates wrong files, when two extended classes have the same name How can I reproduce the problem: The same class is extended 2 times in typescript https://github.com/NativeScript/NativeScript/blob/84c46...
Open Graph Description: Problem: Static binding generator creates wrong files, when two extended classes have the same name How can I reproduce the problem: The same class is extended 2 times in typescript https://github....
X Description: Problem: Static binding generator creates wrong files, when two extended classes have the same name How can I reproduce the problem: The same class is extended 2 times in typescript https://github....
Opengraph URL: https://github.com/NativeScript/android/issues/692
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Static binding generator creates wrong files, when two extended classes have the same name","articleBody":"_Problem:_\r\nStatic binding generator creates wrong files, when two extended classes have the same name\r\nHow can I reproduce the problem:\r\n* The same class is extended 2 times in typescript\r\nhttps://github.com/NativeScript/NativeScript/blob/84c469d61b148544bd1ef8b4f41ce689f9145754/tns-core-modules/ui/gestures/gestures.android.ts#L198\r\nhttps://github.com/NativeScript/NativeScript/blob/84c469d61b148544bd1ef8b4f41ce689f9145754/tns-core-modules/ui/gestures/gestures.android.ts#L339\r\n* Uglify is used and the names `SwipeGestureListener` and `TapAndDoubleTapGestureListener` become `e` or some other letter.\r\n* while we analyze the uglified, minified javascript the AST parser generates the same name for both classes: `GestureDetector_SimpleOnGestureListener_frnal_ts_helpers_l58_c38__e.java`.\r\n\r\nThe name is generated as follows: \r\n`\u003cextended_class_name\u003e_f\u003cfile_path\u003e_l\u003cline\u003e_c\u003ccolumn\u003e__\u003cunique_name\u003e.java`\r\n* Because both classes extend the same base class, both names start with the same `\u003cextended_class_name\u003e`\r\n* Because the typescript extends all pass through the [ts_helpers file](https://github.com/NativeScript/android-runtime/blob/master/build-artifacts/project-template-gradle/src/main/assets/internal/ts_helpers.js#L58), all files have the same `_f\u003cfile_path\u003e_l\u003cline\u003e_c\u003ccolumn\u003e`. \r\n* Because uglifyer minifies the names of both classes the `\u003cunique_name\u003e` is not so unique anymore.\r\n\r\n_Solution_\r\nThere are two general paths we can take:\r\n* Suggest the user makes an exception when uglifying for the `\u003cunique_name\u003e` so it stays unique\r\n* Find a different way to generate names, that will generate classes with different names, that's also compatible with the way the runtime binding generator would generate them.\r\n\r\nThis problem does not happen when extending an interface, because the native implementation name does not take part in finding the js counterpart implementation, and all can use the same implementation of an interface.","author":{"url":"https://github.com/Plamen5kov","@type":"Person","name":"Plamen5kov"},"datePublished":"2017-01-18T15:24:37.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/692/android/issues/692"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:afdf5876-577f-6129-b3b8-10eba1680f8e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8050:281933:CAF69B:116DAA7:6A625312 |
| html-safe-nonce | e564f7718a4e5cffd812f2008f208e2c3f9ac3d385696b0cea917ab0188c0bc4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MDUwOjI4MTkzMzpDQUY2OUI6MTE2REFBNzo2QTYyNTMxMiIsInZpc2l0b3JfaWQiOiI4ODQwNjgzMDM5NDUyNDUxNjAzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | c2b0503688b616b64ea677a31448cd3c3767e824e9071c393d4695d54031ac26 |
| hovercard-subject-tag | issue:201604315 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NativeScript/android/692/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d6f20f8132009560d9b609eef37e83016a1306a3faf277bfa42b2bc98ebeba7f/NativeScript/android/issues/692 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d6f20f8132009560d9b609eef37e83016a1306a3faf277bfa42b2bc98ebeba7f/NativeScript/android/issues/692 |
| og:image:alt | Problem: Static binding generator creates wrong files, when two extended classes have the same name How can I reproduce the problem: The same class is extended 2 times in typescript https://github.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Plamen5kov |
| hostname | github.com |
| expected-hostname | github.com |
| None | 77f5af7d0fa3843b1779a53f60ec016b3f962e46051fb05c2e9b608a8138eefb |
| turbo-cache-control | no-preview |
| go-import | github.com/NativeScript/android git https://github.com/NativeScript/android.git |
| octolytics-dimension-user_id | 7392261 |
| octolytics-dimension-user_login | NativeScript |
| octolytics-dimension-repository_id | 29137950 |
| octolytics-dimension-repository_nwo | NativeScript/android |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 29137950 |
| octolytics-dimension-repository_network_root_nwo | NativeScript/android |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d3ce7d369aae307e197872f810f80f3ed9051c78 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width