Skip to content

Instantly share code, notes, and snippets.

View seia-soto's full-sized avatar
๐ŸŒด
On vacation

HoJeong Go seia-soto

๐ŸŒด
On vacation
  • Seattle, United States
  • 23:32 (UTC -07:00)
View GitHub Profile
@seia-soto
seia-soto / async-defer-module.ko.md
Last active May 23, 2023 13:55 — forked from jakub-g/async-defer-module.md
[๋ฒˆ์—ญ] ๋น„๋™๊ธฐ ์Šคํฌ๋ฆฝํŠธ, ์ง€์—ฐ ์Šคํฌ๋ฆฝํŠธ, ๊ทธ๋ฆฌ๊ณ  ๋ชจ๋“ˆ ์Šคํฌ๋ฆฝํŠธ: ์„ค๋ช…๊ณผ ๋น„๊ต ๊ทธ๋ฆฌ๊ณ  ๊ฒฐ๋ก 

<script> async, defer, async defer, module, nomodule, src, inline - the cheat sheet

ES modules์˜ ์ถ”๊ฐ€์™€ ํ•จ๊ป˜ ์ด์ œ JS ์ฝ”๋“œ๋ฅผ ๋กœ๋“œํ•˜๊ธฐ ์œ„ํ•œ 24๊ฐ€์ง€ ์ด์ƒ์˜ ๋ฐฉ๋ฒ•์ด ์ƒ๊ฒผ์Šต๋‹ˆ๋‹ค: (inline|not inline) x (defer|no defer) x (async|no async) x (type=text/javascript | type=module | nomodule) -- ๊ทธ๋ฆฌ๊ณ  ์ด๋“ค์€ ๋ฏธ๋ฌ˜ํ•˜๊ฒŒ ๋‹ค๋ฆ…๋‹ˆ๋‹ค.

์ด ๋ฌธ์„œ์—์„œ๋Š” ์†์„ฑ ๊ฐ’๋“ค์— ๋”ฐ๋ผ HTML์˜ <script> ํƒœ๊ทธ๊ฐ€ ์ฒ˜๋ฆฌ๋˜๋Š” ์—ฌ๋Ÿฌ๊ฐ€์ง€ ๋ฐฉ๋ฒ•์„ ๋น„๊ตํ–ˆ์Šต๋‹ˆ๋‹ค.

๋งŒ์•ฝ <script async type="module"> ํ˜น์€ <script nomodule defer src="...">์„ ์–ธ์ œ ์จ์•ผ ํ• ์ง€ ๊ถ๊ธˆํ•ดํ•˜์…จ๋‹ค๋ฉด ์ž˜ ์˜ค์…จ์Šต๋‹ˆ๋‹ค!

Note ์ด ๋ฌธ์„œ๋Š” <script> ํƒœ๊ทธ๋“ค์ด HTML์— ์ถ”๊ฐ€๋˜์—ˆ์„ ๋•Œ๋ฅผ ๋‹ค๋ฃน๋‹ˆ๋‹ค; ๋Ÿฐํƒ€์ž„์— ์ถ”๊ฐ€๋˜๋Š” <script> ํƒœ๊ทธ๋“ค์˜ ๋™์ž‘์€ ์‚ฌ๋ญ‡ ๋‹ค๋ฅด๋‹ˆ Jake Archibald (2013)๋‹˜์˜ Deep dive into the murky waters of script loading๋ฅผ ์ฐธ๊ณ ํ•ด์ฃผ์„ธ์š”.

@seia-soto
seia-soto / arm64e-linux.sh
Created July 5, 2020 11:21
Installs sbinger's arm64e toolchain to allow arm64e compilation on Linux
curl -LO https://github.com/sbingner/llvm-project/releases/download/v10.0.0-1/linux-ios-arm64e-clang-toolchain.tar.lzma
TMP=$(mktemp -d)
tar --lzma -xvf linux-ios-arm64e-clang-toolchain.tar.lzma -C $TMP
pushd $TMP/ios-arm64e-clang-toolchain/bin
find * ! -name clang-10 -and ! -name ldid -and ! -name ld64 -exec mv {} arm64-apple-darwin14-{} \;
find * -xtype l -exec sh -c "readlink {} | xargs -I{LINK} ln -f -s arm64-apple-darwin14-{LINK} {}" \;
popd
mkdir -p $THEOS/toolchain/linux/iphone
mv $TMP/ios-arm64e-clang-toolchain/* $THEOS/toolchain/linux/iphone/
rm -rf $TMP linux-ios-arm64e-clang-toolchain.tar.lzma