-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Feature Request: support Dart from within SVG document #2203
Comments
Removed Type-Defect label. |
This comment was originally written by [email protected] Mike, may you small example which fails for you? tia and yours, |
This comment was originally written by [email protected] I attached what I hope is a simple example. The SVG has an onload=main() that successfully runs code in a JavaScript file (that has been included by <script> tag) fine, but there is no apparent way to get the SVG onload to fire a DART program because Dartium apparently is unaware of how to process any <script> for DART language. Dartium crashes on script syntax like <script type="application/dart" xlink:href="external-code.dart"/> or "text/dart", for both inline dart code or externally-referenced dart code (using xlink:href) like this. I did not include a .dart file equivalent to the JS code, as it is irrelevant... Dartium can not find ANY .dart file referred to from within SVG, from what I can tell. A single-line external-code.dart file with "main(){}" would suffice for testing. I hope this helps clarify. Attachments: |
This comment was originally written by [email protected] Thank you very much, Mike, most appreciated. Set owner to [email protected]. |
This comment was originally written by [email protected] Mike, we decided not to support inline callbacks. So your code should be structured differently. And note as well that already main method is invoked on DOMContentLoaded event, so you do need this onload thing anyway. Added NeedsInfo label. |
This comment was originally written by [email protected] antonm... You said: "...so you do need this onload thing anyway" Next, you said "we decided not to support inline callbacks". e.g., <script type="application/dart" xlink:href="myapplication.dart"/> If this will be supported, and if Dartium will load that script and run "main()" therein by default as you said, that is fine by me. |
This comment was originally written by [email protected] Mike, sorry, my wording was far from perfect. Yes, I meant 'so you do not need this onload thing anyway'. And yes, I am fixing Dartium to support SVG documents. ETA is tomorrow my time (MSK). Added Started label. |
This comment was originally written by [email protected] Mike, I hope I've fixed at least the immediate problem. Added Fixed label. |
This comment was originally written by [email protected] antonm... In fact, now that I could use Dart, I rewrote the pseudo-examples from my Comment #3 (above), and have attached a working Dart equivalent: example SVG referencing an external .dart file, which contains main() that fires on content load... it does some simple mouse-event-interaction with the displayed Rect object. Just in case anyone wanted to see the new native-Dart version in action. Attachments: |
This comment was originally written by [email protected] I am glad to hear it and thanks a lot for very detailed bug report. Please, let us know if you meet any other problems. |
Includes the following commits: 80ac76400ff58fde3c5a335d860d196c3febe837 Warn about authors field in pubspec.yaml 6b6e02fcdd8094ccbba919b2fdc74947b1cebb71 Warn about old flutter plugin registration format (#2233) 8308acbc48ebd4da4ab7f45169af8dee4df18e79 Language versioning b18d4f6a5d035f4f72ef187e9cdb133d18848c2d update doc 408bdd58ab01689fd82cc036b4142f7b592b4ba0 Added utility for faster local testing (#2235) 055fc19d2e06e819dbd47b3b56909c47bd893f66 Upgraded package:yaml to 2.2.0 (#2237) 0f3baf7abb13702f7fb1ff3709c584065df1435c Remove unused Map `availableVersions` cfa9dc760b6b601f9473e65d15f15b60a319336d Fix to show proper error message when git is not installed (#2209) d99b0d58f4059d7bb4ac4616fd3d54ec00a2b5d4 Rephrase warnings for missing deps (#2203) 76b8c30395b37f96d3db3e842344cc842bdd7c24 Don't mention 'transformed dependencies'. (#2199) 4bd65e0f54e6e4540f03467b0272a5666e8d54ba return the hashCode of the description (#2198) 92b52682e8fc6eed9ef2e77ed890647f75570165 Test more pre-release behavior. (#2175) 066ac118d406500f672339e25f0154af9321deac update to latest pkg:analyzer (#2172) 289804a5d2c9746b4e86c271c2abcfe17417e20f Minor typo fixed (#2166) Change-Id: I3922bcaacb5399853a291b92d7192d21f719d224 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123404 Reviewed-by: Jonas Jensen <[email protected]> Commit-Queue: Sigurd Meldgaard <[email protected]>
Revisions updated by `dart tools/rev_sdk_deps.dart`. dartdoc (https://github.com/dart-lang/dartdoc/compare/a32ba3a..adc76e6): adc76e6d 2023-09-06 Parker Lougheed Take advantage of a few Dart 3 features (#3491) leak_tracker (https://github.com/dart-lang/leak_tracker/compare/098bafc..4616c8b): 4616c8b 2023-09-05 Polina Cherkasova Note about OverlayEntry. (#142) fd7d70f 2023-09-01 dependabot[bot] Bump actions/checkout from 3.5.3 to 3.6.0 (#141) c6c1004 2023-09-01 Polina Cherkasova - (#139) 0298e20 2023-08-31 Polina Cherkasova Add a test specific rule. (#138) ea17fa4 2023-08-29 Polina Cherkasova Increase version of leak_tracker_flutter_testing (#136) 8f830d6 2023-08-29 Polina Cherkasova Update pubspec.yaml (#135) 8a54575 2023-08-29 Polina Cherkasova Enable connection to vm service for flutter testing and define matcher for reporting for memory allocations. (#128) 88a19a7 2023-08-28 Polina Cherkasova - (#133) 2070856 2023-08-24 Polina Cherkasova Add instruction to start tracking instances of ChangeNotifier earlier. (#130) eb6113a 2023-08-23 Polina Cherkasova Measure how memory is consumed by a test. (#114) 72264f7 2023-08-22 Polina Cherkasova Fix misspelling. (#131) 87c9e9e 2023-08-16 Polina Cherkasova Add debugging construcstors to LeakTrackingTestConfig, per leak type. (#129) b29547a 2023-08-15 Polina Cherkasova Create visibility for roadmap for leak_tracker. (#124) 23b15b6 2023-08-15 Polina Cherkasova Fix issue of using wrong settings for a phase. (#122) 713f646 2023-08-11 Polina Cherkasova Enable global configuration for leak tracking. (#121) 19b01cf 2023-08-10 Polina Cherkasova Create package leak_tracker_flutter_testing. (#119) 02d0b2f 2023-08-07 Polina Cherkasova Stop failing if object is disposed twice. (#117) 2026379 2023-08-04 Polina Cherkasova Remove not-published versions and increase leak_tracker version. (#116) 9bb71c6 2023-08-04 Polina Cherkasova Stop requiring registration of disposed objects. (#113) 8939456 2023-08-04 Polina Cherkasova Refactor dispatcher. (#115) 6f54f5a 2023-08-01 Polina Cherkasova Start vm service when needed. (#112) b045c5e 2023-08-01 Polina Cherkasova Reorganize leak tracker for better performance. (#106) 127b83c 2023-07-31 Polina Cherkasova Update TROUBLESHOOT.md (#108) 6dabd33 2023-07-31 Polina Cherkasova Simplify and clarify instructions to fix leaks. (#107) c53db68 2023-07-25 Polina Cherkasova Improve code structure. (#103) 10cce1a 2023-07-24 Polina Cherkasova Rename `gcCountBuffer` to `numberOfGcCycles`. (#101) 3a061a4 2023-07-21 Polina Cherkasova Improve doc comments. (#100) 6e3f57c 2023-07-21 Polina Cherkasova Fix and test cover case of customized `gcCountBuffer` (#99) 2152aab 2023-07-21 Polina Cherkasova Add details about hidden leaks. (#97) lints (https://github.com/dart-lang/lints/compare/da44af3..8d5f750): 8d5f750 2023-09-06 Devon Carew move the list of lint rules from the readme to a separate rules.md file (#145) native (https://github.com/dart-lang/native/compare/a2dfedc..387f894): 387f894 2023-09-06 Gabriel Terwesten [native_toolchain_c] Default handling for PIC/PIE compiler flags (#121) 0a4e5f8 2023-09-06 Gabriel Terwesten Add support for defines to `CBuilder` (#120) webdev (https://github.com/dart-lang/webdev/compare/fc876cb..9487a45): 9487a459 2023-09-05 Jacob Bang Update README.md to use `dart pub` instead of `pub` (#2195) 07367779 2023-08-31 Elliott Brooks Pass the package config directly to the load strategy instead of depending on an app entrypoint (#2203) 0044d753 2023-08-24 Jonas Termansen Fix conflicting webdev smoke package names. (#2202) 6183f270 2023-08-23 Elliott Brooks Allow client to specify a way to convert an absolute path into a g3-relative path (#2200) b244b899 2023-08-22 Elliott Brooks Allow client to specify how to find the package config (#2199) Change-Id: Ic00adc68ec01cd0cc6e27be665436de5095d8d07 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324801 Reviewed-by: Konstantin Shcheglov <[email protected]> Commit-Queue: Devon Carew <[email protected]>
This issue was originally filed by [email protected]
I would like to use Dart in a standalone SVG document
by including a script, like...
<script type="application/dart" xlink:href="myapplication.dart"/>
...and then having my SVG onload= event launch "main()" in my Dart-
code, without the SVG requiring an outer HTML file to work.
I currently use JavaScript from within SVG documents like this for full "applications" that are ONLY an SVG document (i.e., no wrapping HTML) with embedded JavaScript, like this example (runs in Chrome):
http://www.mv4t.com/SVG/SVG_Components_Demo.svg
I would really like to convert my SVG JS code to Dart.
The text was updated successfully, but these errors were encountered: