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

BuefyのMaintainerを引き継いだ件

 BuefyのMaintainerを引き継いだ件

Kikuo Emoto

March 07, 2024
Tweet

Other Decks in Programming

Transcript

  1. ࣗݾ঺հ ,JLVPߐຊتٱஉ w ϑϦʔϥϯεͷԿͰ΋԰ w ࠷ۙͷྲྀߦΓ3VTU 5ZQF4DSJQU "844FSWFSMFTT "84$%, w

    ϓϩάϥϛϯάҎ֎ͷझຯֆɺ૸Δ͜ͱ w ޷͖ͳΞΠεϗοέʔνʔϜ1JUUTCVSHI1FOHVJOT LJLVPNBY DPEFNPOHFSJP
  2. FYUFOEͷഇࢭ #VFGZGPS7VFͷ࣮૷ެ։"1*ͷΈͰ࣮૷ w DSFBUF"QQͰ৽͍͠"QQΠϯελϯεΛ࡞੒ͯ͠ϞʔμϧΛϚ΢ϯτ const vueInstance = createApp({ render() {

    return h(Modal, { onClose: () => vueInstance.unmount() }) } }) vueInstance.mount(document.createElement('div')) ࣮ࡍͷίʔυΛ؆ུԽ ϝΠϯͷ"QQʹΠϯετʔϧͨ͠ϓϥάΠϯ౳͕Ϟʔμϧ಺Ͱ࢖͑ͳ͍
  3. FYUFOEͷഇࢭ #VFGZGPS7VFͷ࣮૷ݱঢ় w ϝΠϯ"QQͷ"QQ$POUFYU @DPOUFYU ͷத਎Λ৽͍͠"QQʹίϐʔ const { _context: srcContext

    } = mainApp const { _context: destContext } = destApp destContext.config = srcContext.config destContext.mixins = srcContext.mixins destContext.components = srcContext.components destContext.directives = srcContext.directives destContext.provides = srcContext.provides destContext.optionsCache = srcContext.optionsCache destContext.propsCache = srcContext.propsCache destContext.emitsCache = srcContext.emitsCache if ('__VUE_I18N_SYMBOL__' in mainApp) { destApp.__VUE_I18N_SYMBOL__ = mainApp.__VUE_I18N_SYMBOL__ } Πϯετʔϧ࣌ʹ͓֮͑ͯ͘ 👎ଞͷϓϥάΠϯͱͷ૬ੑ໰୊ ࣮ࡍͷίʔυΛ؆ུԽ 👎7VFͷ಺෦ߏ଄ʹґଘ͗͢͠
  4. QSPQͷॳظԽͱUIJT #VFGZGPS7VFͷ࣮૷ w λϒදࣔͳͲͰҰ෦QSPQͷॳظԽʹ7VFͷ಺෦ϑΟʔϧυUIJT@VJEΛ࢖༻ w ஋ͷলུ࣌ʹϢχʔΫ͞Λอূ͢ΔͨΊ props: { value: {

    type: String, default() { return this._uid.toString() } } } ࣮ࡍͷίʔυΛ؆ུԽ 7VFͰ͸QSPQͷσϑΥϧτؔ਺ͰUIJTΛ࢖༻Ͱ͖ͳ͍ ˠ୯७ʹUIJTVJEʹஔ͖׵͑ΒΕͳ͍
  5. QSPQͷॳظԽͱUIJT #VFGZGPS7VFͷ࣮૷۪௚൛ w ϥϯμϜͳ஋ͰQSPQΛॳظԽͯ͠ϢχʔΫ͞Λอূ // props: { value: { //

    type: String, // default() { return makeUniqueId() } // }} function makeUniqueId() { const values = new Uint8Array(12) window.crypto.getRandomValues(values) return Array.prototype.map.call( values, (v) => v.toString(16) ).join(‘') } ࣮ࡍͷίʔυΛ੔ܗ 4FSWFS4JEF3FOEFSJOH 443 ͰXJOEPXͱཚ਺͸ޚ๏౓
  6. QSPQͷॳظԽͱUIJT #VFGZGPS7VFͷ࣮૷ݱঢ় w QSPQΛOVMMͰॳظԽ͠ɺDPNQVUFEͰUIJTVJEʹϑΥʔϧόοΫ props: { value: { type: String,

    default: null } }, computed: { uniqueValue() { return this.value != null ? this.value : this.$.uid } } ࣮ࡍͷίʔυΛ؆ུԽ
  7. 7VF ͪͬͱ΋ϚΠφʔ͡Όͳ͍ϚΠφʔνΣϯδ w 7VF ʙͷڍಈWGPSͷ࠷ޙͷཁૉͷΈSFGTʹ֨ೲ ඇ഑ྻ  w SFG໊ʹΠϯσοΫεΛ௥Ճ໊ͯ͠લͷॏෳΛճආ <li

    v-for="childItem in items" :key="childItem.value"> <a :ref="`tabLink${childItem.index}`">{{ childItem.label }}</a> </li> const tab = this.$refs[`tabLink${index}`] tab.focus() ࣮ࡍͷίʔυΛ؆ུԽ ࣮ࡍͷίʔυΛ؆ུԽ
  8. 7VF ϋΠϒϦου w SFG໊ʹΠϯσοΫεΛ௥Ճ໊ͯ͠લͷॏෳΛճආ w SFGT͕഑ྻ͔൱͔Ͱόʔδϣϯ൑ఆ const tab = this.$refs[`tabLink${index}`]

    if (Array.isArray(tab)) { tab = tab[0] } tab.focus() ࣮ࡍͷίʔυΛ؆ུԽ WҎ߱ˠཁૉͷ഑ྻ
  9. ެࣜϦϦʔεʹ޲͚ͯ w 5ZQF4DSJQU΁ͷҠߦ w ෆ۩߹मਖ਼ w ࡉ͔͍#VFGZGPS7VFͱͷඇޓ׵ੑͷൃݟͱରԠ w "1*υΩϡϝϯτͷߋ৽ w

    /VYU༻ͷϞδϡʔϧ։ൃ ͝ࢼ༻ɾίϯτϦϏϡʔγϣϯ͓଴͍ͪͯ͠·͢ IUUQTHJUIVCDPNOUPIRCVFGZOFYU