Upgrade to Pro — share decks privately, control downloads, hide ads and more …

[FailConf 2018] Сказки о мертвецах

[FailConf 2018] Сказки о мертвецах

Ссылки: http://bit.ly/as-fail

52cc8a838bf44a589d2572833b2dd1b9?s=128

Vladimir Dementyev

May 12, 2018
Tweet

Transcript

  1. Сказки о мертвецах Вова Дем

  2. MY FAIL?

  3. –@mabrek “Erlang тоже мертв”

  4. ActionScript

  5. ВСЁ СТАРОЕ СТАНОВИТСЯ МОДНЫМ

  6. ECMAScript ECMAScript 3 ECMAScript 5 ECMAScript 6 4?

  7. ECMAScript 3 ECMAScript 5 ECMAScript 6 ECMAScript 4 ⛔ ECMAScript

    Harmony?
  8. None
  9. https://medium.com/@Pier/ecmascript-4-was-too-ahead-of-its-time-799e59232db0

  10. ActionScript 1 Имплементация ECMAScript 3 … и всё

  11. Actioncript 2 ECMAScript 3 + “классы” (сахар для prototype) и

    интерфейсы + опциональная типизация + зачатки метапрограммирования
  12. ActionScript 2

  13. ActionScript 3 ECMAScript 4 “Настоящие” классы Run-time type checking Пространства

    имён Proxy, Dictionary, Reflection API 2006
  14. Class Fixed property inheritance Prototype inheritance +

  15. Class

  16. is instanceof, который работает if (obj is Array) { //

    … }
  17. Where “is”?

  18. Интерфейсы public interface IDraggle extends IVisualElement, IBitmapDrawable { function getSnapshot():IDraggleSnapshot;

    /** * @see ru.teachbase.behaviors.DragBehavior */ function get dragBehavior():DragBehavior; /** * @see ru.teachbase.behaviors.DragState */ function get dragState():String; }
  19. Интерфейсы private function requestSnapshot():void { target is IDraggle && (_target

    as IDraggle).getSnapshot(); }
  20. Proxy https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/utils/Proxy.html

  21. JS Proxy https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy

  22. Proxy public class JSClient extends Proxy{ private var _target:String; public

    function JSClient(target:String) { _target = target; } internal function _wrap(body:String):String { return '(function(){ return '+body+';})'; } internal function _tojs(value:*):String { … } override flash_proxy function callProperty(name:*, …parameters):* { return ExternalInterface.call( _wrap(_target+"."+name+".apply("+_target+","+_tojs(parameters)+")") ); } }
  23. Proxy const jsWindow: JSClient = JSClient.new("window"); jsWindow.scrollTo(0, 800);

  24. Пример class PopupContainer extends MovieClip { private var popups:Dictionary =

    new Dictionary(true); function PopupContainer() { addEventListener( MouseEvent.MOUSE_DOWN, // тип события onMouseDown, // обработчик (метод класса) true, // capture EventPriority.CURSOR_MANAGEMENT, // приоритет true // weakref ); } }
  25. Фазы события

  26. Фазы события

  27. addEventListener https://caniuse.com/#feat=addeventlistener

  28. Capture https://signalvnoise.com/posts/3137-using-event-capturing-to-improve-basecamp-page-load-times

  29. Worker [Embed(source=" ../swfs/BgWorker.swf", mimeType="application/octet-stream")] private static var BgWorker_ByteClass:Class; private function

    createWorker():void { // create the background worker var workerBytes:ByteArray = new BgWorker_ByteClass(); var bgWorker:Worker = WorkerDomain.current.createWorker(workerBytes); // listen for worker state changes to know when the worker is running bgWorker.addEventListener(Event.WORKER_STATE, workerStateHandler); // set up communication between workers using // setSharedProperty(), createMessageChannel(), etc. // ... (not shown) bgWorker.start(); }
  30. ActionScript 4 Multi-core let with, prototype Function types Type inference

    Проект закрыт в 2016
  31. ActionScript 4 function foo(i :int, s :String) // :double {

    let x = 2; // x :int var r = x; // r :double r *= 0.5; return r; } let f = foo; // f :(int, String) => double var d = f(1, "Hello"); // d :double
  32. Family Flex RTMP RTMFP SWF ActionScript FLV AIR

  33. Демо http://bit.ly/demo-fail

  34. FLEX or React for ActionScript?

  35. Пример <?xml version="1.0"?> <s:Application xmlns:fx="http: //ns.adobe.com/mxml/2009" xmlns:s="library: //ns.adobe.com/flex/spark" addedToStage="init()"> <fx:Script><![CDATA[

    import ru.teachbase.utils.helpers.dummyBytes; import ru.teachbase.utils.helpers.lambda; protected function init():void { stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; // ... } ]]> </fx:Script> <s:VGroup width="100%" id="controls" visible="false"> <s:HGroup > <s:Button label="connection" click="checkConnection()" /> <s:Button label="latency" click="checkLatency()" /> </s:HGroup> <s:RichText id="resultTxt" width="100%" height="300" /> </s:VGroup> </s:Application>
  36. None
  37. “Разметка” <s:Button id="myButton" color="0x9933FF" fontSize="15" label="Click Me" click="handleClick(e)" />

  38. Binding <s:Panel id="myPanel"> </s:Panel> <s:Button width="{myPanel.width}" />

  39. Binding http://misko.hevery.com/2010/08/10/what-flex-thought-me-about-data-binding/

  40. Состояния <s:states> <s:State name="PreLoginState" /> <s:State name="AuthorizationState" /> <s:State name="LoggedInState"

    /> </s:states> <s:Button id=“button1” label.PreLoginState=“loading…" label.AuthorizationState=“Login" /> <s:Button id=“button2” includeIn="AuthorizationState" /> <s:Button id=“button3" excludeFrom="PreLoginState" />
  41. CSS-in-ASS <fx:Style> @namespace ms “library: //ns.evl.ms/flex/mars”; ms|Button { fontSize: 15;

    color: #9FA628; } </fx:Style>
  42. Расположение <s:DataGroup width="100%" height="100%"> <s:layout> <s:ButtonBarHorizontalLayout gap="-1" /> </s:layout> </s:DataGroup>

  43. Скины <fx:Component id="lastButton" > <s:Button skinClass=“evl.ms.skins.RedButton” /> </fx:Component>

  44. Flex AS3 код “Разметка” Расположение (layout) Внешний вид (skin) CSS

  45. Flux4Flex https://en.wikipedia.org/wiki/List_of_Flex_frameworks#Cairngorm

  46. AIR or Flex Native?

  47. The main selling point of React Native is fast, iterative

    development, and a promise that the same code will run on both leading mobile platforms. Often, the pitch goes as far as to say that your existing team of front- end developers, already well-versed in JavaScript, can build a companion mobile app with just minimal training. тут должен был быть скрин из блога
  48. FLASH IS DEAD

  49. “Flash проприетарный”

  50. “Flash медленный”

  51. “Flash уязвимый”

  52. ActionScript 2018 https://github.com/open-source-flash/open-source-flash

  53. ActionScript 2018 Game Engines (Starling) RedTamarin (x-platform CLIs) WebAssembly Apache

    Royal / FlexJS Haxe
  54. Конец?

  55. В ССЫЛКЕ © Призрачная Колыма http://bit.ly/as-fail