$30 off During Our Annual Pro Sale. View Details »

明日から使えない廃止された Mozilla の JavaScript / Obsolete Features on Mozilla JS

明日から使えない廃止された Mozilla の JavaScript / Obsolete Features on Mozilla JS

社内 LT で使用したスライドです

nodaguti

April 01, 2020
Tweet

More Decks by nodaguti

Other Decks in Programming

Transcript

  1. ໌೔͔Β࢖͑ͳ͍ ഇࢭ͞Εͨ Mozilla ͷ JavaScript Apr 01, 2020 nodaguti @

    Web νʔϜ LT
  2. ࢲͷܦྺ • 2007: Firefox 2 ͔Β Firefox ϢʔβʔʹͳΔ • 2008:

    UserScript (Greasemonkey script) ͷ։ൃΛ࢝Ί Δ • 2009: userChrome.js script ͷ։ൃΛ࢝ΊΔ • 2010: Firefox add-on ͷ։ൃΛ࢝ΊΔ • 2015: Mozilla ͕ Chrome extension API ϕʔεͷ WebExtension ͱ͍͏࢓༷ʹҠߦΛൃදɼadd-on ։ൃ Λऴྃ͢Δ
  3. Expression Closures (ࣜΫϩʔδϟ) • Firefox 3 - Firefox 60 Ͱ࢖͑ͨ

    • Arrow function ͷઌۦ͚Έ͍ͨͳ΍ͭ • ΞυΦϯ։ൃͰ͸ׂͱॏๅͨ͠ • https://developer.mozilla.org/en-US/docs/Web/ JavaScript/Reference/Operators/Expression_Closures
  4. Array Comprehension (഑ྻ಺แ) • Firefox 30 - 58 Ͱ࢖͑ͨ •

    Mozilla ͕ ECMAScript 3.0 ࡦఆʹ޲͚ͯ Python ͬΆ͍ڍಈΛೖΕΑ͏ͱ͍ͯͨ͠ ࠒͷ΋ͷΒ͍͠ • ECMAScript 5.0 ͷޙʹվΊͯ proposal Λग़͚ͨ͠Ͳ reject ͞Εͨ • ࣮͸ for ͕ޙஔ͔Βલஔ΁ͱҰճ࢓༷͕มΘͬͨ • https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/ Array_comprehensions
  5. Array Generics • Firefox 1.5 - 70 Ͱ࢖͑ͨ • ͍͍ͪͪ

    Array.prototype.slice.call() ͷΑ͏ʹॻ͔ͳͯ͘ࡁΉͷͰͱͯ΋ָͩͬ ͨ • ඪ४Խ͞Εͳ্͔ͬͨɼArray.from ΍ array spread syntax ͕ग़͖ͯͯඞཁੑ͕ ബΕͨ • https://www.fxsitecompat.dev/en-CA/docs/2019/non-standard-array-generics- have-been-deprecated/
  6. ECMAScript for XML (E4X) • Firefox 1 - Firefox 19

    Ͱ࢖͑ͨ • XML Λ native ʹѻ͑Δػೳɽཁ͸ built-in JSX Έ͍ͨͳ΋ͷɽ • ECMA-357 ͱͯ͠ඪ४Խ͞Ε͍͕ͯͨɼଞͷͲͷϒϥ΢β΋࣮૷͠ͳ͔ͬͨ • Template literals ͕ͳ͍࣌୅ʹώΞυΩϡϝϯτ༻ͱͯ͠େ׆༂ • ࢓༷͕ෳࡶͰ੬ऑੑͷԹচͱͳΓɼଞϒϥ΢βͱͷޓ׵ੑ΋֬อ͞Εͳ͔ͬ ͨͨΊ࡟আ͞Εͨ • https://developer.mozilla.org/en-US/docs/Archive/Web/E4X
  7. Object.prototype.__noSuchMethod__ • Firefox 1 - 43 Ͱ࢖͑ͨ • Ruby ͷ

    method_missing Έ͍ͨͳ΍ͭ • __de fi neGetter__, __proto__ ͷΑ͏ʹ໊લͰղܾ͢Δ͋ͨΓʹ࣌୅Λײ͡Δ • ECMAScript 6.0 Ͱ Proxy ͕ೖͬͯ͋͑ͳ͓͘໾ޚ໔ʹ • https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ Object/noSuchMethod
  8. Object.prototype.watch / unwatch • Firefox 1 - 58 Ͱ࢖͑ͨ •

    Chrome ͕࣮૷͍ͯͨ͠ Object.prototype.observe Έ͍ͨͳ΍ͭ • ͲͪΒ΋ඪ४Խ͞Εͳ͍··࡟আ͞ΕΔ͜ͱʹͳͬͨ • ࣮ߦ࣌ͷ overhead ͕େׂ͖͍ʹ usecase ͕ͦΜͳʹͳ͍ͷ͕໰୊ͩͬͨΒ͍͠ • Angular 1 ܥͷ࣌୅Ͱ͸׆༂ͦ͠͏Ͱ͸͕͋ͬͨ... • https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/ Global_Objects/Object/watch
  9. ͓ΘΓʹ • ࣮͸·ͩ private class properties Λኲኵͱͤ͞Δ Sharp Variables ͳͲ঺հ͍ͯ͠ͳ͍΋ͷ΋͋ΔͷͰɼ

    ڵຯͷ༙͍ͨํ͸ https://developer.mozilla.org/en- US/docs/Web/JavaScript/Reference/ Deprecated_and_obsolete_features ΛͲ͏ͧ • ඪ४ԽͬͯେมͰ͢Ͷ • ඪ४Խ͞Εͳ͍ͱ༰ࣻͳ͘࡟আ͞ΕΔͷͰɼBabel ͕ ͋ͬͯ΋Α͍ stage-4 ϥΠϑΛૹΓ·͠ΐ͏
  10. ͋Γ͕ͱ͏͍͟͝·ͨ͠ ✌