@ryoppippi

๐ŸŒถ๏ธ IMHO ๐ŸŒถ๏ธ - Rich Harris on frameworks, the web, and the edge.

26 Apr 2023 ใƒป 96 min read


Note

ใ“ใฎโ€‹่จ˜ไบ‹ใฏโ€‹Svelte/Sveltekitใฎโ€‹ไฝœ่€…ใงใ‚ใ‚‹Rich Harrisๆฐใซโ€‹ใ‚ˆใ‚‹โ€‹่ฌ›ๆผ”โ€‹ใ€Œ๐ŸŒถ๏ธ IMHO ๐ŸŒถ๏ธใ€ใ‚’โ€‹็ฟป่จณใ—ใŸโ€‹ใ‚‚ใฎใงใ™ใ€‚

ใ“ใฎโ€‹่จ˜ไบ‹ใฎโ€‹ไฝœๆˆใซใฏใ€โ€‹Whisperใซโ€‹ใ‚ˆใ‚‹โ€‹ๆ›ธใโ€‹่ตทใ“ใ—ใ€โ€‹DeepLใŠใ‚ˆใณโ€‹ChatGPTใซโ€‹ใ‚ˆใ‚‹โ€‹็ฟป่จณใ‚’โ€‹่ฃœๅŠฉ็š„ใซโ€‹ไฝฟ็”จใ—ใฆใ„ใพใ™ใ€‚ ใพใŸใ€โ€‹ๆœฌๆ–‡ไธญใซใฏโ€‹้ฉๅฎœ่จณๆณจใ‚’โ€‹ๅ…ฅใ‚Œใฆใ„ใพใ™ใ€‚

ใ“ใฎโ€‹ๅ ดใ‚’โ€‹ๅ€Ÿใ‚Šใฆใ€โ€‹็ฟป่จณใ‚’โ€‹่จฑๅฏใ—ใฆใ„ใŸใ ใ„ใŸโ€‹Richๆฐใ€โ€‹ ใพใŸโ€‹ใ“ใฎโ€‹็ฟป่จณใ‚’โ€‹ใใ‚็ดฐใ‹ใโ€‹ใƒฌใƒ“ใƒฅใƒผใ—ใฆใ„ใŸใ ใ„ใŸtomoamๆฐใ€โ€‹่‹ฑๆ–‡่งฃ้‡ˆใฎโ€‹็›ธ่ซ‡ใซโ€‹ไน—ใฃใฆใ„ใŸใ ใ„ใŸshamokitๆฐใธโ€‹ๆ„Ÿ่ฌใ‚’โ€‹่กจๆ˜Žใ—ใŸใ„ใจโ€‹ๆ€ใ„ใพใ™ใ€‚

https://youtu.be/uXCipjbcQfM

ใฏใ˜ใ‚ใซโ€‹ Introduction

ๅŽŸๆ–‡

So, Iโ€™m going to be giving a talk tonight called In My Humble Opinion, and itโ€™s a collection of loosely connected thoughts about recent trends in front-end development. Thereโ€™s a lot of really interesting and innovative stuff happening in the front-end world at the moment, and this is a good time as any to take stock of it. So, Iโ€™m going to be sharing some opinions of varying levels of spiciness, and Iโ€™m going to talk about how those opinions shape the design of Svelte and SvelteKit. Iโ€™m not here to try and convince you of anything. Youโ€™ll probably find lots to disagree with me about, but hopefully this will give you some insight into how we think about our role as toolmakers. Now, it takes a certain lack of humility to stand in front of a room of people and talk for half an hour as if my words mean something, but having said that, I am very aware that some of the ideas Iโ€™ll be talking about tonight have come from the brains of far smarter and more accomplished people than me, so take everything that I say with a grain of salt. These are humble opinions. And finally, while I think that the Svelte team would broadly agree with the things Iโ€™m going to say tonight, Iโ€™m not claiming to speak for them. Iโ€™m also not speaking for Vercel, which is a healthfully pluralistic company, even if we all dress the same. These are my humble opinions.

IMHO

ไปŠๅคœใฏโ€‹ใ€ŒIn My Humble Opinionโ€‹๏ผˆ็งใฎโ€‹่ฌ™่™šใชโ€‹ๆ„่ฆ‹๏ผ‰ใ€ใจโ€‹ใ„ใ†โ€‹ใ‚ฟใ‚คใƒˆใƒซใงใ€โ€‹ใƒ•ใƒญใƒณใƒˆใ‚จใƒณใƒ‰้–‹็™บใฎโ€‹ๆœ€่ฟ‘ใฎโ€‹ใƒˆใƒฌใƒณใƒ‰ใซโ€‹ใคใ„ใฆใ€โ€‹ใ‚†ใ‚‹โ€‹ใ‚„ใ‹ใซโ€‹ใคใชใŒใฃใŸโ€‹่€ƒใˆใ‚’โ€‹ใพใจใ‚ใŸโ€‹ใ‚‚ใฎใงใ™ใ€‚ ็พๅœจใ€โ€‹ใƒ•ใƒญใƒณใƒˆใ‚จใƒณใƒ‰็•Œ้šˆใงโ€‹้žๅธธใซโ€‹่ˆˆๅ‘ณๆทฑใใ€โ€‹้ฉๆ–ฐ็š„ใชโ€‹ใ“ใจใŒใŸใใ•ใ‚“โ€‹่ตทใ“ใฃใฆใ„ใ‚‹โ€‹ใŸใ‚ใ€โ€‹ใใ‚Œใ‚’โ€‹ๆŠŠๆกใ™ใ‚‹ใฎใซโ€‹ใ„ใ„โ€‹ๆฉŸไผšใ ใจโ€‹ๆ€ใ„ใพใ™ใ€‚ ใใ“ใงใ€โ€‹็งใฏโ€‹ใ„ใโ€‹ใคใ‹ใฎโ€‹ใ‚นใƒ‘ใ‚คใ‚ทใƒผๅบฆๅˆใ„ใฎโ€‹็•ฐใชใ‚‹โ€‹ๆ„่ฆ‹ใ‚’โ€‹ๅ…ฑๆœ‰ใ—ใ€โ€‹ใใ‚Œใ‚‰ใฎโ€‹ๆ„่ฆ‹ใŒโ€‹Svelteใจโ€‹SvelteKitใฎโ€‹่จญ่จˆใซโ€‹ใฉใฎใ‚ˆใ†ใซโ€‹ๅฝฑ้Ÿฟใ—ใฆใ„ใ‚‹ใ‹ใซโ€‹ใคใ„ใฆโ€‹่ฉฑใ—ใพใ™ใ€‚

็งใฏโ€‹ใ‚ใชใŸใ‚’โ€‹่ชฌๅพ—ใ™ใ‚‹โ€‹ใŸใ‚ใซโ€‹ใ“ใ“ใซโ€‹ใ„ใ‚‹ใฎใงใฏโ€‹ใ‚ใ‚Šใพใ›ใ‚“ใ€‚ ใ—ใ‹ใ—ใ€โ€‹็งใŸใกใŒโ€‹ใƒ„ใƒผใƒซใƒกใƒผใ‚ซใƒผใจโ€‹ใ—ใฆใฎโ€‹ๅฝนๅ‰ฒใ‚’โ€‹ใฉใฎใ‚ˆใ†ใซโ€‹่€ƒใˆใฆใ„ใ‚‹ใฎใ‹ใ€โ€‹ใ“ใฎโ€‹่ฌ›ๆผ”ใŒโ€‹ใใฎโ€‹ใƒ’ใƒณใƒˆใซโ€‹ใชใ‚Œใฐโ€‹ๅนธใ„ใงใ™ใ€‚

ใ•ใฆใ€โ€‹ๅคงๅ‹ขใฎโ€‹ไบบใฎโ€‹ๅ‰ใซโ€‹็ซ‹ใฃใฆโ€‹30ๅˆ†ใ‚‚โ€‹่‡ชๅˆ†ใฎโ€‹่จ€่‘‰ใซโ€‹ๆ„ๅ‘ณใŒโ€‹ใ‚ใ‚‹ใ‹ใฎใ‚ˆใ†ใซโ€‹่ฉฑใ™ใฎใฏโ€‹ใ‚ใ‚‹โ€‹็จฎใฎโ€‹่ฌ™่™šใ•ใฎโ€‹ๆฌ ๅฆ‚ใ‚’โ€‹ๆ„Ÿใ˜ใพใ™ใ€‚ ใใ†ใฏโ€‹่จ€ใฃใฆใ‚‚ใ€โ€‹ไปŠๅคœโ€‹ใŠ่ฉฑใ—ใ™ใ‚‹โ€‹ใ‚ขใ‚คใƒ‡ใ‚ขใฎโ€‹ใ„ใโ€‹ใคใ‹ใฏใ€โ€‹็งใ‚ˆใ‚Šใฏใ‚‹ใ‹ใซโ€‹่ณขใใ‚ˆใ‚Šโ€‹ๅ„ชใ‚ŒใŸโ€‹ไบบใ€…ใฎโ€‹้ ญ่„ณใ‹ใ‚‰โ€‹็”Ÿใพใ‚ŒใŸโ€‹ใ‚‚ใฎใ ใจโ€‹ใ„ใ†โ€‹ใ“ใจใฏโ€‹้‡ใ€…โ€‹ๆ‰ฟ็Ÿฅใ—ใฆใ„ใพใ™ใฎใงใ€โ€‹็งใฎโ€‹่จ€ใ†โ€‹ใ“ใจใฏโ€‹ใ™ในใฆโ€‹ๅคง็›ฎใซโ€‹่ฆ‹ใฆใใ ใ•ใ„ใ€‚ ใ“ใ‚Œใ‚‰ใฏ่ฌ™่™šใชโ€‹ๆ„่ฆ‹ใงใ™ใ€‚

ๆœ€ๅพŒใซใ€โ€‹Svelteใฎโ€‹ใƒใƒผใƒ ใฏใ€โ€‹็งใŒโ€‹ไปŠๅคœ่ฉฑใ™ใ“ใจใซโ€‹ๅคง็ญ‹ใงโ€‹ๅŒๆ„ใ—ใฆใใ‚Œใ‚‹ใจโ€‹ๆ€ใ„ใพใ™ใŒใ€โ€‹็งใฏโ€‹ๅฝผใ‚‰ใฎโ€‹ไปฃๅผ่€…ใงใฏโ€‹ใ‚ใ‚Šใพใ›ใ‚“ใ€‚ ใพใŸใ€โ€‹Vercelใฎโ€‹ไปฃๅผ่€…ใงใ‚‚ใ‚ใ‚Šใพใ›ใ‚“ใ€‚โ€‹Vercelใฏโ€‹ๅฅๅ…จใชโ€‹ๅคšๅ…ƒ็š„ไผๆฅญใงใ‚ใ‚Šใ€โ€‹ใŸใจใˆโ€‹็งใŸใกๅ…จๅ“กใŒโ€‹ๅŒใ˜ๆœใ‚’โ€‹็€ใฆใ„ใŸใจใ—ใฆใ‚‚ใงใ™ใ€‚ ใ“ใ‚Œใ‚‰ใฏใ€็งใฎโ€‹่ฌ™่™šใชโ€‹ๆ„่ฆ‹ใงใ™ใ€‚

ใƒ•ใƒฌใƒผใƒ ใƒฏใƒผใ‚ฏใฏโ€‹ๅ•้กŒใชใ„โ€‹ Your framework is fine โ€‹๏ผˆ๐ŸŒถ๏ผ‰

ๅŽŸๆ–‡

Iโ€™m going to start with a fairly non-spicy opinion. Thereโ€™s too much thought leadership that would have you believe that JavaScript frameworks are the root of all that is wrong with the web, and if only people would make better technology choices, the web would be perfect. The only problem with it is it is absolute horseshit. When you last went on a recipe website and had to fight through a gauntlet of ads and newsletters and cookie consent banners and the recipe authorโ€™s story about her childhood memories of Aunt Berylโ€™s butter pecan cookies, and you left thinking, if only they had used a different abstraction for creating DOM elements. No, you donโ€™t.

IMHO

ใพใšใ€โ€‹ๆฏ”่ผƒ็š„ใ‚นใƒ‘ใ‚คใ‚ทใƒผๅบฆใฎโ€‹ๅฐใ•ใ„โ€‹ๆ„่ฆ‹ใ‹ใ‚‰โ€‹ๅง‹ใ‚ใพใ™ใ€‚ JavaScriptใƒ•ใƒฌใƒผใƒ ใƒฏใƒผใ‚ฏใŒโ€‹ใ‚ฆใ‚งใƒ–ใฎโ€‹่ซธๆ‚ชใฎโ€‹ๆ นๆบใงใ‚ใ‚Šใ€โ€‹ไบบใ€…ใŒโ€‹ใ‚ˆใ‚Šโ€‹่‰ฏใ„โ€‹ๆŠ€่ก“้ธๆŠžใ‚’โ€‹ใ™ใ‚Œใฐโ€‹ใ‚ฆใ‚งใƒ–ใฏโ€‹ๅฎŒ็’งใซโ€‹ใชใ‚‹ใจโ€‹ไฟกใ˜่พผใพใ›ใ‚‹ใ‚ˆใ†ใชโ€‹ใ‚ฝใƒผใƒˆใƒชใƒผใƒ€ใƒผใ‚ทใƒƒใƒ—^[ใ‚ฝใƒผใƒˆใƒชใƒผใƒ€ใƒผใ‚ทใƒƒใƒ—(https://adv.asahi.com/marketing/keyword/11053380)]ใŒโ€‹ๅคšใ™ใŽใ‚‹ใ‚ˆใ†ใซโ€‹ๆ€ใ„ใพใ™ใ€‚ ใŸใ ใ€โ€‹ใใ‚Œใฏโ€‹ๅฎŒๅ…จใซโ€‹ๅ‡บ้ฑˆ็›ฎใงใ™ใ€‚โ€‹ใ‚ใชใŸใŒโ€‹ใƒฌใ‚ทใƒ”ใ‚ตใ‚คใƒˆใ‚’โ€‹่จชใ‚ŒใŸโ€‹้š›ใซใ€โ€‹ๅบƒๅ‘Šใ‚„โ€‹ใƒ‹ใƒฅใƒผใ‚นใƒฌใ‚ฟใƒผใ‚„โ€‹ใ‚ฏใƒƒใ‚ญใƒผใฎโ€‹ๅŒๆ„ใƒใƒŠใƒผใ‚„โ€‹ใƒฌใ‚ทใƒ”ไฝœ่€…ใฎโ€‹ๅนผๅฐ‘ๆœŸใฎโ€‹ๆ€ใ„ๅ‡บ่ฉฑใซโ€‹่‹ฆๆˆฆใ—ใŸโ€‹ๆ™‚ใ€โ€‹ๅˆฅใฎโ€‹DOM่ฆ็ด ใฎโ€‹ๆŠฝ่ฑกๅŒ–ใ‚’โ€‹ไฝฟ็”จใ—ใฆใ„ใ‚Œใฐโ€‹่‰ฏใ‹ใฃใŸใฎใซใจโ€‹ๆ€ใฃใŸโ€‹ใ“ใจใŒใ‚ใ‚Šใพใ™ใ‹๏ผŸ ใ„ใ„ใˆใ€โ€‹ใใ‚“ใชโ€‹ใ“ใจใฏโ€‹ใ‚ใ‚Šใพใ›ใ‚“ใ€‚

ใชใœ Web ใฏโ€‹ใ‚ฏใ‚ฝใชใฎใ‹ Why web sucks

ๅŽŸๆ–‡

The web doesnโ€™t suck because of JavaScript frameworks. It sucks because of capitalism. It sucks because of the attention economy, because we pay for everything with data, and because weโ€™re all slaves to the algorithm. On some level, we all know this, and so Iโ€™ve come to believe that, as framework authors, the most impactful thing we can do isnโ€™t fixating on a kilobyte here or a millisecond there. Itโ€™s empowering developers through education and documentation and diagnostics and sensible defaults to do the right thing in the face of structural forces that bend the web towards sucking it. The other stuff matters, but probably less than we think, because every now and then, someone will show some data that proves some frameworks deliver better experiences than others. This is a chart that shows how the main JavaScript-centric application frameworks score on Core Web Vitals measurements. You can see that only Astro and SvelteKit outperform the average website, but we have to be careful how we interpret this. For example, Astro explicitly markets itself as being designed for content sites that donโ€™t require much interactivity, and so it has a natural advantage over frameworks that are typically used for more demanding workloads. All of which is to say that, as much as we love to talk about technology choices, for the most part, you shouldnโ€™t feel pressured by me or anybody else to switch away from whatever makes you productive at shipping software.

IMHO

ใ‚ฆใ‚งใƒ–ใŒโ€‹้ง„็›ฎใชใฎใฏโ€‹JavaScriptใƒ•ใƒฌใƒผใƒ ใƒฏใƒผใ‚ฏใฎโ€‹ใ›ใ„ใงใฏโ€‹ใ‚ใ‚Šใพใ›ใ‚“ใ€‚ ใใ‚Œใฏโ€‹่ณ‡ๆœฌไธป็พฉใฎโ€‹ใ›ใ„ใงใ™ใ€‚ ใ‚ขใƒ†ใƒณใ‚ทใƒงใƒณใƒปใ‚จใ‚ณใƒŽใƒŸใƒผใฎโ€‹ใ›ใ„ใงใ€โ€‹ใƒ‡ใƒผใ‚ฟใงใ™ในใฆใฎโ€‹ไปฃ้‡‘ใ‚’โ€‹ๆ”ฏๆ‰•ใ†ใ‹ใ‚‰ใ€โ€‹ใใ—ใฆใ€โ€‹็งใŸใกใฏโ€‹็š†ใ€โ€‹ใ‚ขใƒซใ‚ดใƒชใ‚บใƒ ใฎโ€‹ๅฅด้šทใ ใ‹ใ‚‰โ€‹ๆœ€ๆ‚ชใชใฎใงใ™ใ€‚ ็งใŸใกใฏโ€‹็š†ใ€โ€‹ใ‚ใ‚‹โ€‹ใƒฌใƒ™ใƒซใงโ€‹ใ“ใ‚Œใ‚’โ€‹็Ÿฅใฃใฆใ„ใ‚‹ใจโ€‹ๆ€ใ„ใพใ™ใ€‚

ใ—ใŸใŒใฃใฆใ€โ€‹ใƒ•ใƒฌใƒผใƒ ใƒฏใƒผใ‚ฏใฎโ€‹ไฝœ่€…ใจโ€‹ใ—ใฆโ€‹็งใŸโ€‹ใกใŒใงใใ‚‹ใ‚‚ใฃใจใ‚‚โ€‹ๅŠนๆžœ็š„ใชโ€‹ใ“ใจใฏใ€โ€‹ใ‚ญใƒญใƒใ‚คใƒˆใ‚„โ€‹ใƒŸใƒช็ง’ใซโ€‹ใ“ใ ใ‚ใ‚‹โ€‹ใ“ใจใงใฏโ€‹ใ‚ใ‚Šใพใ›ใ‚“ใ€‚ ๆ•™่‚ฒใ‚„โ€‹ใƒ‰ใ‚ญใƒฅใƒกใƒณใƒ†ใƒผใ‚ทใƒงใƒณใ€โ€‹่จบๆ–ญใ€โ€‹ๅˆ็†็š„ใชโ€‹ใƒ‡ใƒ•ใ‚ฉใƒซใƒˆใ‚’โ€‹้€šใ˜ใฆใ€โ€‹Webใ‚’โ€‹ๆ‚ชใ„ๆ–นโ€‹ๅ‘ใซโ€‹ใญใ˜ๆ›ฒใ’ใฆใ—ใพใ†โ€‹ๆง‹้€ ็š„ใชโ€‹ๅŠ›ใซโ€‹็›ด้ขใ—ใฆใ‚‚โ€‹ๆญฃใ—ใ„โ€‹ใ“ใจใŒใงใใ‚‹ใ‚ˆใ†้–‹็™บ่€…ใ‚’โ€‹ๅผทๅŒ–ใ™ใ‚‹โ€‹ใ“ใจใงใ™ใ€‚

ไป–ใฎโ€‹ใ“ใจใ‚‚โ€‹้‡่ฆใงใ™ใŒใ€โ€‹่€ƒใˆใฆใ„ใ‚‹โ€‹ใปใฉโ€‹้‡่ฆใงใฏใชใ„ใ‹ใ‚‚ใ—ใ‚Œใพใ›ใ‚“ใ€‚ ใชใœใชใ‚‰โ€‹ๆ™‚ๆŠ˜ใ€โ€‹ใฉใ“ใ‹ใฎโ€‹่ชฐใ‹ใ•ใ‚“ใŒโ€‹ไฝ•ใ‚‰ใ‹ใฎโ€‹ใƒ‡ใƒผใ‚ฟใ‚’โ€‹ๆŒใกๅ‡บใ—ใฆใ€โ€‹ใ€ŒXXใƒ•ใƒฌใƒผใƒ ใƒฏใƒผใ‚ฏใฏโ€‹YYใƒ•ใƒฌใƒผใƒ ใƒฏใƒผใ‚ฏใ‚ˆใ‚Šใ‚‚โ€‹ๅ„ชใ‚ŒใŸโ€‹ไฝ“้จ“ใ‚’โ€‹ๆไพ›ใ—ใพใ™๏ผโ€‹ใ“ใ‚ŒใŒโ€‹่จผๆ‹ ใงใ™๏ผใ€ใชใฉใจโ€‹ใ„ใ†โ€‹็™บ่กจใ—ใŸใ‚Šใ™ใ‚‹ใ‹ใ‚‰ใงใ™ใ€‚

IMHO

ใ“ใ‚Œใฏใ€โ€‹ไธป่ฆใชโ€‹JavaScriptไธญๅฟƒใฎโ€‹ใ‚ขใƒ—ใƒชใ‚ฑใƒผใ‚ทใƒงใƒณใƒ•ใƒฌใƒผใƒ ใƒฏใƒผใ‚ฏใŒใ€โ€‹Core Web Vitalsใฎโ€‹ๆธฌๅฎšใงโ€‹ใฉใฎใ‚ˆใ†ใชโ€‹ใ‚นใ‚ณใ‚ขใ‚’โ€‹็ฒๅพ—ใ—ใŸใ‹ใ‚’โ€‹็คบใ™ใ‚ฐใƒฉใƒ•ใงใ™ใ€‚ Astroใจโ€‹SvelteKitใ ใ‘ใŒโ€‹ๅนณๅ‡็š„ใชโ€‹ใ‚ฆใ‚งใƒ–ใ‚ตใ‚คใƒˆใ‚’โ€‹ไธŠๅ›žใฃใฆใ„ใ‚‹โ€‹ใ“ใจใŒโ€‹ใ‚ใ‹ใ‚Šใพใ™ใŒใ€โ€‹ใ“ใ‚Œใ‚’โ€‹ใฉใ†โ€‹่งฃ้‡ˆใ™ใ‚‹ใ‹ใฏโ€‹ๆณจๆ„ใ—ใชใ‘ใ‚Œใฐใชใ‚Šใพใ›ใ‚“ใ€‚ ใŸโ€‹ใจใˆใฐใ€โ€‹Astroใฏใ€โ€‹ใ‚คใƒณใ‚ฟใƒฉใ‚ฏใƒ†โ€‹ใ‚ฃใƒ–ๆ€งใ‚’โ€‹ใ‚ใพใ‚Šโ€‹ๅฟ…่ฆใจใ—ใชใ„โ€‹ใ‚ณใƒณใƒ†ใƒณใƒ„ใ‚ตใ‚คใƒˆๅ‘ใ‘ใซโ€‹่จญ่จˆใ•ใ‚Œใฆใ„ใ‚‹โ€‹ใ“ใจใ‚’โ€‹ๆ˜Ž็ขบใซโ€‹ใ‚ขใƒ”ใƒผใƒซใ—ใฆใŠใ‚Šใ€โ€‹ใ‚ˆใ‚Šโ€‹่ฒ ่ทใฎโ€‹้ซ˜ใ„โ€‹ใƒฏใƒผใ‚ฏใƒญใƒผใƒ‰ใซโ€‹้€šๅธธไฝฟ็”จใ•ใ‚Œใ‚‹โ€‹ใƒ•ใƒฌใƒผใƒ ใƒฏใƒผใ‚ฏใ‚ˆใ‚Šใ‚‚โ€‹่‡ช็„ถใซโ€‹ๅ„ชไฝใซโ€‹็ซ‹ใคใ“ใจใŒใงใใพใ™ใ€‚

ใคใพใ‚Šใ€โ€‹็งใŸใกใฏโ€‹ๆŠ€่ก“ใฎโ€‹้ธๆŠžใซโ€‹ใคใ„ใฆโ€‹่ฉฑใ™ใฎใŒโ€‹ๅคงๅฅฝใใงใ™ใŒใ€โ€‹ใปใจใ‚“ใฉใฎโ€‹ๅ ดๅˆใ€โ€‹ใ‚ฝใƒ•ใƒˆใ‚ฆใ‚งใ‚ข้–‹็™บใงโ€‹ไปŠโ€‹ไฝฟ็”จใ—ใฆใ„ใ‚‹โ€‹็”Ÿ็”ฃๆ€งใฎโ€‹้ซ˜ใ„โ€‹ใƒ„ใƒผใƒซใ‹ใ‚‰โ€‹ไน—ใ‚Šๆ›ใˆใ‚‹ใ‚ˆใ†ใซโ€‹็งใ‚„โ€‹ไป–ใฎโ€‹่ชฐใ‹ใ‹ใ‚‰โ€‹่ฟซใ‚‰ใ‚Œใฆใ„ใ‚‹ใ€ใจโ€‹ๆ„Ÿใ˜ใ‚‹โ€‹ๅฟ…่ฆใฏโ€‹ใ‚ใ‚Šใพใ›ใ‚“ใ€‚

0kbใฎโ€‹JavaScriptใฏโ€‹็›ฎๆจ™ใงใฏใชใ„โ€‹ 0kb JS is not a goal (๐ŸŒถ๐ŸŒถ)

ๅŽŸๆ–‡

Next take something Iโ€™ve seen more and more of lately is people talking about zero kilobytes of JavaScript, as in, this framework ships zero kilobytes of JavaScript by default. The implication is that JavaScript is inherently bad, and so a framework that doesnโ€™t serve JavaScript is inherently good, but zero kilobytes of JavaScript is not a goal. The goal is to meet some user need, or if youโ€™re cynical, to meet some business need by way of meeting some user need, and sometimes performance is a factor in how effectively you can meet that need. Weโ€™ve all seen the studies showing that for every millisecond delay, Amazon loses a billion dollars or whatever, and sometimes you can improve startup performance by having less JavaScript, but doing so is always in the service of some other objective. Collectively, we are in danger of mistaking the means for the end, and as weโ€™ll see later, if you want the best possible performance, JavaScript is actually essential. This is something that I see with things like Lighthouse. Lighthouse is an example of Goodhartโ€™s law. When a measure becomes a target, it ceases to be a good measure. Weโ€™re incentivized to chase the green 100 at any cost. Thatโ€™s not how Lighthouse was originally supposed to be used. Lighthouse is a diagnostic tool to help us identify and fix issues. It is not a scorecard. So this is learn.svelte.dev, our interactive platform for learning Svelte and SvelteKit. It gets a pretty lousy performance score, because in order to work, it needs to download and install Node inside your browser along with SvelteKit and Vite, and then it needs to start a development server. It is doing a lot of work, and it does it pretty quickly, but not quickly enough for Lighthouse. You could get a better score by only doing that work when you start interacting with the site, but that would be a pretty serious regression in user experience. I see this pattern over and over again across all different kinds of sites. A single number simply cannot capture that nuance, and you should be wary of people who use those numbers to try and convince you of something.

IMHO

ๆœ€่ฟ‘โ€‹ใ‚ˆใโ€‹่ฆ‹ใ‹ใ‘ใ‚‹ใ‚ˆใ†ใซใชใฃใŸใฎใฏใ€โ€‹ใ€Œใ“ใฎโ€‹ใƒ•ใƒฌใƒผใƒ ใƒฏใƒผใ‚ฏใฏโ€‹ใƒ‡ใƒ•ใ‚ฉใƒซใƒˆใงโ€‹0ใ‚ญใƒญใƒใ‚คใƒˆใฎโ€‹JavaScriptใ‚’โ€‹ๅ‡บ่ทใ—ใฆใ„ใพใ™ใ€ใจโ€‹ใ„ใ†โ€‹่ฉฑใงใ™ใ€‚ JavaScriptใฏโ€‹ๆœฌ่ณช็š„ใซโ€‹ๆ‚ชใ„โ€‹ใ‚‚ใฎใชใฎใงใ€โ€‹JavaScriptใ‚’โ€‹ไฝฟใ‚ใชใ„โ€‹ใƒ•ใƒฌใƒผใƒ ใƒฏใƒผใ‚ฏใฏโ€‹ๆœฌ่ณช็š„ใซโ€‹่‰ฏใ„โ€‹ใ‚‚ใฎใ ใจโ€‹ใ„ใ†โ€‹ๆ„ๅ‘ณๅˆใ„ใงใ™ใŒใ€JavaScriptใ‚’โ€‹0ใ‚ญใƒญใƒใ‚คใƒˆใซโ€‹ใ™ใ‚‹โ€‹ใ“ใจใฏโ€‹็›ฎๆจ™ใงใฏโ€‹ใ‚ใ‚Šใพใ›ใ‚“ใ€‚ ็›ฎๆจ™ใฏโ€‹ใƒฆใƒผใ‚ถใƒผใฎโ€‹ใƒ‹ใƒผใ‚บใ‚’โ€‹ๆบ€ใŸใ™โ€‹ใ“ใจใงใ™ใ€‚โ€‹ใ‚ใ‚‹ใ„ใฏใ€โ€‹็šฎ่‚‰็š„ใซโ€‹่จ€ใˆใฐใ€โ€‹ใƒฆใƒผใ‚ถใƒผใƒ‹ใƒผใ‚บใ‚’โ€‹ๆบ€ใŸใ™ใ“ใจใซใงโ€‹ใƒ“ใ‚ธใƒใ‚นใƒ‹ใƒผใ‚บใ‚’โ€‹ๆบ€ใŸใ™โ€‹ใ“ใจใงใ™ใ€‚ ใใ—ใฆใ€โ€‹ๆ™‚ใซใฏโ€‹ใƒ‘ใƒ•ใ‚ฉใƒผใƒžใƒณใ‚นใŒโ€‹ใใฎโ€‹ใƒ‹ใƒผใ‚บใ‚’โ€‹ใ„ใ‹ใซโ€‹ๅŠนๆžœ็š„ใซโ€‹ๆบ€ใŸใ™ใ“ใจใŒใงใใ‚‹ใ‹ใฎโ€‹่ฆๅ› ใซโ€‹ใชใ‚‹ใ“ใจใ‚‚ใ‚ใ‚Šใพใ™ใ€‚

็งใŸใกใฏโ€‹็š†ใ€โ€‹1ใƒŸใƒช็ง’ใฎโ€‹้…ๅปถใ”ใจใซโ€‹AmazonใŒโ€‹10ๅ„„ใƒ‰ใƒซใฎโ€‹ๆๅคฑใ‚’โ€‹่ขซใ‚‹ใจโ€‹ใ„ใ†โ€‹็ ”็ฉถ็ตๆžœใ‚’โ€‹่ฆ‹ใŸใ“ใจใŒใ‚ใ‚Šใพใ™ใ€‚ JavaScriptใ‚’โ€‹ๅฐ‘ใชใโ€‹ใ™ใ‚‹โ€‹ใ“ใจใงโ€‹ใ‚นใ‚ฟใƒผใƒˆใ‚ขใƒƒใƒ—ใฎโ€‹ใƒ‘ใƒ•ใ‚ฉใƒผใƒžใƒณใ‚นใ‚’โ€‹ๆ”นๅ–„ใงใใ‚‹โ€‹ๅ ดๅˆใ‚‚โ€‹ใ‚ใ‚Šใพใ™ใŒใ€โ€‹ใใ‚Œใฏโ€‹ไฝ•ใ‹ๅˆฅใฎโ€‹็›ฎ็š„ใŒโ€‹ใ‚ใฃใฆโ€‹ใใ†ใ™ใ‚‹ใฎใงใ™ใ€‚

ใพใจใ‚ใฆใฟใ‚‹ใจใ€โ€‹็งใŸใกใฏโ€‹ๆ‰‹ๆฎตใจโ€‹็›ฎ็š„ใ‚’โ€‹ๅ–ใ‚Š้•ใˆใฆใ„ใ‚‹โ€‹ๅฑ้™บๆ€งใŒโ€‹ใ‚ใ‚Šใพใ™ใ€‚โ€‹ๅพŒ่ฟฐใ™ใ‚‹ใ‚ˆใ†ใซใ€โ€‹ๆœ€้ซ˜ใฎโ€‹ใƒ‘ใƒ•ใ‚ฉใƒผใƒžใƒณใ‚นใ‚’โ€‹ๆฑ‚ใ‚ใ‚‹ใชใ‚‰ใ€โ€‹ๅฎŸใฏโ€‹JavaScriptใฏโ€‹ๅฟ…่ฆไธๅฏๆฌ ใชใฎใงใ™ใ€‚

IMHO

ใ“ใ‚Œใฏใ€โ€‹Lighthouseใชใฉใงโ€‹่ฆ‹ใ‚‰ใ‚Œใ‚‹โ€‹ใ‚‚ใฎใงใ™ใ€‚ Lighthouseใฏใ€โ€‹Goodhartใฎโ€‹ๆณ•ๅ‰‡ใฎโ€‹ไพ‹ใงใ™^[Goodhartใฎโ€‹ๆณ•ๅ‰‡(https://en.wikipedia.org/wiki/Goodhartโ€™s_law)]ใ€‚โ€‹ใ‚ใ‚‹โ€‹ๆŒ‡ๆจ™ใŒโ€‹็›ฎ็š„ใซโ€‹ใชใ‚‹ใจใ€โ€‹ใใ‚Œใฏโ€‹่‰ฏใ„โ€‹ๆŒ‡ๆจ™ใงใฏใชใใชใ‚Šใพใ™ใ€‚ ไฝ•ใŒโ€‹ไฝ•ใงใ‚‚โ€‹็ท‘ใฎโ€‹100็‚นใ‚’โ€‹่ฟฝใ„โ€‹ๆฑ‚ใ‚ใ‚‹ใจโ€‹ใ„ใ†โ€‹ใ‚คใƒณใ‚ปใƒณใƒ†ใ‚ฃใƒ–ใŒโ€‹ๅƒใใฎใงใ™ใ€‚ Lighthouseใฎโ€‹ๆœฌๆฅใฎโ€‹ไฝฟใ„ๆ–นใฏโ€‹ใใ†ใงใฏโ€‹ใ‚ใ‚Šใพใ›ใ‚“ใ€‚

Lighthouseใฏใ€โ€‹ๅ•้กŒใ‚’โ€‹็‰นๅฎšใ—ใ€โ€‹ไฟฎๆญฃใ™ใ‚‹โ€‹ใŸใ‚ใฎโ€‹่จบๆ–ญใƒ„ใƒผใƒซใงใ™ใ€‚ ใ‚นใ‚ณใ‚ขใ‚ซใƒผใƒ‰ใงใฏโ€‹ใ‚ใ‚Šใพใ›ใ‚“ใ€‚

IMHO

ใ“ใ‚Œใฏใ€โ€‹Svelteใจโ€‹SvelteKitใ‚’โ€‹ๅญฆใถใŸใ‚ใฎโ€‹็งใŸใกใฎโ€‹ใ‚คใƒณใ‚ฟใƒฉใ‚ฏใƒ†ใ‚ฃใƒ–ใƒ—ใƒฉใƒƒใƒˆใƒ•ใ‚ฉใƒผใƒ ใงใ‚ใ‚‹learn.svelte.dev(่จณๆณจ: ๆ—ฅๆœฌ่ชž็‰ˆใฏlearn.svelte.jp)ใงใ™ใ€‚ ใ“ใฎโ€‹Lighthouseใฎโ€‹ใ‚นใ‚ณใ‚ขใฏโ€‹ใจใฆใ‚‚โ€‹ไฝŽใ„ใงใ™ใŒใ€โ€‹ใ“ใ‚Œใฏโ€‹Svelteใจโ€‹SvelteKitใ‚’โ€‹ๅซใ‚€Nodeใ‚’โ€‹ใƒ€ใ‚ฆใƒณใƒญใƒผใƒ‰ใ—ใฆโ€‹ใƒ–ใƒฉใ‚ฆใ‚ถใƒผๅ†…ใซโ€‹ใ‚คใƒณใ‚นใƒˆใƒผใƒซใ—ใ€โ€‹้–‹็™บใ‚ตใƒผใƒใƒผใ‚’โ€‹่ตทๅ‹•ใ™ใ‚‹โ€‹ๅฟ…่ฆใŒโ€‹ใ‚ใ‚‹โ€‹ใŸใ‚ใงใ™ใ€‚ ๅคšใใฎโ€‹ไฝœๆฅญใ‚’โ€‹่กŒใฃใฆใŠใ‚Šใ€โ€‹ใ‹ใชใ‚Šโ€‹้€Ÿใโ€‹่กŒใฃใฆใ„ใ‚‹ใฎใงใ™ใŒใ€โ€‹Lighthouseใฎโ€‹ๅŸบๆบ–ใงใฏโ€‹ๅๅˆ†ใชโ€‹้€Ÿใ•ใงใฏโ€‹ใ‚ใ‚Šใพใ›ใ‚“ใ€‚

ใ‚‚โ€‹ใ—โ€‹ใ“ใ‚Œใ‚‰ใฎโ€‹ไฝœๆฅญใ‚’โ€‹ใƒฆใƒผใ‚ถใƒผใŒโ€‹ใ‚ตใ‚คใƒˆใจโ€‹ใ‚„ใ‚Šๅ–ใ‚Šใ™ใ‚‹โ€‹ใจใใซโ€‹่กŒใ†ใ‚ˆใ†ใซโ€‹ใ™ใ‚Œใฐใ€โ€‹ใ‚นใ‚ณใ‚ขใฏโ€‹ๆ”นๅ–„ใ•ใ‚Œใ‚‹ใงใ—ใ‚‡ใ†ใ€‚โ€‹ใ—ใ‹ใ—ใ€โ€‹ใใ‚Œใฏโ€‹ใƒฆใƒผใ‚ถไฝ“้จ“ใ‚’โ€‹่‘—ใ—ใโ€‹ไฝŽไธ‹ใ•ใ›ใ‚‹โ€‹ใ“ใจใซใชใ‚Šใพใ™ใ€‚ ็งใฏโ€‹ใ“ใ‚Œใ‚’โ€‹ใ‚ใ‚‰ใ‚†ใ‚‹โ€‹็จฎ้กžใฎโ€‹ใ‚ตใ‚คใƒˆใงโ€‹ไฝ•ๅบฆใ‚‚โ€‹่ฆ‹ใฆใ„ใพใ™ใ€‚ ๅ˜ไธ€ใฎโ€‹ๆ•ฐๅญ—ใงใฏโ€‹ใใฎโ€‹ๅพฎๅฆ™ใชโ€‹ใƒ‹ใƒฅใ‚ขใƒณใ‚นใ‚’โ€‹ๆ‰ใˆใใ‚Œใชใ„ใŸใ‚ใ€โ€‹ใใ‚Œใ‚‰ใฎโ€‹ๆ•ฐๅญ—ใ‚’โ€‹ไฝฟใฃใฆโ€‹ไฝ•ใ‹ใ‚’โ€‹่ชฌๅพ—ใ—ใ‚ˆใ†ใจใ™ใ‚‹โ€‹ไบบใซใฏโ€‹่ญฆๆˆ’ใ™ในใใงใ™ใ€‚

ใปใจใ‚“ใฉใฎโ€‹ใ‚ตใ‚คใƒˆใฏโ€‹JavaScriptใชใ—ใงใ‚‚โ€‹ๅ‹•ไฝœใ™ใ‚‹ในใใงใ‚ใ‚‹โ€‹ Most sites should work without JavaScript (๐ŸŒถ๐ŸŒถ)

ๅŽŸๆ–‡

Most sites should work without JavaScript. This might seem like it directly contradicts the previous take, but it doesnโ€™t. These two things are both true. Number one, JavaScript is necessary to deliver the best possible user experience. Number two, sometimes you canโ€™t rely on JavaScript. A website I reference constantly is this one. Everyone has JavaScript, right? For those of us who live in New York, youโ€™re very familiar with the experience of loading a page while at a subway station, but losing connectivity before JavaScript loads. It really sucks. I believe that most web apps should be mostly functional without JavaScript. Say Google Calendar, for example. Obviously JavaScript is useful here, but is it essential? Can I really not see my appointments and create new ones without JavaScript? The likely answer is, well, we could, but increased development cost isnโ€™t worth it. And Iโ€™m not blaming the developers for this or for the product managers for having the wrong priorities, but I do think itโ€™s a shame that the tooling used to build apps like this one donโ€™t make it easy enough to build progressively enhanced apps. Ideally, you should get an app that works without JavaScript for free, and that is something that we on the SvelteKit team strive for. For example, we server render everything by default, and we spend a lot of time thinking about how to make it as easy or easier to use forms, which work without JavaScript, than it is to use fetch. Another reason that this is close to my heart is that in my patch career as a journalist, Iโ€™ve seen how fragile the web can be as an archival medium when it ends on JavaScript.

This is Kim Kardashianโ€™s Instagram page at various points over the last decade. Early on, the site was basically just text and images, and we can look at a snapshot today and itโ€™s perfectly preserved. By 2019, you can no longer see the actual images. Theyโ€™re still there on her account, I checked, but because theyโ€™re rendered with JavaScript, theyโ€™re not part of the archive. Finally, by 2020, the growth factors got involved, and you can no longer see anything on Instagram without logging in. And maybe you donโ€™t care what Kim Kardashian was wearing in 2017, but so much of modern culture is mediated through ephemeral digital platforms that there is a real possibility that future historians will have an easier time answering the question, what was it like to live through the space race, than answering the question, what was it like to live through the AI revolution? I think thatโ€™s a tragedy. 2016 is an interesting case because the content is actually there when you first load the page, but when the JS loads, it looks at the URL bar, says, hey, this isnโ€™t Kim Kardashianโ€™s profile, and just nukes the entire page. And we canโ€™t go back to 2016 and fix that. Frankly, if we could go back to 2016, we might have some other priorities. But what we can do is ensure that our tools today are flexible enough to continue working when unexpected things happen. So this is something that SvelteKit actually does out-of-the-box. The client-side router will gracefully figure out the base URL when it starts up.

To demonstrate this, Iโ€™ve deployed a version of our docs to the interplanetary file system, which is a peer-to-peer network for sharing files. Click on this link. So you can see that the URL there has this IPFS slash very long string in front of it. The catch with IPFS is you donโ€™t know that string until youโ€™ve generated the site because itโ€™s based on the content. So you have this chicken and egg problem. And yet, it still works. The client-side routing still works. Really difficult to use a mouse when youโ€™re facing backwards at a screen. The client-side routing works, he said, without having checked it. The search function maybe works. Okay. So things are working, even though Iโ€™m on shared Wi-Fi, and itโ€™s a little bit flaky, obviously.

But the point is that SvelteKit is designed to be resilient enough to work even in these fairly hostile environments.

IMHO

ใปใจใ‚“ใฉใฎโ€‹ใ‚ตใ‚คใƒˆใฏโ€‹JavaScriptใชใ—ใงใ‚‚โ€‹ๅ‹•ไฝœใ™ใ‚‹ในใใงใ™ใ€‚ ใ“ใ‚Œใฏโ€‹ๅ‰่ฟฐใฎโ€‹่ฆ‹่งฃใจโ€‹็›ดๆŽฅ็Ÿ›็›พใ™ใ‚‹ใ‚ˆใ†ใซโ€‹่ฆ‹ใˆใพใ™ใŒใ€โ€‹ๅฎŸ้š›ใซใฏโ€‹็Ÿ›็›พใ—ใฆใ„ใพใ›ใ‚“ใ€‚ ใ“ใ‚Œใ‚‰ใฎโ€‹2ใคใฎโ€‹ใ“ใจใฏโ€‹ไธกๆ–นใจใ‚‚โ€‹็œŸๅฎŸใงใ™ใ€‚

1ใค็›ฎใฏใ€โ€‹ๆœ€้ซ˜ใฎโ€‹ใƒฆใƒผใ‚ถใƒผไฝ“้จ“ใ‚’โ€‹ๆไพ›ใ™ใ‚‹โ€‹ใŸใ‚ใซใฏใ€โ€‹JavaScriptใŒโ€‹ๅฟ…่ฆใ ใจโ€‹ใ„ใ†โ€‹ใ“ใจใงใ™ใ€‚ 2ใค็›ฎใฏใ€โ€‹JavaScriptใซโ€‹้ ผใ‚Œใชใ„โ€‹ใ“ใจใ‚‚ใ‚ใ‚‹ใ€ใจโ€‹ใ„ใ†โ€‹ใ“ใจใงใ™ใ€‚

็งใŒโ€‹้ ป็นใซโ€‹ๅ‚็…งใ™ใ‚‹โ€‹ใ‚ฆใ‚งใƒ–ใ‚ตใ‚คใƒˆใฎโ€‹1ใคใฏใ€โ€‹ใ“ใฎโ€‹็‚นใ‚’โ€‹่ชฌๆ˜Žใ™ใ‚‹ใฎใซโ€‹้ฉใ—ใฆใ„ใพใ™ใ€‚

ใƒ‹ใƒฅใƒผใƒจใƒผใ‚ฏๅœจไฝใฎโ€‹ไบบใ€…ใซโ€‹ใจใฃใฆใ€โ€‹ๅœฐไธ‹้‰„ใฎโ€‹้ง…ใงโ€‹ใƒšใƒผใ‚ธใ‚’โ€‹่ชญใฟ่พผใ‚“ใงใ„ใ‚‹โ€‹ใจใใซใ€โ€‹JavaScriptใŒโ€‹่ชญใฟ่พผใพใ‚Œใ‚‹โ€‹ๅ‰ใซโ€‹ๆŽฅ็ถšใŒโ€‹ๅˆ‡ใ‚Œใฆใ—ใพใ†โ€‹็ตŒ้จ“ใซโ€‹้žๅธธใซโ€‹้ฆดๆŸ“ใฟใŒโ€‹ใ‚ใ‚‹ใจโ€‹ๆ€ใ„ใพใ™ใ€‚โ€‹ใใ‚Œใฏโ€‹ๆœฌๅฝ“ใซโ€‹ใคใ‚‰ใ„โ€‹ใ“ใจใงใ™ใ€‚

IMHO ็งใฏใ€โ€‹ใปใจใ‚“ใฉใฎโ€‹Webใ‚ขใƒ—ใƒชใฏโ€‹JavaScriptใชใ—ใงใ‚‚โ€‹ใปใจใ‚“ใฉโ€‹ๆฉŸ่ƒฝใ™ใ‚‹ในใใ ใจโ€‹่€ƒใˆใฆใ„ใพใ™ใ€‚ ใŸโ€‹ใจใˆใฐใ€โ€‹Googleใ‚ซใƒฌใƒณใƒ€ใƒผใ‚’โ€‹่ฆ‹ใฆใฟใพใ—ใ‚‡ใ†ใ€‚ JavaScriptใฏโ€‹ๆ˜Žใ‚‰ใ‹ใซโ€‹ใ“ใ“ใงโ€‹ๅฝน็ซ‹ใกใพใ™ใŒใ€โ€‹ใใ‚ŒใŒโ€‹ๅฟ…่ฆใชโ€‹ใ‚‚ใฎใงใ—ใ‚‡ใ†ใ‹๏ผŸ JavaScriptใชใ—ใงโ€‹่‡ชๅˆ†ใฎโ€‹ไบˆๅฎšใ‚’โ€‹่ฆ‹ใŸใ‚Šใ€โ€‹ๆ–ฐใ—ใ„โ€‹ไบˆๅฎšใ‚’โ€‹ไฝœๆˆใ—ใŸใ‚Šใงใใชใ„ใฎใงใ—ใ‚‡ใ†ใ‹๏ผŸ ็ญ”ใˆใฏใ€โ€‹ใ€Œใงใใ‚‹ใ‘ใฉใ€โ€‹้–‹็™บ่ฒปใŒโ€‹ใ‹ใ•ใ‚“ใงโ€‹ๅ‰ฒใซโ€‹ๅˆใ‚ใชใ„ใ€ใงใ—ใ‚‡ใ†ใ€‚ ็งใฏใ€โ€‹ใ“ใฎโ€‹ใ“ใจใซโ€‹ใคใ„ใฆโ€‹้–‹็™บ่€…ใ‚„โ€‹ใƒ—ใƒญใƒ€ใ‚ฏใƒˆใƒžใƒใƒผใ‚ธใƒฃใƒผใ‚’โ€‹้ž้›ฃใ™ใ‚‹โ€‹ใคใ‚‚ใ‚Šใฏโ€‹ใ‚ใ‚Šใพใ›ใ‚“ใŒใ€โ€‹ใ“ใฎใ‚ˆใ†ใชโ€‹ใ‚ขใƒ—ใƒชใ‚’โ€‹ๆง‹็ฏ‰ใ™ใ‚‹โ€‹ใŸใ‚ใฎโ€‹ใƒ„ใƒผใƒซใŒโ€‹Progressive Enhancementใชโ€‹ใ‚ขใƒ—ใƒชใ‚’โ€‹็ฐกๅ˜ใซโ€‹ไฝœใ‚Œใชใ„โ€‹ใ“ใจใ‚’โ€‹ใจใฆใ‚‚โ€‹ๆฎ‹ๅฟตใซโ€‹ๆ€ใ„ใพใ™ใ€‚

็†ๆƒณ็š„ใซใฏใ€โ€‹JavaScriptใชใ—ใงใ‚‚โ€‹ๅ‹•ไฝœใ™ใ‚‹โ€‹ใ‚ขใƒ—ใƒชใ‚’โ€‹็„กๆ–™ใงโ€‹ๆไพ›ใ™ใ‚‹โ€‹ๅฟ…่ฆใŒโ€‹ใ‚ใ‚Šใพใ™ใ€‚โ€‹ใ“ใ‚Œใฏใ€โ€‹SvelteKitใƒใƒผใƒ ใŒโ€‹็›ฎๆŒ‡ใ™ใ‚‚ใฎใฎโ€‹1ใคใงใ™ใ€‚ ใŸโ€‹ใจใˆใฐใ€โ€‹็งใŸใกใฏโ€‹ใ™ในใฆใฎโ€‹ใ‚‚ใฎใ‚’โ€‹ใ‚ตใƒผใƒใƒผใ‚ตใ‚คใƒ‰ใงโ€‹ใƒฌใƒณใƒ€ใƒชใƒณใ‚ฐใ—ใ€โ€‹ใƒ•ใ‚ฉใƒผใƒ ใ‚’โ€‹ไฝฟ็”จใ™ใ‚‹โ€‹้š›ใซโ€‹JavaScriptใชใ—ใงโ€‹ไฝฟ็”จใ™ใ‚‹โ€‹ใ“ใจใŒใงใใ‚‹ใ‚ˆใ†ใซโ€‹ใ™ใ‚‹โ€‹ๆ–นโ€‹ๆณ•ใซโ€‹ใคใ„ใฆโ€‹ๅคšใใฎโ€‹ๆ™‚้–“ใ‚’โ€‹่ฒปใ‚„ใ—ใฆโ€‹่€ƒใˆใฆใ„ใพใ™^[Form actions โ€ข Docs โ€ข SvelteKit(https://kit.svelte.jp/docs/form-actions)]ใ€‚

IMHO ใ‚‚ใ†โ€‹1ใคใฎโ€‹็†็”ฑใจโ€‹ใ—ใฆใ€โ€‹็งใฎโ€‹้ŽๅŽปใฎโ€‹ใ‚ธใƒฃใƒผใƒŠใƒชใ‚นใƒˆใจโ€‹ใ—ใฆใฎโ€‹ใ‚ญใƒฃใƒชใ‚ข^Richๆฐใฏโ€‹็พๅœจใฏโ€‹Vercelใซโ€‹ๅ‹คๅ‹™ใ—ใฆใ„ใ‚‹ใŒใ€โ€‹ใใฎๅ‰ใฏโ€‹New York Timesใงโ€‹Graphic Editorใจโ€‹ใ—ใฆโ€‹ๅƒใ„ใฆใ„ใŸใ€‚โ€‹[ใ‚ชใƒชใƒณใƒ”ใƒƒใ‚ฏใงใฎโ€‹ๆฐดๆณณ็ซถๆŠ€ใฎโ€‹ใ‚คใƒณใƒ•ใ‚ฉใ‚ฐใƒฉใƒ•ใ‚ฃใƒƒใ‚ฏ(https://twitter.com/Rich_Harris/status/1419486431534362626)ใชใฉใฎโ€‹ไฝœๅ“ใŒโ€‹ใ‚ใ‚‹ใ€‚โ€‹]ใฎโ€‹ไธญใงใ€โ€‹JavaScriptใŒโ€‹ๆญขใพใฃใฆใ—ใพใ†ใจใ€โ€‹ใ‚ฆใ‚งใƒ–ใŒโ€‹ใ‚ขใƒผใ‚ซใ‚คใƒ–ใƒกใƒ‡ใ‚ฃใ‚ขใจโ€‹ใ—ใฆใ„ใ‹ใซใ‚‚ใ‚ใใชใ‚‹ใ‹ใ‚’โ€‹็›ฎใฎโ€‹ๅฝ“ใŸใ‚Šใซโ€‹ใ—ใฆใใŸใ‹ใ‚‰ใงใ™ใ€‚ ใ“ใ‚Œใฏใ€โ€‹้ŽๅŽป10ๅนด้–“ใฎโ€‹Kim Kardashianใฎโ€‹Instagramใƒšใƒผใ‚ธใงใ™ใ€‚ ๅˆๆœŸใฏโ€‹ๅŸบๆœฌ็š„ใซโ€‹ใƒ†ใ‚ญใ‚นใƒˆใจโ€‹็”ปๅƒใ ใ‘ใงใ€โ€‹ไปŠๆ—ฅใ‚นใƒŠใƒƒใƒ—ใ‚ทใƒงใƒƒใƒˆใ‚’โ€‹่ฆ‹ใฆใ‚‚โ€‹ๅฎŒ็’งใซโ€‹ไฟๅญ˜ใ•ใ‚Œใฆใ„ใพใ™ใ€‚ 2019ๅนดใซโ€‹ใชใ‚‹ใจใ€ใ‚‚ใฏโ€‹ใ‚„โ€‹ๅฎŸ้š›ใฎโ€‹็”ปๅƒใฏโ€‹่ฆ‹ใ‚‹โ€‹ใ“ใจใŒใงใใพใ›ใ‚“ใ€‚ ็ขบ่ชใ—ใพใ—ใŸใŒใ€โ€‹ๅฝผๅฅณใฎโ€‹ใ‚ขใ‚ซใ‚ฆใƒณใƒˆใงใฏโ€‹ใพใ โ€‹ๆฎ‹ใฃใฆใ„ใพใ™ใ€‚โ€‹ใงใ™ใŒใ€โ€‹ใ‚ณใƒณใƒ†ใƒณใƒ„ใฏโ€‹JavaScriptใงโ€‹ใƒฌใƒณใƒ€ใƒชใƒณใ‚ฐใ•ใ‚Œใฆใ„ใ‚‹โ€‹ใŸใ‚ใ€โ€‹ใ‚ขใƒผใ‚ซใ‚คใƒ–ใฎโ€‹ไธ€้ƒจใซใฏโ€‹ใชใฃใฆใ„ใชใ„ใฎใงใ™ใ€‚ ๆœ€ๅพŒใซใ€โ€‹2020ๅนดใซใฏโ€‹ๆˆ้•ท่ฆๅ› ใŒโ€‹้–ขไธŽใ—ใ€โ€‹Instagramใซโ€‹ใƒญใ‚ฐใ‚คใƒณใ—ใชใ„โ€‹้™ใ‚Šโ€‹ไฝ•ใ‚‚โ€‹่ฆ‹ใ‚‹โ€‹ใ“ใจใŒใงใใพใ›ใ‚“ใ€‚ ใ‚ใชใŸใŒโ€‹2017ๅนดใซโ€‹Kim KardashianใŒโ€‹ไฝ•ใ‚’โ€‹็€ใฆใ„ใŸใ‹โ€‹ๆฐ—ใซโ€‹ใ—ใชใ„ใ‹ใ‚‚ใ—ใ‚Œใพใ›ใ‚“ใ€‚ ใ—ใ‹ใ—ใ€โ€‹็พไปฃๆ–‡ๅŒ–ใฎโ€‹ๅคšใใฏโ€‹็Ÿญๅ‘ฝใชโ€‹ใƒ‡ใ‚ธใ‚ฟใƒซใƒ—ใƒฉใƒƒใƒˆใƒ•ใ‚ฉใƒผใƒ ใ‚’โ€‹้€šใ˜ใฆโ€‹ๅช’ไป‹ใ•ใ‚Œใฆใ„ใ‚‹โ€‹ใŸใ‚ใ€โ€‹ๅฐ†ๆฅใฎโ€‹ๆญดๅฒๅฎถใฏใ€โ€‹ใ€Œๅฎ‡ๅฎ™้–‹็™บ็ซถไบ‰ใ‚’โ€‹็”ŸใๆŠœใใจใฏโ€‹ใฉใ†ใ„ใ†โ€‹ใ“ใจใ‹ใ€ใจโ€‹ใ„ใ†โ€‹่ณชๅ•ใซโ€‹็ญ”ใˆใ‚‹โ€‹ๆ–นใŒใ€โ€‹ใ€ŒAI้ฉๅ‘ฝใ‚’โ€‹็”ŸใๆŠœใใจใฏโ€‹ใฉใ†ใ„ใ†โ€‹ใ“ใจใ‹ใ€ใจโ€‹ใ„ใ†โ€‹่ณชๅ•ใซโ€‹็ญ”ใˆใ‚‹ใ‚ˆใ‚Šโ€‹็ฐกๅ˜ใซโ€‹ใชใฃใฆใ—ใพใ†โ€‹ๅฏ่ƒฝๆ€งใŒโ€‹ใ‚ใ‚‹ใฎใงใ™ใ€‚ ็งใฏโ€‹ใใ‚ŒใŒโ€‹ๆ‚ฒๅЇใ ใจโ€‹ๆ€ใ„ใพใ™ใ€‚ 2016ๅนดใฏโ€‹่ˆˆๅ‘ณๆทฑใ„โ€‹ใ‚ฑใƒผใ‚นใงใ™ใ€‚โ€‹ๆœ€ๅˆใซโ€‹ใƒšใƒผใ‚ธใ‚’โ€‹่ชญใฟ่พผใ‚€ใจโ€‹ๅฎŸ้š›ใซโ€‹ใ‚ณใƒณใƒ†ใƒณใƒ„ใŒโ€‹ใ‚ใ‚‹ใฎใงใ™ใŒใ€โ€‹JSใŒโ€‹ใƒญใƒผใƒ‰ใ•ใ‚Œใ‚‹ใจโ€‹ใ€Œใ“ใ‚Œใฏโ€‹Kim Kardashianใฎโ€‹ใƒ—ใƒญใƒ•ใ‚กใ‚คใƒซใงใฏใชใ„ใ€ใจโ€‹่กจ็คบใ•ใ‚Œใƒšใƒผใ‚ธๅ…จไฝ“ใŒโ€‹ๅ‰Š้™คใ•ใ‚Œใพใ™ใ€‚ ใใ—ใฆใ€โ€‹2016ๅนดใซโ€‹ๆˆปใฃใฆโ€‹ไฟฎๆญฃใ™ใ‚‹โ€‹ใ“ใจใฏโ€‹ใงใใชใ„ใฎใงใ™ใ€‚ ๆญฃ็›ด่จ€ใฃใฆใ€โ€‹2016ๅนดใซโ€‹ๆˆปใ‚‹โ€‹ใ“ใจใŒโ€‹ใงใใŸใ‚‰ใ€โ€‹ไป–ใซใ‚‚โ€‹ๅ„ชๅ…ˆไบ‹้ …ใŒโ€‹ใ‚ใ‚‹ใ‹ใ‚‚ใ—ใ‚Œใพใ›ใ‚“ใ€‚ ใงใ™ใŒใ€โ€‹็งใŸโ€‹ใกใŒใงใใ‚‹โ€‹ใ“ใจใฏใ€โ€‹ไปŠๆ—ฅใฎโ€‹ใƒ„ใƒผใƒซใ‚’โ€‹ๆŸ”่ปŸใซใ€โ€‹ใ‹ใคโ€‹ไบˆๆœŸใ—ใชใ„โ€‹ใ“ใจใŒโ€‹่ตทใ“ใฃใŸโ€‹ๅ ดๅˆใงใ‚‚โ€‹็ถ™็ถš็š„ใซโ€‹ๆฉŸ่ƒฝใ•ใ›ใ‚‹ใ‚ˆใ†ใซโ€‹ใ™ใ‚‹โ€‹ใ“ใจใงใ™ใ€‚

SvelteKitใฏโ€‹็ฎฑใ‹ใ‚‰โ€‹ๅ‡บใ—ใฆโ€‹ใ™ใใซโ€‹ใ“ใ‚ŒใŒโ€‹ใงใใพใ™ใ€‚ ใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆใ‚ตใ‚คใƒ‰ใฎโ€‹ใƒซใƒผใ‚ฟใƒผใฏใ€โ€‹่ตทๅ‹•ๆ™‚ใซโ€‹ใƒ™ใƒผใ‚นใจโ€‹ใชใ‚‹โ€‹URLใ‚’โ€‹ใจใณใใ‚ŠไธŠๆ‰‹ใซโ€‹ๆ‰ฑใ†ใ“ใจใŒใงใใพใ™ใ€‚ ใพใŸใ€โ€‹SvelteKitใฏโ€‹ใ‹ใชใ‚Šโ€‹้Ž้…ทใชโ€‹ใƒใƒƒใƒˆใƒฏใƒผใ‚ฏ็’ฐๅขƒไธ‹ใงใ‚‚โ€‹ๅ‹•ไฝœใ™ใ‚‹ใ‚ˆใ†ใซโ€‹่จญ่จˆใ•ใ‚Œใฆใ„ใ‚‹โ€‹ใ“ใจใŒโ€‹ใƒใ‚คใƒณใƒˆใงใ™ใ€‚โ€‹(่จณๆณจ: ใ“ใ“ใงโ€‹ใƒ‡ใƒขใ‚’โ€‹่กŒใ†)

่จณๆณจ

Progressive Enhancementใฎโ€‹ไพ‹ใจโ€‹ใ—ใฆใ€โ€‹HarrisๆฐใฏSvelteflixใ‚’โ€‹ไฝœๆˆใ—ใฆใ„ใพใ™ใ€‚ ๆ˜ฏ้žใจใ‚‚โ€‹ใŠไฝฟใ„ใฎโ€‹ใƒ–ใƒฉใ‚ฆใ‚ถใงโ€‹JavScriptใฎโ€‹ๆœ‰ๅŠน/็„กๅŠนใ‚’โ€‹ๅˆ‡ใ‚Šๆ›ฟใˆใฆโ€‹้–‹ใ„ใฆใฟใฆโ€‹ไธ‹ใ•ใ„ใ€‚

MPAใฏโ€‹ๆญปใ‚“ใ โ€‹ MPAs are dead (๐ŸŒถ๐ŸŒถ๐ŸŒถ)

ๅŽŸๆ–‡

Okay, getting a little spicier. This is the first opinion thatโ€™s probably going to make people yell at me when the recording of this goes on on YouTube in a couple of weeks. MPAs are dead. So for those of you who arenโ€™t captives of web dev Twitter, let me offer some definitions. A multi-page app, or MPA, is what people used to call a website. Itโ€™s an app where every page is rendered by the server, and if you navigate between pages, the browser will go back to the server, retrieve some fresh HTML, unload the current document, and then create a new document from the new HTML. In contrast, a single-page app, or SPA, doesnโ€™t unload the document when you navigate. Instead, a client-side router will fetch any code and data it needs for the new page, and it will update the document in place, just like any non-navigation staging. Now, advocates of the multi-page app approach have made the following claims. MPAs are faster because you donโ€™t need to load JavaScript. MPAs are more accessible. MPAs are less buggy. And MPAs can work without JavaScript. And in return, the single-page app cam says that SPAs are faster, because even though you do need to load JavaScript, youโ€™re probably going to have to load some JavaScript anyway, and this way, you only have to load your analytics or whatever once, instead of every single page load. And subsequent navigations are certainly going to be faster, because itโ€™s much easier to smartly preload data, and youโ€™re not recreating the document from scratch on every navigation. SPAs allow you to preserve state between navigations, such as the scroll position of a sidebar, or the video thatโ€™s currently playing. In an SPA, navigation is just like any other state change, so you can do things like continuous transitions. Thereโ€™s a view transitions API coming to the platform that helps with this, and itโ€™s a wonderful addition, but it only covers stuff that you can do with CSS. You can, for example, tween a numeric value in a progress indicator like this, if you were building a survey app. And SPAs give you a unified development model. Instead of having one language for your HTML and another for your DOM, SPAs are much more cohesive. Now, looking at these two lists, you might say, well, the stuff on the right is nice, but the stuff on the left is non-negotiable, and youโ€™d be right, but the reality is that that list is very out of date. Modern frameworks like Next and Remix and Sveltekit donโ€™t suffer from the problems that afflicted early SPAs, and as weโ€™ve seen, the claim that MPAs are faster than modern SPAs is highly suspect. Iโ€™ve tried to argue in the past that the distinction is actually rather unhelpful, since modern frameworks use techniques from both sides, and Iโ€™ve taken to calling them Transitional Apps, because we do not need any more moronic acronyms, but this isnโ€™t why Iโ€™m saying that MPAs are dead. Iโ€™m saying that MPAs are dead because Astro killed them. My Astro friends will be mad at me for saying this, but hereโ€™s the proof. As of last week, Astroโ€™s roadmap includes a client-side router that would turn your Astro app into a single-page app. In the words of Nate Moore, UI persistence has surfaced as a clear missing piece in the full Astro story. Client-side routing is currently the only way to achieve UI persistence across navigation. Iโ€™ll be quick to point out that this is opt-in, itโ€™s not the default, but hereโ€™s whatโ€™s going to happen. Theyโ€™re going to build this thing, and theyโ€™re going to knock it out of the park, and if itโ€™s a simple configuration change, then people will try it, even if they donโ€™t need UI persistence, and theyโ€™ll discover that for the very small price of a client-side router, their app suddenly have a nicer user experience. I would not be surprised if the default was reversed in Astro 3 or 4. So on the SvelteKit side, we use client-side routing by default. Unlike some frameworks, we donโ€™t use a link component. We just use regular A tags and intercept clicks on them. If you want to disable client-side routing for some reason, you can do it on an individual link by adding a data-sveltekit-reload attribute, or you can do it for a whole group of links or even the entire document. Now one thing that people have rightly criticized SPAs for is that they encourage longer sessions, meaning itโ€™s more likely that a new version of the app will be deployed while youโ€™re using the old one, which can cause client-side routing to fail because all of the files have moved around. So in SvelteKit, if we detect that case, we will fall back to a full page navigation, which usually fixes it, but we also make it easy to proactively detect new deployments and disable client-side routing when that happens.

IMHO

ใ•ใฆใ€โ€‹ใกใ‚‡ใฃใจโ€‹ใ‚นใƒ‘ใ‚คใ‚ทใƒผๅบฆๅˆใ„ใ‚’โ€‹ไธŠใ’ใฆใ„ใใพใ—ใ‚‡ใ†ใ€‚ ใ“ใ‚Œใฏใ€โ€‹ๆ•ฐ้€ฑ้–“ๅพŒใซโ€‹YouTubeใงโ€‹ใ“ใฎโ€‹้Œฒ็”ปใŒโ€‹ๅ…ฌ้–‹ใ•ใ‚ŒใŸโ€‹ใจใใซใ€โ€‹ใŠใใ‚‰ใโ€‹ใฟใ‚“ใชใซโ€‹ๆ€’้ณดใ‚‰ใ‚Œใ‚‹โ€‹ใ“ใจใซโ€‹ใชใ‚‹โ€‹ๆœ€ๅˆใฎโ€‹ๆ„่ฆ‹ใงใ™ใ€‚ MPAใฏโ€‹ๆญปใ‚“ใ ใ€‚

IMHO

ใจโ€‹ใ„ใ†ใ‚ใ‘ใงใ€โ€‹Web้–‹็™บ่€…ใฎโ€‹Twitterใ‚ขใ‚ซใ‚ฆใƒณใƒˆใ‚’โ€‹่ฟฝใฃใฆใชใ„โ€‹ไบบใ€…ใฎโ€‹ใŸใ‚ใซใ€โ€‹ใ“ใ“ใงโ€‹ใ„ใโ€‹ใคใ‹ๅฎš็พฉใ‚’โ€‹่ชฌๆ˜Žใ—ใพใ—ใ‚‡ใ†ใ€‚

ใƒžใƒซใƒใƒšใƒผใ‚ธใ‚ขใƒ—ใƒชใ‚ฑใƒผใ‚ทใƒงใƒณโ€‹๏ผˆMPA๏ผ‰ใฏใ€โ€‹ใ‹ใคใฆโ€‹ใ‚ฆใ‚งใƒ–ใ‚ตใ‚คใƒˆใจโ€‹ๅ‘ผใฐใ‚Œใฆใ„ใŸโ€‹ใ‚‚ใฎใงใ™ใ€‚ ใ™ในใฆใฎโ€‹ใƒšใƒผใ‚ธใŒโ€‹ใ‚ตใƒผใƒใƒผใซโ€‹ใ‚ˆใฃใฆโ€‹ใƒฌใƒณใƒ€ใƒชใƒณใ‚ฐใ•ใ‚Œใ‚‹โ€‹ใ‚ขใƒ—ใƒชใงใ€โ€‹ใƒšใƒผใ‚ธ้–“ใ‚’โ€‹็งปๅ‹•ใ™ใ‚‹โ€‹ๅ ดๅˆใฏใ€โ€‹ใƒ–ใƒฉใ‚ฆใ‚ถใŒโ€‹ใ‚ตใƒผใƒใƒผใซโ€‹ๆˆปใ‚Šใ€โ€‹ๆ–ฐใ—ใ„โ€‹HTMLใ‚’โ€‹ๅ–ๅพ—ใ—ใ€โ€‹็พๅœจใฎโ€‹ใƒ‰ใ‚ญใƒฅใƒกใƒณใƒˆใ‚’โ€‹ใ‚ขใƒณใƒญใƒผใƒ‰ใ—ใ€โ€‹ๆ–ฐใ—ใ„โ€‹HTMLใ‹ใ‚‰โ€‹ๆ–ฐใ—ใ„โ€‹ใƒ‰ใ‚ญใƒฅใƒกใƒณใƒˆใ‚’โ€‹ไฝœๆˆใ—ใพใ™ใ€‚

ๅฏพ็…ง็š„ใซใ€โ€‹ใ‚ทใƒณใ‚ฐใƒซใƒšใƒผใ‚ธใ‚ขใƒ—ใƒชโ€‹๏ผˆSPA๏ผ‰ใงใฏใ€โ€‹ใƒšใƒผใ‚ธใฎโ€‹้ท็งปๆ™‚ใซใฏโ€‹ใƒ‰ใ‚ญใƒฅใƒกใƒณใƒˆใ‚’โ€‹ใ‚ขใƒณใƒญใƒผใƒ‰ใ—ใพใ›ใ‚“ใ€‚ ไปฃใ‚ใ‚Šใซใ€โ€‹ใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆใ‚ตใ‚คใƒ‰ใฎโ€‹ใƒซใƒผใ‚ฟใƒผใŒโ€‹ๆ–ฐใ—ใ„โ€‹ใƒšใƒผใ‚ธใซโ€‹ๅฟ…่ฆใชโ€‹ใ‚ณใƒผใƒ‰ใจโ€‹ใƒ‡ใƒผใ‚ฟใ‚’โ€‹ๅ–ๅพ—ใ—็พๅœจใฎโ€‹ใƒ‰ใ‚ญใƒฅใƒกใƒณใƒˆใ‚’โ€‹ใใฎๅ ดใงโ€‹ๆ›ดๆ–ฐใ—ใพใ™ใ€‚

ใƒžใƒซใƒใƒšใƒผใ‚ธใ‚ขใƒ—ใƒชใ‚ฑใƒผใ‚ทใƒงใƒณใฎโ€‹ๆ”ฏๆŒ่€…ใฏใ€โ€‹ไปฅไธ‹ใฎโ€‹ไธปๅผตใ‚’โ€‹ใ—ใฆใ„ใพใ™ใ€‚

  • MPAใฏโ€‹JavaScriptใ‚’โ€‹่ชญใฟ่พผใ‚€ๅฟ…่ฆใŒโ€‹ใชใ„ใŸใ‚ใ€โ€‹ใ‚ˆใ‚Šโ€‹้ซ˜้€Ÿใงใ‚ใ‚‹
  • MPAใฏโ€‹ใƒใ‚ฐใŒโ€‹ๅฐ‘ใชใ„
  • MPAใฏโ€‹ใ‚ขใ‚ฏใ‚ปใ‚ทใƒ“ใƒชใƒ†ใ‚ฃใŒโ€‹้ซ˜ใ„
  • MPAใฏโ€‹JavaScriptใชใ—ใงใ‚‚โ€‹ๅ‹•ไฝœใ™ใ‚‹

ๅฏพใ—ใฆใ€โ€‹SPAๅดใฏโ€‹ใ“ใกใ‚‰ใฎโ€‹ๆ–นใŒโ€‹้€Ÿใ„ใจโ€‹ไธปๅผตใ—ใฆใ„ใพใ™ใ€‚ JavaScriptใ‚’โ€‹ใƒญใƒผใƒ‰ใ™ใ‚‹โ€‹ๅฟ…่ฆใŒโ€‹ใ‚ใ‚‹ใจใฏโ€‹ใ„ใˆใ€โ€‹ใฉใ†ใ›JavaScriptใ‚’โ€‹ใƒญใƒผใƒ‰ใ—ใชใ‘ใ‚Œใฐใชใ‚‰ใชใ„ใฎใงใ—ใ‚‡ใ†ใ—ใ€โ€‹ใ“ใฎโ€‹ๆ–นโ€‹ๆณ•ใชใ‚‰โ€‹analyticsใชใฉใ‚’โ€‹ใƒšใƒผใ‚ธ้ท็งปใฎโ€‹ใŸใณใซโ€‹ใƒญใƒผใƒ‰ใ™ใ‚‹โ€‹ๅฟ…่ฆใฏโ€‹ใชใใ€โ€‹1ๅบฆใ ใ‘ใงโ€‹ๆธˆใฟใพใ™ใ€‚ ใใ—ใฆใ€โ€‹ใใฎๅพŒใฎโ€‹ใƒšใƒผใ‚ธ้ท็งปใฏโ€‹็ขบใ‹ใซโ€‹ใ‚ˆใ‚Šโ€‹้€Ÿใใชใ‚Šใพใ™ใ€‚ ใƒ‡ใƒผใ‚ฟใ‚’โ€‹ใ‚นใƒžใƒผใƒˆใซโ€‹ใƒ—ใƒชใƒญใƒผใƒ‰ใ™ใ‚‹โ€‹ใ“ใจใŒใ‚ˆใ‚Šโ€‹็ฐกๅ˜ใงใ€โ€‹ใ™ในใฆใฎโ€‹ใƒšใƒผใ‚ธ้ท็งปใงโ€‹ใƒ‰ใ‚ญใƒฅใƒกใƒณใƒˆใ‚’โ€‹ใ‚ผใƒญใ‹ใ‚‰โ€‹ไฝœๆˆใ™ใ‚‹โ€‹ๅฟ…่ฆใŒโ€‹ใชใใชใ‚‹ใ‹ใ‚‰ใงใ™ใ€‚ SPAใงใฏใ€โ€‹ใ‚ตใ‚คใƒ‰ใƒใƒผใฎโ€‹ใ‚นใ‚ฏใƒญใƒผใƒซไฝ็ฝฎใ‚„โ€‹ๅ†็”Ÿไธญใฎโ€‹ๅ‹•็”ปใชใฉใ€โ€‹ใƒŠใƒ“ใ‚ฒใƒผใ‚ทใƒงใƒณใฎโ€‹้–“ใฎโ€‹็Šถๆ…‹ใ‚’โ€‹ไฟๆŒใงใใพใ™ใ€‚

IMHO

SPAใงใฏใ€โ€‹ใƒŠใƒ“ใ‚ฒใƒผใ‚ทใƒงใƒณใฏโ€‹ไป–ใฎโ€‹็Šถๆ…‹ๅค‰ๆ›ดใจโ€‹ๅŒใ˜ใ‚ˆใ†ใซโ€‹ๆ‰ฑใ‚ใ‚Œใ‚‹โ€‹ใŸใ‚ใ€โ€‹้€ฃ็ถš็š„ใชโ€‹ใƒˆใƒฉใƒณใ‚ธใ‚ทใƒงใƒณใฎใ‚ˆใ†ใชโ€‹ใ“ใจใŒใงใใพใ™ใ€‚ ๅ…ˆๆ—ฅView Transitions API^[SPA view transitions land in Chrome 111(https://developer.chrome.com/blog/spa-view-transitions-land/)]ใŒโ€‹่ฟฝๅŠ ใ•ใ‚Œใ€โ€‹CSSใงโ€‹ใ“ใฎใ‚ˆใ†ใชโ€‹้ท็งปใ‚’โ€‹่กŒใˆใ‚‹ใ‚ˆใ†ใซใชใ‚Šใพใ—ใŸใ€‚ ใŸโ€‹ใจใˆใฐใ€โ€‹ใ‚ตใƒผใƒ™ใ‚คใฎโ€‹ใ‚ขใƒ—ใƒชใ‚’โ€‹ไฝœใ‚‹โ€‹ๅ ดๅˆใ€โ€‹ใ“ใฎใ‚ˆใ†ใชโ€‹้€ฒๆ—ใ‚คใƒณใ‚ธใ‚ฑใƒผใ‚ฟใƒผใงโ€‹Tween Animationใ‚’โ€‹ไฝฟใฃใฆโ€‹ๆ•ฐๅ€คใ‚’โ€‹ๅ‹•ใ‹ใ™ใ“ใจใŒใงใใพใ™ใ€‚

ใพใŸใ€โ€‹SPAใฏโ€‹็ตฑไธ€ใ•ใ‚ŒใŸโ€‹้–‹็™บใƒขใƒ‡ใƒซใ‚’โ€‹ๆไพ›ใ—ใพใ™ใ€‚ HTMLใจโ€‹DOMใซโ€‹ใใ‚Œใžใ‚Œๅˆฅใฎโ€‹่จ€่ชžใ‚’โ€‹ไฝฟใ†ใฎใงใฏใชใใ€โ€‹SPAใฏโ€‹ใ‚ˆใ‚Šโ€‹ไธ€่ฒซๆ€งใฎโ€‹ใ‚ใ‚‹โ€‹้–‹็™บใƒขใƒ‡ใƒซใงใ™ใ€‚

ใ•ใฆใ€โ€‹ใ“ใฎโ€‹2ใคใฎโ€‹ใƒชใ‚นใƒˆใ‚’โ€‹่ฆ‹ใฆใ‚ใชใŸใฏโ€‹ใ€Œๅณใฎโ€‹ใ‚‚ใฎใ‚‚โ€‹ใ„ใ„ใ‘ใฉใ€โ€‹ๅทฆใฎโ€‹ใ‚‚ใฎใฏโ€‹่ญฒใ‚Œใชใ„ใ€ใจโ€‹ๆ€ใ†ใ‹ใ‚‚ใ—ใ‚Œใพใ›ใ‚“ใ€‚ ใใฎโ€‹้€šใ‚Šใชใฎใงใ™ใŒใ€โ€‹็พๅฎŸใซใฏโ€‹ใ“ใฎโ€‹ใƒชใ‚นใƒˆใฏโ€‹ใจใฆใ‚‚โ€‹ๆ™‚ไปฃ้…ใ‚Œใชใฎใงใ™ใ€‚

IMHO

Nextใ‚„โ€‹Remixใ€โ€‹Sveltekitใจโ€‹ใ„ใฃใŸโ€‹ๆœ€ๆ–ฐใฎโ€‹ใƒ•ใƒฌใƒผใƒ ใƒฏใƒผใ‚ฏใซใฏใ€โ€‹ๅˆๆœŸใฎโ€‹SPAใ‚’โ€‹่‹ฆใ—ใ‚ใŸโ€‹ๅ•้กŒใฏโ€‹ใ‚ใ‚Šใพใ›ใ‚“ใ—ใ€โ€‹ใ“ใ‚Œใพใงโ€‹่ฆ‹ใฆใใŸใ‚ˆใ†ใซใ€โ€‹MPAใŒโ€‹ๆœ€ๆ–ฐใฎโ€‹SPAใ‚ˆใ‚Šใ‚‚โ€‹้€Ÿใ„ใจโ€‹ใ„ใ†โ€‹ไธปๅผตใฏโ€‹้žๅธธใซโ€‹็–‘ใ‚ใ—ใ„ใงใ™ใ€‚

้ŽๅŽปใซโ€‹็งใฏใ€โ€‹็พไปฃใฎโ€‹ใƒ•ใƒฌใƒผใƒ ใƒฏใƒผใ‚ฏใŒโ€‹ไธกๆ–นใฎโ€‹ๅด้ขใฎโ€‹ๆŠ€่ก“ใ‚’โ€‹ไฝฟ็”จใ—ใฆใ„ใ‚‹โ€‹ใŸใ‚ใ€โ€‹ๅŒบๅˆฅใฏโ€‹ๅฎŸ้š›ใซใฏโ€‹ใ‚ใพใ‚Šๅฝนใซโ€‹็ซ‹ใŸใชใ„ใจโ€‹ไธปๅผตใ—ใฆใใพใ—ใŸใ€‚โ€‹็งใฏโ€‹ใใ‚Œใ‚‰ใ‚’โ€‹ใ€ŒTransitional Apps^Richๆฐใซโ€‹ใ‚ˆใ‚‹โ€‹[Jamstack Confใงใฎโ€‹่ฌ›ๆผ”(https://youtu.be/860d8usGC0o?t=535)ใฎโ€‹ไธญใงโ€‹็™บ่กจใ•ใ‚ŒใŸโ€‹็”จ่ชžใ€‚โ€‹ๅพ“ๆฅใฎโ€‹ใƒ‡ใ‚ถใ‚คใƒณใจโ€‹ใƒขใƒ€ใƒณใชโ€‹ใƒ‡ใ‚ถใ‚คใƒณใฎโ€‹ไธกๆ–นใฎโ€‹่‰ฏใ•ใ‚’โ€‹ไฝตใ›ๆŒใคใ€ใจโ€‹ใ„ใ†โ€‹ๆ„ๅ‘ณใฎโ€‹ใ‚ˆใ†ใ ใ€‚โ€‹]ใ€ใจโ€‹ๅ‘ผใถใ‚ˆใ†ใซใชใ‚Šใพใ—ใŸใ€‚ ใ—ใ‹ใ—ใ€โ€‹MPAใŒโ€‹ๆญปใ‚“ใ ใฎใฏโ€‹ใ“ใ‚Œใ‚‰ใŒโ€‹ๅŽŸๅ› ใงใฏโ€‹ใ‚ใ‚Šใพใ›ใ‚“ใ€‚ MPAใฏโ€‹Astroใซโ€‹ๆฎบใ•ใ‚ŒใŸใฎใงใ™

IMHO

ใ“ใ‚“ใชโ€‹ใ“ใจใ‚’โ€‹่จ€ใ†ใจโ€‹Astroใฎโ€‹ๅ‹ไบบใŸใกใซโ€‹ๆ€’ใ‚‰ใ‚Œใใ†ใงใ™ใŒใ€โ€‹ใ“ใ‚ŒใŒโ€‹ใใฎโ€‹่จผๆ‹ ใงใ™ใ€‚ ๅ…ˆ้€ฑใฎโ€‹ๆ™‚็‚นใงใ€โ€‹Astroใฎโ€‹ใƒญใƒผใƒ‰ใƒžใƒƒใƒ—ใซใฏใ€โ€‹Astroใ‚ขใƒ—ใƒชใ‚’โ€‹ใ‚ทใƒณใ‚ฐใƒซใƒšใƒผใ‚ธใ‚ขใƒ—ใƒชใซโ€‹ใ™ใ‚‹โ€‹ใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆใ‚ตใ‚คใƒ‰ใƒซใƒผใ‚ฟใŒโ€‹ๅซใพใ‚Œใฆใ„ใพใ™ใ€‚ Nate Mooreใฎโ€‹่จ€่‘‰ใ‚’โ€‹ๅ€Ÿใ‚Šใ‚Œใฐใ€โ€‹UIใซโ€‹ใŠใ‘ใ‚‹โ€‹ๆฐธ็ถšๆ€งใŒโ€‹Astroใฎโ€‹ๅ…จ่ฒŒใ‚’โ€‹่ชžใ‚‹โ€‹ไธŠใงใ€โ€‹ๆ˜Žใ‚‰ใ‹ใซโ€‹ๆฌ ใ‘ใฆใ„ใ‚‹โ€‹ใƒ”ใƒผใ‚นใจโ€‹ใ—ใฆโ€‹ๆตฎไธŠใ—ใŸใฎใงใ™ใ€‚ ็พๅœจใ€โ€‹ใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆใ‚ตใ‚คใƒ‰ใƒปใƒซใƒผใƒ†ใ‚ฃใƒณใ‚ฐใฏใ€โ€‹ใƒŠใƒ“ใ‚ฒใƒผใ‚ทใƒงใƒณ้–“ใฎโ€‹UIใซโ€‹ใŠใ‘ใ‚‹โ€‹ๆฐธ็ถšๆ€งใ‚’โ€‹ๅฎŸ็พใ™ใ‚‹โ€‹ๅ”ฏไธ€ใฎโ€‹ๆ–นๆณ•ใงใ™ใ€‚ ๅฟตใฎโ€‹็‚บใ€โ€‹ใ“ใ‚Œใฏโ€‹ใ‚ชใƒ—ใƒˆใ‚คใƒณใงใ‚ใ‚Šใ€โ€‹ใƒ‡ใƒ•ใ‚ฉใƒซใƒˆใงใฏใชใ„โ€‹ใ“ใจใ‚’โ€‹ไป˜ใ‘ๅŠ ใˆใฆโ€‹ใŠใใพใ™ใ€‚

ใ—ใ‹ใ—ใ€โ€‹ใ“ใ‚Œใ‹ใ‚‰โ€‹่ตทใ“ใ‚‹โ€‹ใ“ใจใฏโ€‹ใ“ใ†ใงใ—ใ‚‡ใ†ใ€‚ ๅฝผใ‚‰ใฏโ€‹ใ“ใฎโ€‹ใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆใ‚ตใ‚คใƒ‰ใƒซใƒผใ‚ฟใƒผใ‚’โ€‹ๅฎŒ็’งใซโ€‹ๆง‹็ฏ‰ใ—ใ€โ€‹ๅฎŸ็พใ•ใ›ใ‚‹ใงใ—ใ‚‡ใ†ใ€‚ ใ‚‚ใ—โ€‹ใใ‚ŒใŒโ€‹่จญๅฎšใ‚’โ€‹ๅฐ‘ใ—โ€‹ๅค‰ใˆใ‚‹ใ ใ‘ใงโ€‹ๅ‹•ใ‹ใ›ใ‚‹ใฎใชใ‚‰ใ€โ€‹UIใซโ€‹ใŠใ‘ใ‚‹โ€‹ๆฐธ็ถšๆ€งใŒโ€‹ๅฟ…่ฆใชใใฆใ‚‚โ€‹ไบบใ€…ใฏโ€‹ใใ‚Œใ‚’โ€‹่ฉฆใ—ใฆใฟใ‚‹ใงใ—ใ‚‡ใ†ใ€‚ ใใ—ใฆใ€โ€‹ใƒซใƒผใ‚ฟใƒผใจโ€‹ใ„ใ†โ€‹ใจใฆใ‚‚โ€‹ๅฐใ•ใชโ€‹ไปฃๅ„ŸใŒโ€‹่‡ชๅˆ†ใฎโ€‹ใ‚ขใƒ—ใƒชใซโ€‹็ช็„ถใ‚ˆใ‚Šโ€‹่‰ฏใ„โ€‹ใƒฆใƒผใ‚ถใƒผไฝ“้จ“ใ‚’โ€‹ใ‚‚ใŸใ‚‰ใ™ใ“ใจใซโ€‹ๆฐ—ใฅใใฏใšใงใ™ใ€‚

็งใฏโ€‹Astro 3ใพใŸใฏโ€‹4ใงโ€‹ใ“ใ‚ŒใŒโ€‹ใƒ‡ใƒ•ใ‚ฉใƒซใƒˆๅŒ–ใ•ใ‚Œใฆใ‚‚โ€‹้ฉšใ‹ใชใ„ใงใ—ใ‚‡ใ†ใ€‚

IMHO

SvelteKitๅดใงใฏใ€โ€‹ใƒ‡ใƒ•ใ‚ฉใƒซใƒˆใงโ€‹ใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆใ‚ตใ‚คใƒ‰ใƒปใƒซใƒผใƒ†ใ‚ฃใƒณใ‚ฐใ‚’โ€‹ไฝฟ็”จใ™ใ‚‹โ€‹ใ“ใจใซใ—ใพใ—ใŸใ€‚ ใ“ใ“ใงใฏใ€โ€‹ใ„ใโ€‹ใคใ‹ใฎโ€‹ใƒ•ใƒฌใƒผใƒ ใƒฏใƒผใ‚ฏใจใฏโ€‹็•ฐใชใ‚Šใ€โ€‹ใƒชใƒณใ‚ฏใ‚ณใƒณใƒใƒผใƒใƒณใƒˆใ‚’โ€‹ไฝฟ็”จใ—ใพใ›ใ‚“ใ€‚ ้€šๅธธใฎโ€‹aใ‚ฟใ‚ฐใ‚’โ€‹ไฝฟ็”จใ—ใ€โ€‹ใใ‚ŒใŒโ€‹ใ‚ฏใƒชใƒƒใ‚ฏใ•ใ‚ŒใŸโ€‹ใจใใซโ€‹้ฉๅˆ‡ใซโ€‹ใ“ใ‚Œใ‚’โ€‹ๅ‡ฆ็†ใ—ใพใ™ใ€‚ ใ‚‚ใ—โ€‹ไฝ•ใ‚‰ใ‹ใฎโ€‹็†็”ฑใงโ€‹ใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆใ‚ตใ‚คใƒ‰ใƒปใƒซใƒผใƒ†ใ‚ฃใƒณใ‚ฐใ‚’โ€‹็„กๅŠนใซโ€‹ใ—ใŸใ„โ€‹ๅ ดๅˆใฏใ€data-sveltekit-reloadใจโ€‹ใ„ใ†โ€‹ๅฑžๆ€งใ‚’โ€‹่ฟฝๅŠ ใ—ใพใ™ใ€‚โ€‹ใ“ใ‚Œใฏโ€‹ๅ€‹ใ€…ใฎโ€‹ใƒชใƒณใ‚ฏใซโ€‹่ฟฝๅŠ ใ™ใ‚‹โ€‹ใ“ใจใ‚‚โ€‹ใงใใพใ™ใ—ใ€โ€‹ใƒชใƒณใ‚ฏใฎโ€‹ใ‚ฐใƒซใƒผใƒ—ๅ…จไฝ“ใ€โ€‹ใพใŸใฏโ€‹ใƒ‰ใ‚ญใƒฅใƒกใƒณใƒˆๅ…จไฝ“ใซใ‚‚โ€‹่ฟฝๅŠ ใ™ใ‚‹โ€‹ใ“ใจใŒใงใใพใ™ใ€‚

IMHO

SPAใฏโ€‹ใ‚ปใƒƒใ‚ทใƒงใƒณใŒโ€‹้•ทใใชใ‚‹โ€‹ใŸใ‚ใ€โ€‹ๅคใ„โ€‹ใ‚ขใƒ—ใƒชใ‚’โ€‹ไฝฟ็”จใ—ใฆใ„ใ‚‹โ€‹้–“ใซโ€‹ๆ–ฐใ—ใ„โ€‹ใƒใƒผใ‚ธใƒงใƒณใฎโ€‹ใ‚ขใƒ—ใƒชใŒโ€‹ใƒ‡ใƒ—ใƒญใ‚คใ•ใ‚Œใ‚‹โ€‹ๅฏ่ƒฝๆ€งใŒโ€‹้ซ˜ใใ€โ€‹ใ™ในใฆใฎโ€‹ใƒ•ใ‚กใ‚คใƒซใฎโ€‹ๅ ดๆ‰€ใŒโ€‹ๅค‰ใ‚ใฃใฆใ—ใพใฃใฆโ€‹ใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆใ‚ตใ‚คใƒ‰ใฎโ€‹ใƒซใƒผใƒ†ใ‚ฃใƒณใ‚ฐใŒโ€‹ๅคฑๆ•—ใ™ใ‚‹โ€‹ๅฏ่ƒฝๆ€งใŒโ€‹ใ‚ใ‚‹ใ€ใจโ€‹ๆ‰นๅˆคใ•ใ‚Œใ‚‹โ€‹ใ“ใจใŒใ‚ใ‚Šใพใ™ใ€‚ SvelteKitใงใฏใ€โ€‹ใ“ใฎใ‚ˆใ†ใชโ€‹ใ‚ฑใƒผใ‚นใ‚’โ€‹ๆคœๅ‡บใ™ใ‚‹ใจใ€โ€‹้€šๅธธใฏโ€‹ใƒ•ใƒซใƒšใƒผใ‚ธใƒŠใƒ“ใ‚ฒใƒผใ‚ทใƒงใƒณใซโ€‹ใƒ•ใ‚ฉใƒผใƒซใƒใƒƒใ‚ฏใ—ใฆโ€‹่งฃๆฑบใ—ใพใ™ใŒใ€โ€‹ๆ–ฐใ—ใ„โ€‹ใƒ‡ใƒ—ใƒญใ‚คใƒกใƒณใƒˆใ‚’โ€‹ใƒ—ใƒญใ‚ขใ‚ฏใƒ†ใ‚ฃใƒ–ใซโ€‹ๆคœๅ‡บใ—ใฆโ€‹ใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆใ‚ตใ‚คใƒ‰ใƒซใƒผใƒ†ใ‚ฃใƒณใ‚ฐใ‚’โ€‹็„กๅŠนใซโ€‹ใ™ใ‚‹โ€‹ใ“ใจใ‚‚โ€‹ๅฎนๆ˜“ใซโ€‹ใ—ใฆใ„ใพใ™ใ€‚

่จณๆณจ

Astroใฏใ€โ€‹็™ปๅ ดๆ™‚ใซใฏโ€‹Zero JSใ‚’โ€‹ๆŽฒใ’ใฆใ„ใพใ—ใŸใŒใ€โ€‹ใใฎโ€‹ๆ–‡่จ€ใฏโ€‹็พๅœจใฏโ€‹ๅ‰Š้™คใ•ใ‚Œใฆใ„ใพใ™ใ€‚ ใพใŸใ€โ€‹Astroใฎโ€‹CEOใงใ‚ใ‚‹โ€‹Fred K. Schottๆฐใฏโ€‹ใ“ใ‚Œใซโ€‹ๅๅฏพใ—ใฆใ„ใ‚‹ใ‚ˆใ†ใงใ™ใ€‚ https://twitter.com/FredKSchott/status/1648963240779558915?s=20

ๆ˜Ž็คบ็š„ใชโ€‹DSLใฏโ€‹่‰ฏใ„โ€‹ใ‚‚ใฎใงใ™ Explicit DSLs are good (๐ŸŒถ๐ŸŒถ)

ๅŽŸๆ–‡

Alright, next opinion is that explicit DSLs, domain-specific languages, are good. DSLs get a bad rap. I lie to them. DSLs are in contrast to general-purpose programming languages like JavaScript. HTML is a DSL, CSS is a DSL, JSON is a DSL, SQL is a DSL, regular expressions are a DSL. We donโ€™t tend to think of those as such because theyโ€™re already so pervasive and people are fine with the DSLs that they already know, but you can do some pretty cool stuff with DSLs. This is LuCy by Matthew Phillips, and itโ€™s one of my favorite examples from recent memory. Itโ€™s a DSL for describing state machines, and you can clearly see how much more expressive the DSL version is than the general-purpose one. This is cool, and I want to see more stuff like this.

IMHO

ๆฌกใฎโ€‹ๆ„่ฆ‹ใฏใ€โ€‹ๆ˜Ž็คบ็š„ใชโ€‹DSLใ€โ€‹ใคใพใ‚Šโ€‹ใƒ‰ใƒกใ‚คใƒณๅ›บๆœ‰่จ€่ชžใฏโ€‹่‰ฏใ„ใจโ€‹ใ„ใ†โ€‹ใ‚‚ใฎใงใ™ใ€‚ DSLใฎโ€‹้ขจ่ฉ•่ขซๅฎณใฏโ€‹ใ™ใ”ใ„ใงใ™ใ€‚ ็งใฏโ€‹ใใ‚Œใ‚‰ใฎโ€‹ๆ„่ฆ‹ใ‚’โ€‹ๅ˜˜ใคใใ ใจโ€‹ๆ€ใฃใฆใ„ใพใ™ใ€‚ DSLใฏโ€‹JavaScriptใฎใ‚ˆใ†ใชโ€‹ๆฑŽ็”จใƒ—ใƒญใ‚ฐใƒฉใƒŸใƒณใ‚ฐ่จ€่ชžใจโ€‹ๅฏพ็…ง็š„ใงใ™ใ€‚ HTMLใ€โ€‹CSSใ€โ€‹JSONใ€โ€‹SQLใ€โ€‹ๆญฃ่ฆ่กจ็พใ€โ€‹ใ“ใ‚Œใ‚‰ใฏโ€‹ใ™ในใฆโ€‹DSLใงใ™ใ€‚ ็งใŸใกใฏโ€‹ใ“ใ‚Œใ‚‰ใ‚’โ€‹ใ™ใงใซโ€‹ๅบƒใโ€‹ไฝฟใฃใฆใ„ใ‚‹โ€‹ใŸใ‚ใ€โ€‹ใใ‚Œใ‚‰ใ‚’โ€‹DSLใจโ€‹่€ƒใˆใ‚‹โ€‹ๅ‚พๅ‘ใฏโ€‹ใ‚ใ‚Šใพใ›ใ‚“ใŒใ€โ€‹DSLใ‚’โ€‹ไฝฟใฃใฆโ€‹ใ‹ใชใ‚Šโ€‹ใ‚ฏใƒผใƒซใชโ€‹ใ“ใจใŒใงใใพใ™ใ€‚

IMHO

ใŸโ€‹ใจใˆใฐโ€‹Matthew PhillipsๆฐใŒโ€‹้–‹็™บใ—ใฆใ„ใ‚‹LuCyใฏโ€‹็งใฎโ€‹ๆœ€่ฟ‘ใฎโ€‹ใŠๆฐ—ใซโ€‹ๅ…ฅใ‚Šใฎโ€‹ไพ‹ใฎโ€‹1ใคใงใ™ใ€‚ ใ“ใ‚Œใฏโ€‹ใ‚นใƒ†ใƒผใƒˆใƒžใ‚ทใƒณใ‚’โ€‹่จ˜่ฟฐใ™ใ‚‹โ€‹ใŸใ‚ใฎโ€‹DSLใงใ‚ใ‚Šใ€โ€‹ๆฑŽ็”จ่จ€่ชžใ‚ˆใ‚Šใ‚‚โ€‹DSL็‰ˆใฎโ€‹ๆ–นใŒโ€‹ใฉใ‚Œใ ใ‘โ€‹่กจ็พๅŠ›ใŒโ€‹้ซ˜ใ„ใ‹ใŒโ€‹ใ‚ˆใโ€‹ใ‚ใ‹ใ‚‹ใจโ€‹ๆ€ใ„ใพใ™ใ€‚ ็งใฏโ€‹ใ“ใฎใ‚ˆใ†ใชโ€‹ใ‚ฏใƒผใƒซใชโ€‹ใ‚‚ใฎใ‚’โ€‹ใ‚‚ใฃใจโ€‹่ฆ‹ใŸใ„ใจโ€‹ๆ€ใฃใฆใ„ใพใ™ใ€‚

JavaScriptใฏโ€‹ใ‚คใƒ™ใƒณใƒˆ้ง†ๅ‹•ใ€โ€‹UIใฏโ€‹็Šถๆ…‹้ง†ๅ‹• JavaScript is event-driven; UI is state-driven

ๅŽŸๆ–‡

You see, fundamentally, JavaScript is an event-driven language, which means that we predominantly write code in terms of things that are changing in response to things like user action. But when we build user interfaces, weโ€™re thinking primarily in terms of state. This is the imperative-declarative split, or whatever you want to call it. So thereโ€™s an impedance mismatch at the very foundation between the language that weโ€™re forced to use and the task for which weโ€™re using it. Things like JSX and hooks and signals and all of the other innovations of the front-end world over the last decade or so are all in some way an attempt to resolve that contradiction by letting you write code that is state-first. HTML, on the other hand, is a really good language for describing UI. Thereโ€™s no temporal aspect to it. Itโ€™s almost like a physical substance like clay, or at least thatโ€™s how I think of it. The catch, of course, is that HTML is static, so you canโ€™t use it to describe things with rich interactivity. But what if we started with HTML and used that as a springboard to create a new DSL? Well, thatโ€™s basically what Svelte is. Weโ€™ve augmented HTML with state and control flow, weโ€™ve augmented CSS with scope styles, and weโ€™ve augmented JavaScript with reactivity. Some people are really put off by this, and thatโ€™s totally fine. For people who arenโ€™t anti-DSL, weโ€™ve found that this hits a sweet spot between familiarity and novelty. Weโ€™re using languages that you already know, but weโ€™re extending them in useful ways, and like with the Lucy example, weโ€™re able to express UI much more concisely this way.

IMHO

JavaScriptใฏโ€‹ใ‚คใƒ™ใƒณใƒˆ้ง†ๅ‹•ๅž‹ใฎโ€‹่จ€่ชžใชใฎใงใ€โ€‹ใ€Œใ‚ณใƒณใƒ†ใƒณใƒ„ใฏโ€‹ใƒฆใƒผใ‚ถใƒผใฎโ€‹ใ‚ขใ‚ฏใ‚ทใƒงใƒณใซโ€‹ๅฟœใ˜ใฆโ€‹ๅค‰ๅŒ–ใ™ใ‚‹โ€‹ใ‚‚ใฎใงใ‚ใ‚‹ใ€ใจโ€‹ใ„ใ†โ€‹่ฆณ็‚นใงโ€‹ใ‚ณใƒผใƒ‰ใ‚’โ€‹ๆ›ธใใฎใŒโ€‹ๅŸบๆœฌใงใ™ใ€‚ ๅฏพใ—ใฆใ€โ€‹ใƒฆใƒผใ‚ถใƒผใ‚คใƒณใ‚ฟใƒผใƒ•ใ‚งใ‚คใ‚นใ‚’โ€‹ไฝœใ‚‹โ€‹ใจใใซใฏใ€โ€‹ไธปใซโ€‹็Šถๆ…‹ใจโ€‹ใ„ใ†โ€‹่ฆณ็‚นใ‹ใ‚‰โ€‹่€ƒใˆใพใ™ใ€‚ ใ“ใ‚ŒใŒใ€โ€‹ๅ‘ฝไปคๅž‹ใจโ€‹ๅฎฃ่จ€ๅž‹ใฎโ€‹ๅˆ†้›ขใ€โ€‹ใชใฉใจโ€‹ๅ‘ผใ‚“ใ ใ‚Šใ—ใพใ™ใ€‚ ใคใพใ‚Šใ€โ€‹็งใŸใกใŒโ€‹ไฝฟใ‚ใ–ใ‚‹ใ‚’โ€‹ๅพ—ใชใ„โ€‹่จ€่ชžใจใ€โ€‹ใใ‚Œใ‚’โ€‹ไฝฟ็”จใ™ใ‚‹ใฏโ€‹ใšใฎโ€‹ใ‚ฟใ‚นใ‚ฏใจใฎโ€‹้–“ใซใฏใ€โ€‹ๆ นๆœฌ็š„ใชโ€‹ๆ€่€ƒๅ›ž่ทฏใฎโ€‹ไธไธ€่‡ดใŒโ€‹ใ‚ใ‚‹ใฎใงใ™ใ€‚

JSXใ€โ€‹ใƒ•ใƒƒใ‚ฏใ€โ€‹ใ‚ทใ‚ฐใƒŠใƒซใ€โ€‹ใใ—ใฆโ€‹้ŽๅŽป10ๅนด้–“ใซโ€‹ใŠใ‘ใ‚‹โ€‹ใƒ•ใƒญใƒณใƒˆใ‚จใƒณใƒ‰ใฎโ€‹ไธ–็•Œใฎโ€‹ใ™ในใฆใฎโ€‹ใใฎโ€‹ไป–ใฎโ€‹้ฉๆ–ฐใฏใ€โ€‹ใ™ในใฆใ€โ€‹็Šถๆ…‹ใ‚’โ€‹ๆœ€ๅ„ชๅ…ˆใซโ€‹ใ—ใŸโ€‹ใ‚ณใƒผใƒ‰ใ‚’โ€‹ๆ›ธใโ€‹ใ“ใจใŒใงใใ‚‹ใ‚ˆใ†ใซโ€‹ใ™ใ‚‹โ€‹ใŸใ‚ใฎโ€‹่ฉฆใฟใงใ‚ใ‚Šใ€โ€‹ใ“ใฎโ€‹็Ÿ›็›พใ‚’โ€‹่งฃๆฑบใ—ใ‚ˆใ†ใจใ™ใ‚‹โ€‹่ฉฆใฟใงใ™ใ€‚

ไธ€ๆ–นใ€โ€‹HTMLใฏโ€‹UIใ‚’โ€‹่จ˜่ฟฐใ™ใ‚‹โ€‹ใŸใ‚ใซโ€‹้žๅธธใซโ€‹ๅ„ชใ‚ŒใŸโ€‹่จ€่ชžใงใ™ใ€‚ ๆ™‚้–“็š„ใชโ€‹ๅด้ขใŒโ€‹ใชใใ€โ€‹ ็ฒ˜ๅœŸใฎใ‚ˆใ†ใชโ€‹็‰ฉ็†็š„ใชโ€‹็‰ฉ่ณชใซโ€‹่ฟ‘ใ„ใจโ€‹ใ„ใ†ใ‹ใ€โ€‹ๅฐ‘ใชใใจใ‚‚โ€‹็งใฏโ€‹ใใ†โ€‹่€ƒใˆใฆใ„ใพใ™ใ€‚ ใ‚‚ใกใ‚ใ‚“ใ€โ€‹HTMLใฏโ€‹้™็š„ใชโ€‹ใ‚‚ใฎใชใฎใงใ€โ€‹ใƒชใƒƒใƒใงโ€‹ใ‚คใƒณใ‚ฟใƒฉใ‚ฏใƒ†โ€‹ใ‚ฃใƒ–ๆ€งใ‚’โ€‹ๆŒใคใ‚‚ใฎใ‚’โ€‹่กจ็พใ™ใ‚‹ใฎใซใฏโ€‹ไฝฟใˆใพใ›ใ‚“ใ€‚ ใงใฏโ€‹HTMLใ‚’โ€‹ๅ‡บ็™บ็‚นใซโ€‹ใ—ใฆโ€‹ๆ–ฐใ—ใ„โ€‹DSLใ‚’โ€‹ไฝœใ‚‹ใจใ—ใŸใ‚‰โ€‹ใฉใ†ใงใ—ใ‚‡ใ†๏ผŸ ใใ‚ŒใŒโ€‹Svelteใงใ™ใ€‚

IMHO

็งใŸใกใฏโ€‹Svelteใงใ€โ€‹HTMLใ‚’โ€‹็Šถๆ…‹ใจโ€‹ๅˆถๅพกใƒ•ใƒญใƒผใ‚’โ€‹ๅ‚™ใˆใŸโ€‹ใ‚‚ใฎใซใ€โ€‹CSSใ‚’โ€‹ใ‚นใ‚ณใƒผใƒ—ใ‚นใ‚ฟใ‚คใƒซใชโ€‹ใ‚‚ใฎใซใ€โ€‹JavaScriptใ‚’โ€‹ใƒชใ‚ขใ‚ฏใƒ†ใ‚ฃใƒ–ใชโ€‹ใ‚‚ใฎใซโ€‹ๆ‹กๅผตใ—ใฆใ„ใพใ™ใ€‚ ไธ€้ƒจใฎโ€‹ไบบใ€…ใฏโ€‹ใ“ใ‚Œใซโ€‹ๅฏพใ—ใฆโ€‹ๆœฌๅฝ“ใซโ€‹ใŒใฃใ‹ใ‚Šใ—ใฆใ„ใ‚‹ใ‹ใ‚‚ใ—ใ‚Œใพใ›ใ‚“ใŒใ€โ€‹ใใ‚Œใฏโ€‹ใใ‚Œใงโ€‹ใ„ใ„ใ‚“ใงใ™ใ€‚ DSLใซโ€‹ๆŠตๆŠ—ใŒโ€‹ใชใ„โ€‹ไบบใŸใกใซโ€‹ใจใฃใฆใฏใ€โ€‹Svelteใฏโ€‹่ฆชใ—ใฟใ‚„ใ™ใ•ใจโ€‹ๆ–ฐใ—ใ•ใฎโ€‹้–“ใฎโ€‹ใ‚นใ‚คใƒผใƒˆใ‚นใƒใƒƒใƒˆใงใ‚ใ‚‹โ€‹ใ“ใจใŒโ€‹ใ‚ใ‹ใ‚Šใพใ—ใŸใ€‚ ็งใŸใกใŒโ€‹ใ‚ˆใโ€‹็Ÿฅใฃใฆใ„ใ‚‹โ€‹่จ€่ชžใ‚’โ€‹ไพฟๅˆฉใซโ€‹ๆ‹กๅผตใ™ใ‚‹โ€‹ใ“ใจใงใ€โ€‹LucyใŒโ€‹ๆˆใ—้‚ใ’ใŸใ‚ˆใ†ใซใ€โ€‹Svelteใงใฏโ€‹UIใ‚’โ€‹ใ‚ˆใ‚Šโ€‹็ฐกๆฝ”ใซโ€‹่กจ็พใ™ใ‚‹โ€‹ใ“ใจใŒใงใใ‚‹ใฎใงใ™ใ€‚

ๆš—้ป™ใฎโ€‹DSLใฏโ€‹โ€ฆโ€‹ใ‚ใพใ‚Šโ€‹่‰ฏใใชใ„ใงใ™ Implicit DSLs areโ€ฆโ€‹ less good (๐ŸŒถ๐ŸŒถ๐ŸŒถ)

ๅŽŸๆ–‡

So I am pro-DSL, but there is a crucial caveat. You have to be honest about it. In the Svelte case, weโ€™re using .svelte files. When you open a .svelte file, youโ€™re entering a kind of liminal space where the normal rules of programming are briefly suspended, and again, some people want nothing to do with that, and thatโ€™s fine. I think most of us like having a little magic in our lives from time to time. Hereโ€™s where it starts to get a little bit too weird for me. If you start changing the semantics of JavaScript inside JavaScript files, Iโ€™m out. This has been a recurring theme recently across a whole bunch of different projects, and itโ€™s a phenomenon that I think deserves a little bit more scrutiny than itโ€™s currently getting. Before I give you an example of this, Iโ€™m going to tell a little story. Back in 2015, I was working on Rollup, the JavaScript module bundler, and I implemented a heuristic that I thought was pretty clever. If you werenโ€™t using the imports from a given module, like ease and transition from D3 transition there, then Rollup simply wouldnโ€™t add it to the module graph, it would just discard it. As an escape hatch, if you did need to add the module to the module graph anyway because of some side effects, then you could add the import without any specifiers, and then Rollup would include it. I was young, and I was naive, and this seemed like a really smart optimization. Around the same time, the D3 community had browbeaten Mike Bostock into using a module bundler, and he basically said, fine, Iโ€™ll rewrite everything in CommonJS and use Browserify. I was horrified by this, because that meant the D3 bundle was going to get slow and large, and so I cold emailed him and said, hey, I really think you should use JavaScript modules for this, and tooling isnโ€™t quite there yet, but, like, hereโ€™s the thing that Iโ€™m working on. And that was on May 27th, 2015, and on May 29th, he started filing issues on Rollup, which I didnโ€™t even expect and was kind of terrified by, and this is an example of one of them. Now, Mike is the nicest, most wonderful man, and he is much too kind to put it like this, but what heโ€™s saying in this issue is JavaScript doesnโ€™t work like that, you numpty, and heโ€™s right, it doesnโ€™t. You canโ€™t just remove modules from the graph without fundamentally altering the semantics of the code. Iโ€™ve fast-forwarded a few years, and some frameworks have decided that ignoring the semantics of JavaScript isnโ€™t just okay, itโ€™s actually a core selling point of the framework. Iโ€™m going to use Remix as an example, but itโ€™s not the only one. Prior to version 13 in the introduction of the app router, Next.js did something similar for example. This is a Remix route. The idea is that your server code, which loads data, can be co-located with your view code. When the client app is built, the loader, and anything that it depends on, is tree-shaken away. But this isnโ€™t tree-shaking, this is made-up, non-standard JavaScript semantics. You might think, all right, Rich, you poindexter, who made you the JavaScript hall monitor? And youโ€™d have a point, but it does have real-world impacts. There is actually a whole page in the Remix doc about working around the problems created by this design. And aside from the practical impacts, thereโ€™s something about the blurring of boundaries between server and client that I think is inherently confusing. Iโ€™ve heard multiple people say that theyโ€™re often not entirely sure where their code is going to end up running. More alarming to me is the possibility that you could end up with server code in your client bundle. Even Michael, who invented Remix, acknowledges that this is a real-world problem. Youโ€™re one sleep-deprived mistake away from accidentally including something sensitive in the JavaScript that you serve to users. And even if you donโ€™t make that mistake, youโ€™re still prohibited from using source maps to debug your app in production because the source maps will contain the entire module, including your database queries or whatever. So why am I talking about other frameworksโ€™ design decisions? Iโ€™m not telling you donโ€™t use Remix. And Iโ€™m not saying the Remix team should make different choices. Thatโ€™s not my business. But oftentimes, people will say, other frameworks are doing X, should SvelteKit do the same thing? And then it becomes my business. The reason for the design choice is that itโ€™s convenient to co-locate related pieces of code. Now, you donโ€™t need to sell me on the benefits of co-location. I was doing single file components back in 2014 before Vue or anyone else. I am Mr. Co-location. I love it. But co-locating code that crosses a server client boundary in a single file is too much for me. We prototyped it in Svelte, and itโ€™s always given us bad vibes. So in SvelteKit, we donโ€™t co-locate in files. We co-locate in directories. This is a screenshot of a SvelteKit code base. In a SvelteKit app, each directory is a route. And each route can contain server code for loading data and view code that runs on both the server and the client. So this is actually the demo app that you get when you do npm create svelte. Inside src/route, might be hard to see because itโ€™s kind of small. Thereโ€™s a lot going on here. But inside src/route, weโ€™ve got an about route and a sverdle route, which is a Wordle clone that works without JavaScript. The pageโ€™s server code for the Svelte clone goes in a +page.server.js on the left here. And any file with that suffix cannot be imported into client-side code. Your app will simply fail to build. And directory-based routing is something that we stole from Next.js. And it has a list of other benefits thatโ€™s too long to get into right now. But I strongly believe that this is the way. One little easter egg that Iโ€™ll show you is that on the right in +page.svelte on line 16, weโ€™re hovering over data.guesses. And itโ€™s giving us the type and the inline documentation that we wrote on the left on line 9. So we get type safety across the network. This is the sort of thing thatโ€™s made possible by embracing strong conventions. And far from being a worst developer experience, I actually find this preferable. Iโ€™ll often have my data loading server code open on one side and the view code that uses it on the other. Screens are wide. But files are tall. And so itโ€™s just a bad use of real estate to try and stack everything into a single file. Okay. Another example of nonstandard semantics. This slide from the Qwik team. Qwik is a framework that transforms your code in such a way that it can lazily load individual functions when it needs them and then recreate their lexical scope. It is extremely clever stuff and is worth paying attention to. I personally have some reservations about stuff like this. If you move the increment function out of the block of JSX, the app breaks. If it was JavaScript, that would be fine. But itโ€™s not JavaScript. Itโ€™s Qwik. Itโ€™s effectively a DSL for more granular code splitting. By the same token, you have to be careful about what values you reference inside that function because in order to recreate the lexical scope, the framework has to serialize it. I mentioned this on Twitter a while back. Within a few hours, Manu from the Qwik team had added a much more helpful error message so that you can diagnose the problem because they are brilliant and dedicated. But this is really just one example of a more wide-ranging trend that Iโ€™m seeing where in order to successfully work with JavaScript or TypeScript, you have to understand some very sophisticated transformations that are happening behind the scenes. There are some other drawbacks to the lazy loading approach like you canโ€™t conditionally prevent an event default, which is something I do all the time, without opting out of the programming model altogether. But fundamentally, itโ€™s this mismatch between what the code does and what it looks like it does that I get hung up on. For an experiment, I asked ChatGPT to refactor the component and at first it tried to enforce React idioms. But when I explained that we canโ€™t use useState here, it made the exact same mistake, hoisting the increment function out of the JSX because it thought it was dealing with JavaScript. Another example from Solid. It looks very much like these two components should behave the same way based on our understanding of JSX and JavaScript, but theyโ€™re actually very different. If youโ€™re familiar with Solid, then this makes total sense. But thereโ€™s no obvious signpost here. So will people with less familiarity be able to successfully maintain this code base five years from now? I donโ€™t know. Maybe. I donโ€™t mean to pick on these frameworks because theyโ€™re all doing really interesting and cool stuff. These are just some particularly notable examples. And they will all point out elements of Svelteโ€™s programming model that theyโ€™re not very keen on. And nor am I telling you what to think. I do encourage you to play around with these frameworks and develop your own opinion. Iโ€™m just telling you what I think. And what I think is that your scientists were so preoccupied with whether or not they could that they didnโ€™t stop to think if they should.

IMHO

็งใฏโ€‹DSLใซโ€‹่‚ฏๅฎš็š„ใงใ™ใŒใ€โ€‹้‡่ฆใชโ€‹ๆณจๆ„็‚นใŒโ€‹ใ‚ใ‚Šใพใ™ใ€‚ ๆญฃ็›ดใงใ‚ใ‚‹โ€‹ๅฟ…่ฆใŒโ€‹ใ‚ใ‚‹ใฎใงใ™ใ€‚

Svelteใฎโ€‹ๅ ดๅˆใ€โ€‹.svelteใƒ•ใ‚กใ‚คใƒซใ‚’โ€‹ไฝฟ็”จใ—ใฆใ„ใพใ™ใ€‚ .svelteใƒ•ใ‚กใ‚คใƒซใ‚’โ€‹้–‹ใใจใ€โ€‹้€šๅธธใฎโ€‹ใƒ—ใƒญใ‚ฐใƒฉใƒŸใƒณใ‚ฐใฎโ€‹ใƒซใƒผใƒซใŒโ€‹ไธ€ๆ™‚็š„ใซโ€‹ไธญๆ–ญใ•ใ‚Œใ‚‹ใ‚ˆใ†ใชใ€โ€‹ใ‚ใ‚‹โ€‹็จฎใฎโ€‹Liminal Space^็พๅฎŸโ€‹็ฉบ้–“ใจโ€‹็•ฐโ€‹็ฉบ้–“ใฎโ€‹็‹ญ้–“ใฎโ€‹ใ“ใจใ€‚โ€‹[Liminal space (aesthetic)(https://en.wikipedia.org/wiki/Liminal_space_(aesthetic))]ใซโ€‹ๅ…ฅใ‚‹โ€‹ใ“ใจใซใชใ‚Šใพใ™ใ€‚ ใ“ใ†ใ„ใฃใŸโ€‹็ฉบ้–“ใŒโ€‹ๅซŒใชโ€‹ไบบใ‚‚โ€‹ใ„ใ‚‹ใงใ—ใ‚‡ใ†ใŒใ€โ€‹ใใ‚Œใฏโ€‹ใใ‚Œใงโ€‹ใ„ใ„ใฎใงใ™ใ€‚ ็งใŸใกใฎโ€‹ใปใจใ‚“ใฉใฏใ€โ€‹ๆ™‚ใซใฏโ€‹ไบบ็”Ÿใซโ€‹้ญ”ๆณ•ใ‚’โ€‹ๆ„Ÿใ˜ใŸใ„ใจโ€‹ๆ€ใ†ใฎใงใฏใชใ„ใงใ—ใ‚‡ใ†ใ‹ใ€‚

IMHO

ใ“ใ“ใงใ€โ€‹็งใซโ€‹ใจใฃใฆโ€‹ๅฅ‡ๅฆ™ใซโ€‹ๆ„Ÿใ˜ใ‚‹โ€‹ใ“ใจใซโ€‹ใคใ„ใฆโ€‹่ฉฑใ—ใฆใ„ใใพใ™ใ€‚ ใ‚‚ใ—่ชฐใ‹ใŒโ€‹JavaScriptใƒ•ใ‚กใ‚คใƒซใฎโ€‹ไธญใงโ€‹JavaScriptใฎโ€‹ใ‚ปใƒžใƒณใƒ†ใ‚ฃใ‚ฏใ‚นใ‚’โ€‹ๅค‰ใˆๅง‹ใ‚ใŸใ‚‰ใ€โ€‹็งใฏโ€‹้€ƒใ’ๅ‡บใ—ใฆใ—ใพใ†ใงใ—ใ‚‡ใ†ใ€‚ ใ“ใ‚Œใฏโ€‹ๆœ€่ฟ‘ใ€โ€‹ใ•ใพใ–ใพใชโ€‹ใƒ—ใƒญใ‚ธใ‚งใ‚ฏใƒˆใงโ€‹็นฐใ‚Š่ฟ”ใ•ใ‚Œใฆใ„ใ‚‹โ€‹ใƒ†ใƒผใƒžใงใ€โ€‹็พๅœจใ‚ˆใ‚Šใ‚‚โ€‹ใ‚‚ใ†โ€‹ๅฐ‘ใ—โ€‹็ฒพๆŸปใ•ใ‚Œใฆใ—ใ‹ใ‚‹ในใ็พ่ฑกใ ใจโ€‹็งใฏโ€‹่€ƒใˆใฆใ„ใพใ™ใ€‚

IMHO

ใ“ใ‚Œใซโ€‹ใคใ„ใฆใฎโ€‹ไพ‹ใ‚’โ€‹็คบใ™ๅ‰ใซใ€โ€‹ๅฐ‘ใ—โ€‹ๆ˜”่ฉฑใ‚’โ€‹ใ—ใพใ—ใ‚‡ใ†ใ€‚ 2015ๅนดใฎโ€‹ใ“ใจใงใ™ใŒใ€โ€‹็งใฏโ€‹JavaScriptใƒขใ‚ธใƒฅใƒผใƒซใƒใƒณใƒ‰ใƒฉใƒผใฎโ€‹Rollupใซโ€‹ๅ–ใ‚Šโ€‹็ต„ใ‚“ใงใ„ใฆใ€โ€‹ใ‹ใชใ‚Šโ€‹่ณขใ„ใจโ€‹ๆ€ใ‚ใ‚Œใ‚‹โ€‹ใƒ’ใƒฅใƒผใƒชใ‚นใƒ†ใ‚ฃใƒƒใ‚ฏใ‚’โ€‹ๅฎŸ่ฃ…ใ—ใพใ—ใŸใ€‚ ใใ‚Œใฏใ€ใ‚‚ใ—ใ€โ€‹ใ‚ใ‚‹โ€‹ใƒขใ‚ธใƒฅใƒผใƒซใฎโ€‹importใ‚’โ€‹ไฝฟ็”จใ—ใฆใ„ใชใ„โ€‹ๅ ดๅˆโ€‹๏ผˆใŸโ€‹ใจใˆใฐโ€‹D3 transitionใซโ€‹ๅซใพใ‚Œใ‚‹โ€‹ๆœชไฝฟ็”จใฎโ€‹easeใ‚„โ€‹transition๏ผ‰ใ€โ€‹Rollupใฏโ€‹ใใ‚Œใ‚’โ€‹ๅ˜ใซโ€‹ใƒขใ‚ธใƒฅใƒผใƒซใ‚ฐใƒฉใƒ•ใซโ€‹่ฟฝๅŠ ใ›ใšใซใ€โ€‹็ ดๆฃ„ใ™ใ‚‹ใจโ€‹ใ„ใ†โ€‹ไป•็ต„ใฟใงใ—ใŸใ€‚ ๅฟตใฎโ€‹็‚บใซใ€โ€‹้€ƒใ’้“ใจโ€‹ใ—ใฆใ€โ€‹ๅ‰ฏไฝœ็”จใฎโ€‹ใŸใ‚ใซโ€‹ใƒขใ‚ธใƒฅใƒผใƒซใ‚’โ€‹ใƒขใ‚ธใƒฅใƒผใƒซใ‚ฐใƒฉใƒ•ใซโ€‹่ฟฝๅŠ ใ™ใ‚‹โ€‹ๅฟ…่ฆใŒโ€‹ใ‚ใ‚‹โ€‹ๅ ดๅˆใฏใ€โ€‹ๆŒ‡ๅฎšๅญใชใ—ใงโ€‹ใ‚คใƒณใƒใƒผใƒˆใ‚’โ€‹่ฟฝๅŠ ใ™ใ‚Œใฐโ€‹RollupใŒโ€‹ใใ‚Œใ‚’โ€‹ใƒใƒณใƒ‰ใƒซใซโ€‹ๅซใ‚ใ‚‹โ€‹ใ“ใจใŒใงใใพใ—ใŸใ€‚ ็งใฏโ€‹่‹ฅใ‹ใฃใŸใ—ใ€โ€‹ไธ–้–“็Ÿฅใ‚‰ใšใ ใฃใŸใฎใงใ€โ€‹ใ“ใ‚Œใฏโ€‹ๆœฌๅฝ“ใซโ€‹่ณขใ„โ€‹ๆœ€้ฉๅŒ–ใ ใจโ€‹ๆ€ใ„ใพใ—ใŸใ€‚

ๅŒใ˜้ ƒใ€โ€‹D3ใ‚ณใƒŸใƒฅใƒ‹ใƒ†ใ‚ฃใŒโ€‹Mike Bostockใซโ€‹ใƒขใ‚ธใƒฅใƒผใƒซใƒใƒณใƒ‰ใƒฉใƒผใ‚’โ€‹ไฝฟใ†ใ‚ˆใ†ใซโ€‹่ชฌๅพ—ใ—ใ€โ€‹ๅฝผใฏโ€‹ใคใพใ‚‹โ€‹ใจใ“ใ‚ใ€โ€‹ใ€Œไบ†่งฃใ€‚โ€‹ใ™ในใฆใ‚’โ€‹CommonJSใงโ€‹ๆ›ธใๆ›ใˆใฆโ€‹Browserifyใ‚’โ€‹ไฝฟใ†ใญใ€ใจโ€‹่จ€ใ„ใพใ—ใŸใ€‚ ็งใฏโ€‹ใ“ใ‚Œใซโ€‹ใžใฃใจโ€‹ใ—ใพใ—ใŸใ€‚โ€‹ใจโ€‹ใ„ใ†ใฎใ‚‚โ€‹ใ“ใฎโ€‹ๅค‰ๆ›ดใฏโ€‹D3ใƒใƒณใƒ‰ใƒซใŒโ€‹้…ใใฆโ€‹ๅคงใใใชใ‚‹โ€‹ใ“ใจใ‚’โ€‹ๆ„ๅ‘ณใ—ใฆใ„ใŸใ‹ใ‚‰ใงใ™ใ€‚ ใใ“ใงโ€‹็งใฏใ€โ€‹2015ๅนด5ๆœˆ27ๆ—ฅใซโ€‹ๅฝผใซโ€‹ใ“ใฎใ‚ˆใ†ใซโ€‹ใƒกใƒผใƒซใ‚’โ€‹้€ใ‚Šใพใ—ใŸใ€โ€‹ใ€Œใ‚„ใ‚ใ€โ€‹ใ“ใ‚Œใซใฏโ€‹JavaScriptใƒขใ‚ธใƒฅใƒผใƒซใ‚’โ€‹ไฝฟใ†ในใใ ใจโ€‹ๆ€ใ†ใ‚“ใ ใ€‚โ€‹ใƒ„ใƒผใƒซใฏโ€‹ใพใ ใชใ„ใ‚“ใ ใ‘ใฉใ€โ€‹ๅฎŸใฏโ€‹ไปŠโ€‹ใใฎโ€‹ๆœ€้ฉๅŒ–ใซโ€‹ๅ–ใ‚Šโ€‹็ต„ใ‚“ใงใ‚‹ใ‚“ใ ใ‚ˆใญใ€ใจใ€‚ 5ๆœˆ29ๆ—ฅใซโ€‹ใชใ‚‹ใจใ€โ€‹ๅฝผใฏโ€‹Rollupใฎโ€‹ใƒฌใƒใ‚ธใƒˆใƒชใงโ€‹ใ„ใโ€‹ใคใ‹โ€‹ๅ•้กŒใ‚’โ€‹ๅ ฑๅ‘Šใ—ๅง‹ใ‚ใพใ—ใŸใ€‚โ€‹ใใ‚Œใฏโ€‹็งใŒโ€‹ไบˆๆƒณใ‚‚โ€‹ใ—ใฆใ„ใชใ‹ใฃใŸโ€‹ใ“ใจใงใ€โ€‹ๅฐ‘ใ—ใฐใ‹ใ‚Šๆใ‚ใ—ใ‹ใฃใŸใงใ™ใ€‚โ€‹ๅ…ˆใซโ€‹่ฟฐในใŸไพ‹ใฏโ€‹ใใฎใ†ใกใฎโ€‹1ใคใงใ™ใ€‚ Mikeใฏโ€‹ใจใฆใ‚‚โ€‹่ฆชๅˆ‡ใงโ€‹็ด ๆ™ดใ‚‰ใ—ใ„โ€‹ไบบใชใฎใงโ€‹ใ“ใ‚“ใชโ€‹ใ“ใจใ‚’โ€‹่จ€ใ†ใจใฏโ€‹ๆ€ใ„ใพใ›ใ‚“ใŒใ€โ€‹ใคใพใ‚‹โ€‹ใจใ“ใ‚โ€‹ๅฝผใŒโ€‹ใ“ใฎโ€‹ๅ•้กŒใซโ€‹ใคใ„ใฆโ€‹่จ€ใ„ใŸใ„โ€‹ใ“ใจใฏใ€โ€‹ใ€ŒJavaScriptใฏโ€‹ใใ‚“ใชโ€‹้ขจใซใฏโ€‹ๅ‹•ใ‹ใชใ„ใ‚ˆใ€โ€‹ใ“ใฎโ€‹ใƒใ‚ซใ€ใ€ใจโ€‹ใ„ใ†โ€‹ใ“ใจใงใ™ใ€‚ ๅฎŸ้š›ๅฝผใฏโ€‹ๆญฃใ—ใ„ใฎใงใ™ใ€‚โ€‹ใƒขใ‚ธใƒฅใƒผใƒซใ‚’โ€‹ใ‚ฐใƒฉใƒ•ใ‹ใ‚‰โ€‹ๅ‰Š้™คใ™ใ‚‹โ€‹ใ“ใจใชใใ€โ€‹ใ‚ณใƒผใƒ‰ใฎโ€‹ใ‚ปใƒžใƒณใƒ†ใ‚ฃใ‚ฏใ‚นใ‚’โ€‹ๆ นๆœฌ็š„ใซโ€‹ๅค‰ใˆใ‚‹โ€‹ใ“ใจใฏโ€‹ใงใใพใ›ใ‚“ใ€‚

ๆ™‚ใ‚’โ€‹ๅฐ‘ใ—โ€‹้€ฒใ‚ใพใ—ใ‚‡ใ†ใ€‚ ใ„ใโ€‹ใคใ‹ใฎโ€‹ใƒ•ใƒฌใƒผใƒ ใƒฏใƒผใ‚ฏใŒโ€‹ใ€ŒJavaScriptใฎโ€‹ใ‚ปใƒžใƒณใƒ†ใ‚ฃใ‚ฏใ‚นใ‚’โ€‹็„ก่ฆ–ใ™ใ‚‹โ€‹ใ“ใจใฏใ€โ€‹ๅ˜ใซโ€‹ๅ•้กŒใงใฏใชใใ€โ€‹ใ‚€ใ—ใ‚ใƒ•ใƒฌใƒผใƒ ใƒฏใƒผใ‚ฏใฎโ€‹ใ‚ณใ‚ขใชโ€‹ใ‚ปใƒผใƒซใ‚นใƒใ‚คใƒณใƒˆใงใ‚ใ‚‹ใ€ใจโ€‹ๅˆคๆ–ญใ—ใพใ—ใŸใ€‚ ใ“ใ“ใงใฏโ€‹Remixใ‚’โ€‹ไพ‹ใซโ€‹ๆŒ™ใ’ใพใ™ใŒใ€โ€‹ใ“ใ‚Œใฏโ€‹ไป–ใฎโ€‹ใƒ•ใƒฌใƒผใƒ ใƒฏใƒผใ‚ฏใซใ‚‚โ€‹่ฆ‹ใ‚‰ใ‚Œใพใ™ใ€‚ ใŸโ€‹ใจใˆใฐโ€‹Next.jsใงใ‚‚ใ€โ€‹ใƒใƒผใ‚ธใƒงใƒณ13ใงโ€‹App RouterใŒโ€‹็™บ่กจใ•ใ‚Œใ‚‹ใพใงใฏโ€‹ไผผใŸใ‚ˆใ†ใชโ€‹ใ“ใจใ‚’โ€‹ใ—ใฆใ„ใพใ—ใŸใ€‚

IMHO

ใ“ใ‚Œใฏโ€‹Remixใฎโ€‹ใƒซใƒผใ‚ฟใƒผใงใ™ใ€‚ ใ“ใ‚Œใฏใ€โ€‹ใƒ‡ใƒผใ‚ฟใ‚’โ€‹ใƒญใƒผใƒ‰ใ™ใ‚‹โ€‹ใ‚ตใƒผใƒใƒผไธŠใฎโ€‹ใ‚ณใƒผใƒ‰ใ‚’โ€‹Viewใฎโ€‹ใ‚ณใƒผใƒ‰ใจโ€‹ไธ€็ท’ใซโ€‹ๆ›ธใ‘ใ‚‹ใจโ€‹่จ€ใ†โ€‹ใ‚‚ใฎใงใ™ใ€‚ ใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆใ‚ขใƒ—ใƒชใŒโ€‹ใƒ“ใƒซใƒ‰ใ•ใ‚Œใ‚‹ใจใ€โ€‹ใƒญใƒผใƒ€ใƒผใจโ€‹ใใ‚Œใซโ€‹ไพๅญ˜ใ™ใ‚‹โ€‹ใ‚‚ใฎใฏโ€‹tree-shaking^[โ€‹ไฝฟใ‚ใ‚Œใฆใ„ใชใ„โ€‹ใ‚ณใƒผใƒ‰ใ‚’โ€‹ๅ‰Š้™คใ™ใ‚‹โ€‹ใ“ใจ(https://developer.mozilla.org/ja/docs/Glossary/Tree_shaking)]ใ•ใ‚Œใพใ™ใ€‚ ใ—ใ‹ใ—ใ€โ€‹ใ“ใ‚Œใฏโ€‹ๆœฌ็‰ฉใฎโ€‹tree-shakingใงใฏโ€‹ใ‚ใ‚Šใพใ›ใ‚“ใ€‚โ€‹ใ“ใ‚Œใฏโ€‹ใงใฃใกไธŠใ’ใฎใ€โ€‹้žๆจ™ๆบ–ใฎโ€‹JavaScriptใ‚ปใƒžใƒณใƒ†ใ‚ฃใ‚ฏใ‚นใงใ™ใ€‚ ใ€Œใกใ‚‡ใฃใจโ€‹ๅพ…ใฆโ€‹็”Ÿ็œŸ้ข็›ฎRichๅ›ใ€โ€‹ๅ›ใฏโ€‹ใ„ใคใ‹ใ‚‰โ€‹JS็•Œใฎโ€‹ๅญฆ็ดšๅง”ๅ“กใซโ€‹ใชใฃใŸใ‚“ใ ใ„๏ผŸใ€ใจโ€‹ๆ€ใ†ใ‹ใ‚‚ใ—ใ‚Œใพใ›ใ‚“ใ€‚ ใงใ™ใŒใ€โ€‹ใ“ใ‚Œใฏโ€‹็พๅฎŸไธ–็•Œใงใฏโ€‹ๅคงใ„ใซโ€‹ๅฝฑ้Ÿฟใ‚’โ€‹ไธŽใˆใ‚‹โ€‹ใ‚‚ใฎใงใ™ใ€‚

IMHO

Remixใฎโ€‹ใƒ‰ใ‚ญใƒฅใƒกใƒณใƒˆใซใฏใ€โ€‹ใ“ใฎโ€‹ใƒ‡ใ‚ถใ‚คใƒณใงโ€‹็™บ็”Ÿใ—ใŸโ€‹ๅ•้กŒใ‚’โ€‹ๅ›ž้ฟใ™ใ‚‹โ€‹ใŸใ‚ใฎโ€‹ใƒšใƒผใ‚ธใŒโ€‹ใ‚ใ‚Šใพใ™ใ€‚ ็พๅฎŸ็š„ใชโ€‹ๅฝฑ้Ÿฟใจใฏโ€‹ๅˆฅใซใ€โ€‹ใ‚ตใƒผใƒใƒผใจโ€‹ใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆใฎโ€‹ๅขƒ็•ŒใŒโ€‹ๆ›–ๆ˜งใซโ€‹ใชใ‚‹ใ“ใจใŒโ€‹ๆททไนฑใฎใ‚‚ใจใ ใจโ€‹ๆ€ใ„ใพใ™ใ€‚

็งใฏใ€โ€‹ใ€Œ่‡ชๅˆ†ใฎโ€‹ใ‚ณใƒผใƒ‰ใŒโ€‹ๆœ€็ต‚็š„ใซโ€‹ใฉใ“ใงโ€‹ๅฎŸ่กŒใ•ใ‚Œใ‚‹ใฎใ‹ใพใฃใŸใโ€‹ใ‚ใ‹ใ‚‰ใชใ„ใ€ใจโ€‹่ค‡ๆ•ฐใฎโ€‹ไบบใŒโ€‹่จ€ใฃใฆใ„ใ‚‹ใฎใ‚’โ€‹่žใ„ใŸโ€‹ใ“ใจใŒใ‚ใ‚Šใพใ™ใ€‚

IMHO

ใ•ใ‚‰ใซโ€‹ๅฟƒ้…ใชใฎใฏใ€โ€‹ใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆใฎโ€‹ใƒใƒณใƒ‰ใƒซใซโ€‹ใ‚ตใƒผใƒใƒผใฎโ€‹ใ‚ณใƒผใƒ‰ใŒโ€‹ๅซใพใ‚Œใฆใ—ใพใ†โ€‹ๅฏ่ƒฝๆ€งใŒโ€‹ใ‚ใ‚‹โ€‹ใ“ใจใงใ™ใ€‚ Remixใ‚’โ€‹่€ƒๆกˆใ—ใŸโ€‹Michaelใงโ€‹ใ•ใˆใ€โ€‹ใ“ใ‚ŒใŒโ€‹็พๅฎŸ็š„ใชโ€‹ๅ•้กŒใงใ‚ใ‚‹โ€‹ใ“ใจใ‚’โ€‹่ชใ‚ใฆใ„ใพใ™ใ€‚ ใƒฆใƒผใ‚ถใƒผใซโ€‹ๆไพ›ใ™ใ‚‹โ€‹JavaScriptใฎโ€‹ไธญใซใ€โ€‹่ชคใฃใฆโ€‹ๆฉŸๅฏ†ๆ€งใฎโ€‹้ซ˜ใ„โ€‹ใ‚‚ใฎใ‚’โ€‹ๅ…ฅใ‚Œใฆใ—ใพใ†ใจโ€‹ใ„ใ†ใฎใฏใ€โ€‹ๅฏไธ่ถณใงโ€‹ใกใ‚‡ใฃใจโ€‹1ๅบฆๅคฑๆ•—ใ‚’โ€‹ใ—ใŸใ ใ‘ใงใ‚‚โ€‹่ตทใ“ใ‚Šใ†ใ‚‹โ€‹ใ“ใจใงใ™ใ€‚ ใพใŸใ€โ€‹ใŸใจใˆโ€‹ใใฎใ‚ˆใ†ใชโ€‹ใƒŸใ‚นใ‚’โ€‹ใ—ใชใ‹ใฃใŸใจใ—ใฆใ‚‚ใ€โ€‹ๆœฌ็•ช็’ฐๅขƒใฎโ€‹ใ‚ขใƒ—ใƒชใ‚’โ€‹ใƒ‡ใƒใƒƒใ‚ฐใ™ใ‚‹โ€‹ใŸใ‚ใซโ€‹ใ‚ฝใƒผใ‚นใƒžใƒƒใƒ—ใ‚’โ€‹ไฝฟ็”จใ™ใ‚‹โ€‹ใ“ใจใฏโ€‹้ฟใ‘ใ‚‹ในใใงใ™ใ€‚โ€‹ใชใœใชใ‚‰โ€‹ใ‚ฝใƒผใ‚นใƒžใƒƒใƒ—ใซใฏโ€‹ใƒ‡ใƒผใ‚ฟใƒ™ใƒผใ‚นใ‚ฏใ‚จใƒชใชใฉใ‚’โ€‹ๅซใ‚€ใƒขใ‚ธใƒฅใƒผใƒซๅ…จไฝ“ใŒโ€‹ๅซใพใ‚Œใฆใ„ใ‚‹โ€‹ใŸใ‚ใงใ™ใ€‚

ใชโ€‹ใœโ€‹็งใฏโ€‹ไป–ใฎโ€‹ใƒ•ใƒฌใƒผใƒ ใƒฏใƒผใ‚ฏใฎโ€‹่จญ่จˆใซโ€‹ใคใ„ใฆโ€‹่ฉฑใ—ใฆใ„ใ‚‹ใฎใงใ—ใ‚‡ใ†ใ‹๏ผŸ Remixใ‚’โ€‹ไฝฟใ†ใชใจโ€‹่จ€ใฃใฆใ„ใ‚‹ใ‚ใ‘ใงใฏโ€‹ใ‚ใ‚Šใพใ›ใ‚“ใ€‚ ใพใŸใ€โ€‹Remixใƒใƒผใƒ ใŒโ€‹ๅˆฅใฎโ€‹้ธๆŠžใ‚’โ€‹ใ™ใ‚‹ในใใ ใจใ‚‚โ€‹่จ€ใ„ใพใ›ใ‚“ใ€‚ ใใ‚Œใฏโ€‹็งใฎโ€‹ไป•ไบ‹ใงใฏโ€‹ใ‚ใ‚Šใพใ›ใ‚“ใ€‚ ใ—ใ‹ใ—ใ€โ€‹ใ—ใฐใ—ใฐโ€‹ไบบใ€…ใฏใ€โ€‹ใ€Œไป–ใฎโ€‹ใƒ•ใƒฌใƒผใƒ ใƒฏใƒผใ‚ฏใŒโ€‹Xใ‚’โ€‹ใ‚„ใฃใฆใ„ใ‚‹ใฎใงใ€โ€‹SvelteKitใ‚‚โ€‹ๅŒใ˜ใ‚ˆใ†ใซโ€‹ใ™ในใใงใฏใชใ„ใ‹๏ผŸใ€ใจโ€‹่จ€ใ„ใพใ™ใ€‚ ใใ—ใฆใ€โ€‹ใใ‚ŒใŒโ€‹็งใฎโ€‹ไป•ไบ‹ใซโ€‹ใชใ‚Šใพใ™ใ€‚

ใ“ใฎโ€‹่จญ่จˆโ€‹๏ผˆ่จณๆณจ:ใ‚ตใƒผใƒใƒผใจโ€‹ใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆใฎโ€‹ใ‚ณใƒผใƒ‰ใ‚’โ€‹ไธ€็ท’ใซโ€‹ๆ›ธใโ€‹ใ“ใจใŒใงใใ‚‹โ€‹่จญ่จˆ๏ผ‰ใฎโ€‹็†็”ฑใฏใ€โ€‹้–ข้€ฃใ™ใ‚‹โ€‹ใ‚ณใƒผใƒ‰ใ‚’โ€‹ๅ…ฑๆœ‰ใ™ใ‚‹โ€‹ใ“ใจใŒโ€‹ไพฟๅˆฉใ ใ‹ใ‚‰ใงใ™ใ€‚ ใ“ใฎโ€‹ใ€Œ้–ข้€ฃใ™ใ‚‹โ€‹ใ‚ณใƒผใƒ‰ใ‚’โ€‹ๅŒๅฑ…ใ•ใ›ใ‚‹โ€‹ๅˆฉ็‚นใ€ใ‚’โ€‹็งใฏโ€‹ใ‚ˆใโ€‹็Ÿฅใฃใฆใ„ใพใ™ใ€‚

IMHO

็งใฏใ€โ€‹Vueใ‚„โ€‹ไป–ใฎโ€‹่ชฐใ‚ˆใ‚Šใ‚‚ใ€โ€‹2014ๅนดใซใฏโ€‹ใ™ใงใซโ€‹ใ‚ทใƒณใ‚ฐใƒซใƒ•ใ‚กใ‚คใƒซใ‚ณใƒณใƒใƒผใƒใƒณใƒˆใ‚’โ€‹ไฝฟ็”จใ—ใฆใ„ใพใ—ใŸใ€‚ ็งใฏโ€‹ใ“ใ‚ŒใŒโ€‹ๅคงๅฅฝใใงใ™ใ€‚

ใ—ใ‹ใ—ใ€โ€‹ใ‚ตใƒผใƒใƒผใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆใฎโ€‹ๅขƒ็•Œใ‚’โ€‹่ถŠใˆใ‚‹โ€‹ใ‚ณใƒผใƒ‰ใ‚’โ€‹ๅ˜ไธ€ใฎโ€‹ใƒ•ใ‚กใ‚คใƒซใซโ€‹ๅ…ฑๆœ‰ใ™ใ‚‹โ€‹ใ“ใจใฏโ€‹ใ‚„ใ‚Šใ™ใŽใงใ—ใŸใ€‚ ็พใซใ€โ€‹Svelteใงโ€‹ใƒ—ใƒญใƒˆใ‚ฟใ‚คใƒ—ใ‚’โ€‹ไฝœใฃใŸใฎใงใ™ใŒใ€โ€‹็ญ‹ใŒโ€‹ใ‚ใพใ‚Šโ€‹่‰ฏใใชใ‹ใฃใŸใฎใงใ™ใ€‚

IMHO

ใงใ™ใฎใงใ€โ€‹SvelteKitใงใฏใ€โ€‹ใƒ•ใ‚กใ‚คใƒซใงใฏใชใโ€‹ใƒ‡ใ‚ฃใƒฌใ‚ฏใƒˆใƒชใซโ€‹ๅ…ฑๆœ‰ใ—ใพใ™ใ€‚ ใ“ใ‚Œใฏใ€โ€‹SvelteKitใ‚ณใƒผใƒ‰ใƒ™ใƒผใ‚นใฎโ€‹ใ‚นใ‚ฏใƒชใƒผใƒณใ‚ทใƒงใƒƒใƒˆใงใ™ใ€‚ SvelteKitใ‚ขใƒ—ใƒชใงใฏใ€โ€‹ๅ„ใƒ‡ใ‚ฃใƒฌใ‚ฏใƒˆใƒชใŒโ€‹ใƒซใƒผใƒˆใงใ‚ใ‚Šใ€โ€‹ๅ„ใƒซใƒผใƒˆใซใฏโ€‹ใƒ‡ใƒผใ‚ฟใฎโ€‹ใƒญใƒผใƒ‰ใซโ€‹ไฝฟ็”จใ™ใ‚‹โ€‹ใ‚ตใƒผใƒใƒผใ‚ณใƒผใƒ‰ใจใ€โ€‹ใ‚ตใƒผใƒใƒผใจโ€‹ใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆใฎโ€‹ไธกๆ–นใงโ€‹ๅฎŸ่กŒใ•ใ‚Œใ‚‹โ€‹Viewใ‚ณใƒผใƒ‰ใŒโ€‹ๅซใพใ‚Œใพใ™ใ€‚ ใ“ใ‚Œใฏใ€npm create svelteใ‚’โ€‹ๅฎŸ่กŒใ—ใŸโ€‹ใจใใซโ€‹ไฝœใ‚‰ใ‚Œใ‚‹โ€‹ใƒ‡ใƒขใ‚ขใƒ—ใƒชใงใ™ใ€‚ src/routeใฎโ€‹ไธญใซใฏaboutใƒซใƒผใƒˆใจsverdleใƒซใƒผใƒˆใŒโ€‹ใ‚ใ‚Šใ€โ€‹ใ“ใ‚Œใฏโ€‹JavaScriptใชใ—ใงโ€‹ๅ‹•ไฝœใ™ใ‚‹โ€‹Wordleใ‚ฏใƒญใƒผใƒณใงใ™ใ€‚ ใ“ใฎโ€‹Svelteใ‚ฏใƒญใƒผใƒณใฎโ€‹ใƒšใƒผใ‚ธใฎโ€‹ใ‚ตใƒผใƒใƒผใ‚ณใƒผใƒ‰ใฏใ€โ€‹ๅทฆใฎ+page.server.jsใซโ€‹ๆ ผ็ดใ•ใ‚Œใฆใ„ใพใ™ใ€‚ ใƒ•ใ‚กใ‚คใƒซๅใซโ€‹ .serverใŒโ€‹ใคใ„ใฆใ„ใ‚‹โ€‹ใƒ•ใ‚กใ‚คใƒซใฏใ€โ€‹ใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆใ‚ตใ‚คใƒ‰ใฎโ€‹ใ‚ณใƒผใƒ‰ใซโ€‹ใ‚คใƒณใƒใƒผใƒˆใ™ใ‚‹โ€‹ใ“ใจใŒใงใใพใ›ใ‚“^[Server-only modules โ€ข Docs โ€ข SvelteKit(https://kit.svelte.jp/docs/server-only-modules)]ใ€‚โ€‹ใƒ“ใƒซใƒ‰ใซโ€‹ๅคฑๆ•—ใ—ใพใ™ใ€‚ ใƒ‡ใ‚ฃใƒฌใ‚ฏใƒˆใƒชใƒ™ใƒผใ‚นใฎโ€‹ใƒซใƒผใƒ†ใ‚ฃใƒณใ‚ฐใฏใ€โ€‹Next.jsใ‹ใ‚‰โ€‹็›—ใ‚“ใ โ€‹ใ‚‚ใฎใงใ‚ใ‚Šใ€โ€‹ใใฎโ€‹ไป–ใฎโ€‹ใƒกใƒชใƒƒใƒˆใŒโ€‹ใ‚ใ‚Šใพใ™ใŒใ€โ€‹ไปŠใฏโ€‹่ฉณใ—ใโ€‹่ชฌๆ˜Žใงใใพใ›ใ‚“ใ€‚ ใ—ใ‹ใ—ใ€โ€‹็งใฏโ€‹ๅผทใโ€‹ใ“ใ‚ŒใŒโ€‹ๆญฃใ—ใ„โ€‹ๆ–นโ€‹ๆณ•ใ ใจโ€‹ไฟกใ˜ใฆใ„ใพใ™ใ€‚

ใกใ‚‡ใฃใจใ—ใŸโ€‹ใ‚คใƒผใ‚นใ‚ฟใƒผใ‚จใƒƒใ‚ฐใ‚‚โ€‹ใ‚ใ‚Šใพใ™ใ€‚ ใ“ใฎโ€‹็”ป้ขใงใฏใ€โ€‹ๅณๅดใฎ+page.svelteใฎโ€‹16่กŒ็›ฎใฎโ€‹data.guessesใซโ€‹ใ‚ซใƒผใ‚ฝใƒซใ‚’โ€‹ๅˆใ‚ใ›ใฆใ„ใพใ™ใŒใ€โ€‹ใใ“ใซใฏโ€‹ๅทฆๅดใฎ+page.server.jsใฎโ€‹9่กŒ็›ฎใซโ€‹ๆ›ธใ„ใŸโ€‹ๅž‹ๆƒ…ๅ ฑใจโ€‹Inline DocumentใŒโ€‹่กจ็คบใ•ใ‚Œใพใ™ใ€‚ ใคใพใ‚Šใ€โ€‹ใƒใƒƒใƒˆใƒฏใƒผใ‚ฏๅ…จไฝ“ใงโ€‹ๅž‹ๅฎ‰ๅ…จๆ€งใ‚’โ€‹ไฟ่จผใ—ใฆใ„ใ‚‹ใฎใงใ™ใ€‚

ใ“ใ‚Œใ‚‰ใฏใ€โ€‹ๅผทๅŠ›ใชโ€‹่ฆ็ด„ใ‚’โ€‹ๆŽก็”จใ™ใ‚‹โ€‹ใ“ใจใงโ€‹ๅฏ่ƒฝใซโ€‹ใชใ‚Šใ€โ€‹ๆœ€ๆ‚ชใฎโ€‹้–‹็™บ่€…ไฝ“้จ“ใจใฏโ€‹็จ‹้ ใ„โ€‹ใ‚‚ใฎใซใชใ‚Šใพใ™ใ€‚ ็งใฏโ€‹ๅฎŸ้š›ใซโ€‹ใ“ใฎโ€‹ๆ–นโ€‹ๆณ•ใŒโ€‹ๅฅฝใพใ—ใ„ใจโ€‹ๆ€ใฃใฆใ„ใพใ™ใ€‚

็งใฏโ€‹ใ‚ˆใใ€โ€‹ใƒ‡ใƒผใ‚ฟใ‚’โ€‹่ชญใฟ่พผใ‚€ใ‚ตใƒผใƒใƒผใฎโ€‹ใ‚ณใƒผใƒ‰ใ‚’โ€‹ไธ€ๆ–นใซโ€‹้–‹ใใ€โ€‹ใƒ“ใƒฅใƒผใฎโ€‹ใ‚ณใƒผใƒ‰ใ‚’โ€‹ใ‚‚ใ†โ€‹ไธ€ๆ–นใซโ€‹้–‹ใโ€‹ใ“ใจใŒใ‚ใ‚Šใพใ™ใ€‚ ใ‚นใ‚ฏใƒชใƒผใƒณใฏโ€‹ๅบƒใ„ใŒใ€โ€‹ใƒ•ใ‚กใ‚คใƒซใฏโ€‹็ธฆใซโ€‹้•ทใใชใ‚ŠใŒใกใงใ™ใ€‚ ใ ใ‹ใ‚‰ใ€โ€‹1ใคใฎโ€‹ใƒ•ใ‚กใ‚คใƒซใซโ€‹ใ™ในใฆใ‚’โ€‹่ฉฐใ‚่พผใ‚‚ใ†ใจโ€‹ใ™ใ‚‹ใจโ€‹ใจใฆใ‚‚โ€‹่ฆ‹่พ›ใใชใ‚Šใพใ™ใ€‚

IMHO

ใ•ใฆใ€โ€‹ใ‚‚ใ†โ€‹1ใค้žๆจ™ๆบ–็š„ใชโ€‹ใ‚ปใƒžใƒณใƒ†ใ‚ฃใƒƒใ‚ฏใ‚นใฎโ€‹ไพ‹ใ‚’โ€‹ใŠ่ฆ‹ใ›ใ—ใพใ—ใ‚‡ใ†ใ€‚ ใ“ใฎโ€‹ใ‚นใƒฉใ‚คใƒ‰ใฏQwikใƒใƒผใƒ ใซโ€‹ใ‚ˆใ‚‹โ€‹ใ‚‚ใฎใงใ™ใ€‚ Qwikใฏใ€โ€‹ๅ€‹ใ€…ใฎโ€‹้–ขๆ•ฐใ‚’โ€‹้…ๅปถใƒญใƒผใƒ‰ใ—ใฆใ€โ€‹Lexical Scope^ๅ‚่€ƒ: [ๅƒ•ใ‚‰ใฏโ€‹ JavaScript ใ‚’โ€‹็Ÿฅใ‚‰ใชใ„โ€‹ - ใƒฌใ‚ญใ‚ทใ‚ซใƒซใ‚นใ‚ณใƒผใƒ—ใจโ€‹ใ‚ฏใƒญใƒผใ‚ธใƒฃใจโ€‹ใ‚ฌใƒ™ใƒผใ‚ธใ‚ณใƒฌใ‚ฏใ‚ทใƒงใƒณ Lexical Scope, Closure and Garbage Collection(https://uraway.hatenablog.com/entry/2018/01/24/120000)]ใ‚’โ€‹ๅ†ไฝœๆˆใงใใ‚‹ใ‚ˆใ†ใซโ€‹ใ‚ณใƒผใƒ‰ใ‚’โ€‹ๅค‰ๆ›ใ™ใ‚‹โ€‹ใƒ•ใƒฌใƒผใƒ ใƒฏใƒผใ‚ฏใงใ™ใ€‚ ใ“ใ‚Œใฏโ€‹ใจใฆใ‚‚โ€‹่ณขใ„ๆ–นๆณ•ใงใ‚ใ‚Šใ€โ€‹ๆณจ็›ฎใ™ใ‚‹โ€‹ไพกๅ€คใŒโ€‹ใ‚ใ‚Šใพใ™ใ€‚

็ง่‡ช่บซใฏใ€โ€‹ใ“ใฎใ‚ˆใ†ใชโ€‹ใ‚‚ใฎใซใฏโ€‹ๅฐ‘ใ—โ€‹ๆŠตๆŠ—ใŒโ€‹ใ‚ใ‚Šใพใ™ใ€‚ ใŸโ€‹ใจใˆใฐใ€โ€‹JSXใฎโ€‹ใƒ–ใƒญใƒƒใ‚ฏใ‹ใ‚‰โ€‹increment้–ขๆ•ฐใ‚’โ€‹็งปๅ‹•ใ™ใ‚‹ใจใ€โ€‹ใ‚ขใƒ—ใƒชใŒโ€‹ๅฃŠใ‚Œใพใ™ใ€‚ ้€šๅธธใฎโ€‹JavaScriptใชใ‚‰โ€‹ๅ•้กŒใชใโ€‹ๅ‹•ใใพใ™ใ€‚ ใงใ‚‚ใ€โ€‹JavaScriptใ˜ใ‚ƒใชใ„ใ‚“ใงใ™ใ€‚ ใ“ใ‚Œใฏโ€‹Qwikใงใ™ใ€‚ Qwikใฏโ€‹ๅฎŸ่ณช็š„ใซใ€โ€‹ใ‚ˆใ‚Šโ€‹็ดฐใ‹ใ„โ€‹ใ‚ณใƒผใƒ‰ๅˆ†ๅ‰ฒใฎโ€‹ใŸใ‚ใฎโ€‹DSLใงใ™ใ€‚ ๅŒใ˜โ€‹็†็”ฑใงใ€โ€‹ใใฎโ€‹้–ขๆ•ฐๅ†…ใงโ€‹ๅ‚็…งใ™ใ‚‹โ€‹ๅ€คใซโ€‹ใคใ„ใฆใฏโ€‹ๆณจๆ„ใŒโ€‹ๅฟ…่ฆใงใ™ใ€‚โ€‹ใชใœใชใ‚‰ใ€โ€‹Lexical Scopeใ‚’โ€‹ๅ†็พใ™ใ‚‹โ€‹ใŸใ‚ใซใ€โ€‹ใƒ•ใƒฌใƒผใƒ ใƒฏใƒผใ‚ฏใŒโ€‹ใใ‚Œใ‚’โ€‹ใ‚ทใƒชใ‚ขใƒฉใ‚คใ‚บใ™ใ‚‹โ€‹ๅฟ…่ฆใŒโ€‹ใ‚ใ‚‹ใ‹ใ‚‰ใงใ™ใ€‚

IMHO

็งใฏโ€‹ใ—ใฐใ‚‰ใโ€‹ๅ‰ใซโ€‹ใ“ใ‚Œใ‚’โ€‹Twitterใงโ€‹่จ€ๅŠใ—ใพใ—ใŸใ€‚ ๆ•ฐๆ™‚้–“ๅพŒใ€โ€‹Qwikใƒใƒผใƒ ใฎโ€‹Manuใฏใ€โ€‹ๅ•้กŒใ‚’โ€‹่จบๆ–ญใงใใ‚‹ใ‚ˆใ†ใซใ€โ€‹ใ‚ˆใ‚Šโ€‹ๅฝน็ซ‹ใคใ‚จใƒฉใƒผใƒกใƒƒใ‚ปใƒผใ‚ธใ‚’โ€‹่ฟฝๅŠ ใ—ใฆใใ‚Œใพใ—ใŸใ€‚ ๅฝผใ‚‰ใฏโ€‹ๅ„ชใ‚ŒใŸโ€‹ๅฐ‚้–€็Ÿฅ่ญ˜ใ‚’โ€‹ๆŒใกใ€โ€‹ใจใฆใ‚‚โ€‹็Œฎ่บซ็š„ใงใ™ใญใ€‚

ใ—ใ‹ใ—ใ€โ€‹ใ“ใ‚Œใฏโ€‹็งใŒโ€‹่ฆ‹ใฆใ„ใ‚‹ใ‚ˆใ‚Šโ€‹ๅบƒ็ฏ„ใชโ€‹ๅ‚พๅ‘ใฎโ€‹1ใคใฎโ€‹ไพ‹ใซโ€‹ใ™ใŽใพใ›ใ‚“ใ€‚โ€‹JavaScriptใพใŸใฏโ€‹TypeScriptใ‚’โ€‹ใ†ใพใโ€‹ๆ‰ฑใ†โ€‹ใŸใ‚ใซใฏใ€โ€‹่ฃๅดใงโ€‹่ตทใ“ใฃใฆใ„ใ‚‹โ€‹้žๅธธใซโ€‹ๆด—็ทดใ•ใ‚ŒใŸโ€‹้ซ˜ๅบฆใชโ€‹ๅค‰ๆ›ใ‚’โ€‹็†่งฃใ™ใ‚‹โ€‹ๅฟ…่ฆใŒโ€‹ใ‚ใ‚Šใพใ™ใ€‚ ้…ๅปถใƒญใƒผใƒ‰ใซใฏโ€‹ไป–ใซใ‚‚โ€‹ๆฌ ็‚นใŒโ€‹ใ‚ใ‚Šใพใ™ใ€‚ ็งใŒโ€‹ใ‚ˆใโ€‹่กŒใ†ใ‚ˆใ†ใชโ€‹ๆกไปถไป˜ใใงโ€‹ใ‚คใƒ™ใƒณใƒˆใฎโ€‹ใƒ‡ใƒ•ใ‚ฉใƒซใƒˆใ‚’โ€‹้˜ฒๆญขใ™ใ‚‹โ€‹ใ“ใจใŒใงใใชใ„โ€‹ใ“ใจใŒโ€‹ๆŒ™ใ’ใ‚‰ใ‚Œใพใ™ใ€‚ ใ“ใ‚Œใฏใ€โ€‹ใƒ—ใƒญใ‚ฐใƒฉใƒŸใƒณใ‚ฐใƒขใƒ‡ใƒซๅ…จไฝ“ใ‚’โ€‹ใ‚ชใƒ—ใƒˆใ‚ขใ‚ฆใƒˆใ—ใชใ‘ใ‚Œใฐใชใ‚‰ใชใ„ใจโ€‹ใ„ใ†โ€‹ใ“ใจใงใ™ใ€‚ ใ—ใ‹ใ—โ€‹ๆ นๆœฌ็š„ใซใฏใ€โ€‹ใ‚ณใƒผใƒ‰ใŒโ€‹ไฝ•ใ‚’โ€‹ใ™ใ‚‹ใฎใ‹ใจโ€‹ใ‚ณใƒผใƒ‰ใŒโ€‹ใฉใฎใ‚ˆใ†ใซโ€‹่ฆ‹ใˆใ‚‹ใ‹ใจใฎโ€‹้–“ใฎโ€‹ใƒŸใ‚นใƒžใƒƒใƒใŒใ€โ€‹็งใฎโ€‹ๆ‚ฉใฟใฎโ€‹็จฎใชใฎใงใ™ใ€‚

IMHO

ใ“ใ“ใงโ€‹่ฉฆใ—ใซโ€‹ChatGPTใซโ€‹ใ‚ณใƒณใƒใƒผใƒใƒณใƒˆใ‚’โ€‹ใƒชใƒ•ใ‚กใ‚ฏใ‚ฟใƒชใƒณใ‚ฐใ—ใฆโ€‹ใ‚‚ใ‚‰ใ„ใพใ—ใŸใŒใ€โ€‹ๆœ€ๅˆใฏโ€‹Reactใฎโ€‹ใ‚คใƒ‡ใ‚ฃใ‚ชใƒ ใ‚’โ€‹้ฉ็”จใ—ใ‚ˆใ†ใจใ—ใพใ—ใŸใ€‚ ใ“ใ“ใงuseStateใฏโ€‹ไฝฟใˆใชใ„ใจโ€‹่ชฌๆ˜Žใ—ใพใ—ใŸใ€‚ ใ™ใ‚‹ใจใ€โ€‹ChatGPTใฏโ€‹JavaScriptใ‚’โ€‹ๆ‰ฑใฃใฆใ„ใ‚‹ใจโ€‹ๅ‹˜้•ใ„ใ—ใฆใ—ใพใ„ใ€โ€‹increment้–ขๆ•ฐใ‚’โ€‹JSXใฎโ€‹ๅค–ใซโ€‹ๅ‡บใ™ใจโ€‹ใ„ใ†ใ€โ€‹ๅ…ˆใปใฉใจโ€‹ใพใฃใŸใโ€‹ๅŒใ˜โ€‹ใƒŸใ‚นใ‚’โ€‹็Šฏใ—ใฆใ—ใพใ„ใพใ—ใŸใ€‚

IMHO

ไปŠๅบฆใฏSolid.jsใฎโ€‹ไพ‹ใงใ™ใ€‚ JSXใจโ€‹JavaScriptใฎโ€‹็†่งฃใซโ€‹ๅŸบใฅใใจใ€โ€‹ใ“ใ‚Œใ‚‰ใฎโ€‹2ใคใฎโ€‹ใ‚ณใƒณใƒใƒผใƒใƒณใƒˆใŒโ€‹ๅŒใ˜ใ‚ˆใ†ใซโ€‹ๅ‹•ไฝœใ™ใ‚‹ใฏใšใงใ™ใ€‚ ใ—ใ‹ใ—โ€‹ๅฎŸ้š›ใซใฏโ€‹ๅ…จ็„ถโ€‹้•ใ„ใพใ™ใ€‚ Solid.jsใ‚’โ€‹ใ‚ˆใโ€‹ใ”ๅญ˜็Ÿฅใชโ€‹ไบบใชใ‚‰ใ€โ€‹ใ“ใ‚Œใฏโ€‹ๅฎŒๅ…จใซโ€‹็†่งฃใงใใ‚‹โ€‹ใ“ใจใงใ—ใ‚‡ใ†ใ€‚ ใงใ‚‚ใ€โ€‹ใ“ใ“ใซใฏโ€‹ๆ˜Ž็ขบใชโ€‹้“ๆจ™ใŒโ€‹ใ‚ใ‚Šใพใ›ใ‚“ใ€‚ ใ—ใŸใŒใฃใฆใ€โ€‹5ๅนดๅพŒใซโ€‹ใ“ใ‚Œใ‚‰ใฎโ€‹ใ‚ณใƒผใƒ‰ใƒ™ใƒผใ‚นใ‚’โ€‹ใ†ใพใโ€‹ไฟๅฎˆใงใใ‚‹ใ‚ˆใ†ใซใชใ‚‹ใงใ—ใ‚‡ใ†ใ‹๏ผŸ ใ‚ใ‹ใ‚Šใพใ›ใ‚“ใ€‚โ€‹ๅคšๅˆ†ใงใใ‚‹ใ‹ใ‚‚ใ—ใ‚Œใพใ›ใ‚“ใ€‚

ใ“ใ‚Œใ‚‰ใฎโ€‹ใƒ•ใƒฌใƒผใƒ ใƒฏใƒผใ‚ฏใฏใ€โ€‹ใฉใ‚Œใ‚‚โ€‹ๆœฌๅฝ“ใซโ€‹้ข็™ฝใใฆโ€‹ใ‚ฏใƒผใƒซใชโ€‹ใ“ใจใ‚’โ€‹ใ‚„ใฃใฆใ„ใ‚‹ใฎใงใ€โ€‹้ž้›ฃใ™ใ‚‹โ€‹ใคใ‚‚ใ‚Šใฏโ€‹ใ‚ใ‚Šใพใ›ใ‚“ใ€‚ ใ“ใ‚Œใ‚‰ใฏโ€‹ใจใใซโ€‹ๆณจ็›ฎใ™ในใไพ‹ใงใ™ใ€‚ ใใ—ใฆใ€โ€‹ๅฝผใ‚‰ใฏโ€‹ๅŒใ˜ใ‚ˆใ†ใซใ€โ€‹Svelteใฎโ€‹ใƒ—ใƒญใ‚ฐใƒฉใƒŸใƒณใ‚ฐใƒขใƒ‡ใƒซใฎโ€‹ใ„ใโ€‹ใคใ‹ใฎโ€‹่ฆ็ด ใฏโ€‹ใ‚ใพใ‚Šโ€‹ๅฅฝใพใ—ใใชใ„ใจโ€‹่€ƒใˆใฆใ„ใพใ™ใ€‚ ใพใŸใ€โ€‹็งใฏโ€‹ใ‚ใชใŸใซโ€‹ใฉใ†โ€‹ๆ€ใˆใจโ€‹ใ„ใ†ใ‚ใ‘ใงใฏโ€‹ใ‚ใ‚Šใพใ›ใ‚“ใ€‚ ใ“ใ‚Œใ‚‰ใฎโ€‹ใƒ•ใƒฌใƒผใƒ ใƒฏใƒผใ‚ฏใงโ€‹้Šใ‚“ใงโ€‹ใฟใฆใ€โ€‹่‡ชๅˆ†ใชใ‚Šใฎโ€‹ๆ„่ฆ‹ใ‚’โ€‹ๆŒใคใ“ใจใ‚’โ€‹ใ‚ชใ‚นใ‚นใƒกใ—ใพใ™ใ€‚ ็งใฏโ€‹ใŸใ ใ€โ€‹็งใฎโ€‹่€ƒใˆใ‚’โ€‹ใŠไผใˆใ—ใฆใ„ใ‚‹ใ ใ‘ใงใ™ใ€‚ ็งใŒโ€‹่จ€ใ„ใŸใ„ใฎใฏใ€โ€‹ใ‚ใชใŸใฎโ€‹็ง‘ๅญฆ่€…ใŸใกใฏใ€โ€‹ใ€Œใงใใ‚‹โ€‹ใ“ใจใ€ใซโ€‹ๆฐ—ใ‚’โ€‹ๅ–ใ‚‰ใ‚Œใฆใ„ใฆใ€โ€‹ใ€Œใ™ในใใ“ใจใ€ใซโ€‹ใคใ„ใฆโ€‹่€ƒใˆใ€โ€‹็ซ‹ใกๆญขใพใ‚‹โ€‹ใ“ใจใ‚’โ€‹ใ—ใชใ‹ใฃใŸใฎใ ใจโ€‹ๆ€ใ„ใพใ™ใ€‚

ใ‚ณใƒผใƒ‰ใฏโ€‹ใƒฆใƒผใ‚ถใƒผใซโ€‹่ฟ‘ใ„โ€‹ๅ ดๆ‰€ใงโ€‹ๅฎŸ่กŒใ™ในใใงใ™ Code should run close to the user (๐ŸŒถ๐ŸŒถ)

ๅŽŸๆ–‡

Okay. This doesnโ€™t feel like it should be a particularly spicy take, but it does have some moderately spicy implications. Other things being equal, code should run as close to the user as possible. So the edge is better than a central server, but on device is better than the edge. Now other things are not always equal. Sometimes you need to access your database, in which case your code should run near your database. And sometimes you need to have access to sensitive information that canโ€™t be exposed to the client. But thereโ€™s a lot of stuff that doesnโ€™t fall into that category. For example, if I add a product to my shopping cart, I should be able to see that reflected immediately. Another example that weโ€™re all familiar with. When youโ€™re writing a comment in GitHub, you canโ€™t preview it without sending the comment to the server so that it can render the markdown. Sometimes itโ€™s pretty slow. You can absolutely do markdown rendering and syntax highlighting in the browser. Maybe you donโ€™t want to be lazy about loading the grammars that you use for the syntax highlighting, but it is a very solvable problem and it will provide a much nicer user experience. And this isnโ€™t just about latency. Itโ€™s also about resilience. I travel by Amtrak a fair bit and every time I do, Iโ€™m like, great, three hours of uninterrupted work. But then I keep running into things like that because my connection is so flaky and most times Iโ€™ll just give up and read a book instead. This is not just Amtrak. Itโ€™s also every time Iโ€™m on the subway or even when Iโ€™m walking down the stairs to leave my flat and my phone switches from Wi-Fi to cellular, just as Iโ€™m trying to look at the details of where Iโ€™m supposed to be going. Turns out weโ€™re pretty bad at building things in an offline first way at the best of times. All of this is why Iโ€™m personally a little bit nervous about React server components. For those of you who arenโ€™t aware, RSC means that your UI is rendered on the server by default and only components that have a special use client directive will run in the browser and have access to things like useState and useEffect. Server components and client components have different APIs, they can use different hooks and there are restrictions on how you can combine them, but the upshot is that by default in the future, your React app will run entirely on the server and you will opt in to client rendering for specific parts of your app. Now clearly this has some very substantial benefits. This is hugely important work and frankly it blows my mind, but I do worry that weโ€™ll become so paranoid about serving JavaScript to our users that weโ€™ll overcorrect. If the default interaction is to require a server round trip, for client components to be implicitly regarded as something to avoid, then the net result could be slower and less resilient web apps. I might just be fair mongering here, I donโ€™t know. Dan Abramov is probably going to do a withering tweet thread on why Iโ€™m wrong about this, but Iโ€™m very curious to see how this is all going to look in a couple of years with the benefit of hindsight.

IMHO

ใ•ใฆใ€โ€‹ๆฌกใฏโ€‹็‰นๆฎตใ‚นใƒ‘ใ‚คใ‚ทใƒผใงใฏใชใ„ใงใ—ใ‚‡ใ†ใŒใ€โ€‹ๅฐ‘ใ€…โ€‹่พ›่พฃใงใ™ใญใ€‚ ไป–ใฎโ€‹ๆกไปถใŒโ€‹ๅŒใ˜ใงโ€‹ใ‚ใ‚Œใฐใ€โ€‹ใ‚ณใƒผใƒ‰ใฏโ€‹ๅฏ่ƒฝใชโ€‹้™ใ‚Šใƒฆใƒผใ‚ถใƒผใซโ€‹่ฟ‘ใ„โ€‹ๅ ดๆ‰€ใงโ€‹ๅฎŸ่กŒใ™ในใใงใ™ใ€‚ ใคใพใ‚Šใ€โ€‹ไธญๅคฎใฎโ€‹ใ‚ตใƒผใƒใƒผใ‚ˆใ‚Šใ‚‚โ€‹ใ‚จใƒƒใ‚ธใฎโ€‹ๆ–นใŒโ€‹ใ„ใ„ใ—ใ€โ€‹ใ‚จใƒƒใ‚ธใ‚ˆใ‚Šใ‚‚โ€‹ใƒ‡ใƒใ‚คใ‚นใฎโ€‹ๆ–นใŒโ€‹ใ„ใ„ใฎใงใ™ใ€‚

ใ—ใ‹ใ—ใ€โ€‹ใใ‚Œใ‚‚โ€‹ๅ ดๅˆใซโ€‹ใ‚ˆใ‚Šใพใ™ใ€‚ ๅ ดๅˆใซโ€‹ใ‚ˆใฃใฆใฏใ€โ€‹ใƒ‡ใƒผใ‚ฟใƒ™ใƒผใ‚นใซโ€‹ใ‚ขใ‚ฏใ‚ปใ‚นใ™ใ‚‹โ€‹ๅฟ…่ฆใŒโ€‹ใ‚ใ‚‹โ€‹ใŸใ‚ใ€โ€‹ใ‚ณใƒผใƒ‰ใฏโ€‹ใƒ‡ใƒผใ‚ฟใƒ™ใƒผใ‚นใฎโ€‹่ฟ‘ใใงโ€‹ๅฎŸ่กŒใ™ใ‚‹โ€‹ๅฟ…่ฆใŒโ€‹ใ‚ใ‚Šใพใ™ใ€‚ ใใ—ใฆใ€โ€‹ใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆใซโ€‹ๅ…ฌ้–‹ใงใใชใ„โ€‹ๆฉŸๅฏ†ๆƒ…ๅ ฑใธใฎโ€‹ใ‚ขใ‚ฏใ‚ปใ‚นใŒโ€‹ๅฟ…่ฆใชโ€‹ๅ ดๅˆใ‚‚โ€‹ใ‚ใ‚Šใพใ™ใ€‚ ใ—ใ‹ใ—ใ€โ€‹ใใฎโ€‹ใ‚ซใƒ†ใ‚ดใƒชใซโ€‹ๅฝ“ใฆใฏใพใ‚‰ใชใ„โ€‹ใ‚‚ใฎใ‚‚โ€‹ใ‚ใ‚Šใพใ™ใ€‚

IMHO

ใŸโ€‹ใจใˆใฐใ€โ€‹ใ‚ทใƒงใƒƒใƒ”ใƒณใ‚ฐใ‚ซใƒผใƒˆใซโ€‹ๅ•†ๅ“ใ‚’โ€‹ๅ…ฅใ‚ŒใŸใ‚‰ใ€โ€‹ใใฎโ€‹ๅๆ˜ ใ‚’โ€‹ใ™ใใซโ€‹็ขบ่ชใงใใ‚‹ใ‚ˆใ†ใซโ€‹ใ—ใŸใ„ใงใ™ใ‚ˆใญใ€‚ ใ‚‚ใ†โ€‹ใฒใจใคใ€โ€‹็งใŸใกใŒโ€‹ใ‚ˆใโ€‹็Ÿฅใฃใฆใ„ใ‚‹โ€‹ไพ‹ใ‚’โ€‹ๆŒ™ใ’ใพใ™ใ€‚ GitHubใงโ€‹ใ‚ณใƒกใƒณใƒˆใ‚’โ€‹ๆ›ธใ„ใฆใ„ใ‚‹โ€‹ใจใใซใ€โ€‹ใ‚ณใƒกใƒณใƒˆใ‚’โ€‹ใ‚ตใƒผใƒใƒผใซโ€‹้€ไฟกใ—ใฆโ€‹markdownใ‚’โ€‹ใƒฌใƒณใƒ€ใƒชใƒณใ‚ฐใ™ใ‚‹ใพใงใ€โ€‹ใใ‚Œใ‚’โ€‹ใƒ—ใƒฌใƒ“ใƒฅใƒผใ™ใ‚‹โ€‹ใ“ใจใฏโ€‹ใงใใพใ›ใ‚“ใ€‚ ๆ™‚ใซใฏโ€‹ใ‹ใชใ‚Šโ€‹้…ใ„ใ“ใจใ‚‚ใ‚ใ‚Šใพใ™ใ€‚ ใƒ–ใƒฉใ‚ฆใ‚ถใงโ€‹ใƒžใƒผใ‚ฏใƒ€ใ‚ฆใƒณใฎโ€‹ใƒฌใƒณใƒ€ใƒชใƒณใ‚ฐใ‚„โ€‹ใ‚ทใƒณใ‚ฟใƒƒใ‚ฏใ‚นใƒใ‚คใƒฉใ‚คใƒˆใ‚’โ€‹่กŒใ†โ€‹ใ“ใจใฏโ€‹็ตถๅฏพใซโ€‹ใงใใพใ™ใ€‚ ใ‚ใชใŸใฏโ€‹ใ‚ทใƒณใ‚ฟใƒƒใ‚ฏใ‚นใƒใ‚คใƒฉใ‚คใƒˆใฎโ€‹ใƒญใƒผใƒ‰ใ‚’โ€‹ๅพ…ใกใŸใใชใ„ใ‹ใ‚‚ใ—ใ‚Œใพใ›ใ‚“ใŒใ€โ€‹ใ“ใ‚Œใฏโ€‹่งฃๆฑบๅฏ่ƒฝใชโ€‹ๅ•้กŒใงโ€‹ใ‚ใ‚Šใ€โ€‹็ตๆžœใจโ€‹ใ—ใฆใ‚ˆใ‚Šโ€‹่‰ฏใ„โ€‹ใƒฆใƒผใ‚ถใƒผใ‚จใ‚ฏใ‚นใƒšใƒชใ‚จใƒณใ‚นใ‚’โ€‹ๆไพ›ใ—ใพใ™ใ€‚

IMHO

ใพใŸใ€โ€‹ใ“ใ‚Œใฏโ€‹ใƒฌใ‚คใƒ†ใƒณใ‚ทใƒผใฎโ€‹ๅ•้กŒใ ใ‘ใงใฏโ€‹ใ‚ใ‚Šใพใ›ใ‚“ใ€‚ ใƒฌใ‚ธใƒชใ‚จใƒณใ‚นโ€‹๏ผˆๅ›žๅพฉๅŠ›๏ผ‰ใฎโ€‹ๅ•้กŒใงใ‚‚โ€‹ใ‚ใ‚‹ใฎใงใ™ใ€‚ ็งใฏโ€‹ใ‚ˆใโ€‹Amtrakใงโ€‹็งปๅ‹•ใ—ใพใ™ใ€‚โ€‹็งใฏโ€‹ใใฎใŸใณใซใ€โ€‹ใ€Œใ„ใ„ใญใ€โ€‹3ๆ™‚้–“้€ฃ็ถšใงโ€‹ไฝœๆฅญใŒโ€‹ใงใใ‚‹ใ€ใจโ€‹ๆ€ใฃใฆใ„ใ‚‹ใฎใงใ™ใŒใ€โ€‹ๆŽฅ็ถšใŒโ€‹ไธๅฎ‰ๅฎšใชโ€‹ใŸใ‚ใซโ€‹ๅคงๆŠตใฏโ€‹ไป•ไบ‹ใ‚’โ€‹่ซฆใ‚ใฆโ€‹ๆœฌใ‚’โ€‹่ชญใ‚€ใ“ใจใซใชใ‚Šใพใ™ใ€‚ ใ“ใ‚Œใฏโ€‹Amtrakใ ใ‘ใฎโ€‹ๅ•้กŒใงใฏโ€‹ใ‚ใ‚Šใพใ›ใ‚“ใ€‚โ€‹ๅœฐไธ‹้‰„ใซโ€‹ไน—ใฃใฆใ„ใ‚‹โ€‹ใจใใ‚„ใ€โ€‹่‡ชๅฎ…ใ‚’โ€‹ๅ‡บใฆโ€‹้šŽๆฎตใ‚’โ€‹้™ใ‚Šใ‚‹โ€‹ใจใใซใ€โ€‹็งใฎโ€‹้›ป่ฉฑใŒโ€‹Wi-Fiใ‹ใ‚‰โ€‹ใ‚ปใƒซใƒฉใƒผใซโ€‹ๅˆ‡ใ‚Šโ€‹ๆ›ฟใ‚ใฃใฆใ—ใพใ„ใ€โ€‹่กŒใๅ…ˆใฎโ€‹่ฉณ็ดฐใ‚’โ€‹่ฆ‹ใ‚ˆใ†ใจโ€‹ใ—ใฆใ„ใ‚‹โ€‹ๆœ€ไธญใซโ€‹ๆŽฅ็ถšใŒโ€‹ๅˆ‡ใ‚Œใฆใ—ใพใ†ใ“ใจใ‚‚ใ‚ใ‚Šใพใ™ใ€‚ ็ตๅฑ€ใ€โ€‹็งใŸใกใฏโ€‹Offline Firstใชโ€‹ๆ–นๆณ•ใงโ€‹็‰ฉใ‚’โ€‹ๆง‹็ฏ‰ใ™ใ‚‹ใฎใซโ€‹ใ‚ใพใ‚Šใซใ‚‚โ€‹ไธ‹ๆ‰‹ใชโ€‹ใ‚ˆใ†ใงใ™ใ€‚

IMHO

ใ“ใ‚Œใ‚‰ใ‚’โ€‹่ธใพใˆใฆใ€โ€‹็งใฏโ€‹ๅ€‹ไบบ็š„ใซReact Server Components(RSC)ใซโ€‹ใคใ„ใฆโ€‹ๅฐ‘ใ—โ€‹ๅฟƒ้…ใ—ใฆใ„ใพใ™ใ€‚ RSCใจใฏใ€โ€‹UIใŒโ€‹ใƒ‡ใƒ•ใ‚ฉใƒซใƒˆใงโ€‹ใ‚ตใƒผใƒใƒผไธŠใงโ€‹ใƒฌใƒณใƒ€ใƒชใƒณใ‚ฐใ•ใ‚Œใ€โ€‹็‰นๅˆฅใชuse clientใƒ‡ใ‚ฃใƒฌใ‚ฏใƒ†ใ‚ฃใƒ–ใ‚’โ€‹ๆŒใคใ‚ณใƒณใƒใƒผใƒใƒณใƒˆใฎใฟใŒโ€‹ใƒ–ใƒฉใ‚ฆใ‚ถใƒผไธŠใงโ€‹ๅฎŸ่กŒใ•ใ‚Œใ€useStateใ‚„useEffectใชใฉใซโ€‹ใ‚ขใ‚ฏใ‚ปใ‚นใงใใ‚‹โ€‹ใ“ใจใ‚’โ€‹ๆ„ๅ‘ณใ—ใพใ™ใ€‚ Server Componentใจโ€‹Client Componentใฏโ€‹็•ฐใชใ‚‹โ€‹APIใ‚’โ€‹ๆŒใกใ€โ€‹็•ฐใชใ‚‹โ€‹ใƒ•ใƒƒใ‚ฏใ‚’โ€‹ไฝฟ็”จใ™ใ‚‹โ€‹ใ“ใจใŒใงใใ€โ€‹ใใ‚Œใ‚‰ใ‚’โ€‹็ต„ใฟๅˆใ‚ใ›ใ‚‹โ€‹ๆ–นโ€‹ๆณ•ใซโ€‹ๅˆถ้™ใŒโ€‹ใ‚ใ‚Šใพใ™ใŒใ€โ€‹่ฆ็ด„ใ™ใ‚‹ใจใ€โ€‹ๅฐ†ๆฅ็š„ใซใฏโ€‹Reactใ‚ขใƒ—ใƒชใ‚ฑใƒผใ‚ทใƒงใƒณๅ…จไฝ“ใŒโ€‹ใ‚ตใƒผใƒใƒผไธŠใงโ€‹ๅฎŸ่กŒใ•ใ‚Œใ€โ€‹ใ‚ขใƒ—ใƒชใ‚ฑใƒผใ‚ทใƒงใƒณใฎโ€‹็‰นๅฎšใฎโ€‹้ƒจๅˆ†ใซโ€‹ๅฏพใ—ใฆใฎใฟโ€‹ใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆใƒปใƒฌใƒณใƒ€ใƒชใƒณใ‚ฐใŒโ€‹ใ‚ชใƒ—ใƒˆใ‚คใƒณใ•ใ‚Œใ‚‹โ€‹ใ“ใจใซใชใ‚Šใพใ™ใ€‚ ใ“ใ‚Œใฏโ€‹ๆ˜Žใ‚‰ใ‹ใซใ€โ€‹้žๅธธใซโ€‹ๅคงใใชโ€‹ใƒกใƒชใƒƒใƒˆใŒโ€‹ใ‚ใ‚Šใพใ™ใ—ใ€โ€‹็އ็›ดใซโ€‹ใ„ใฃใฆโ€‹ใจใฆใ‚‚โ€‹ใƒฏใ‚ฏใƒฏใ‚ฏใ—ใฆใ„ใพใ™ใ€‚ ใ—ใ‹ใ—ใ€โ€‹ใ“ใ‚Œใซโ€‹ใ‚ˆใฃใฆโ€‹็งใŸใกใฏโ€‹ใƒฆใƒผใ‚ถใƒผใซโ€‹JavaScriptใ‚’โ€‹ๆไพ›ใ™ใ‚‹โ€‹ใ“ใจใซโ€‹ๅฏพใ—ใฆโ€‹้Žๅ‰ฐใซโ€‹ๆ…Ž้‡ใซโ€‹ใชใ‚Šใ™ใŽใ‚‹โ€‹ๅฏ่ƒฝๆ€งใŒโ€‹ใ‚ใ‚‹ใจโ€‹ๅฟƒ้…ใ—ใฆใ„ใพใ™ใ€‚

ใ‚‚ใ—ใ€โ€‹ใƒ‡ใƒ•ใ‚ฉใƒซใƒˆใฎโ€‹ใ‚คใƒณใ‚ฟใƒฉใ‚ฏใ‚ทใƒงใƒณใŒใ€โ€‹ใ‚ตใƒผใƒใƒผใฎโ€‹ใƒฉใ‚ฆใƒณใƒ‰ใƒˆใƒชใƒƒใƒ—ใ‚’โ€‹ๅฟ…่ฆใจใ—ใ€โ€‹ใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆใ‚ณใƒณใƒใƒผใƒใƒณใƒˆใŒโ€‹ๆš—้ป™ใฎโ€‹ใ†ใกใซโ€‹้ฟใ‘ใ‚‹ในใใ‚‚ใฎใจใฟใชใ•ใ‚Œใ‚‹โ€‹ใชใ‚‰ใฐใ€โ€‹็ตๆžœโ€‹็š„ใซโ€‹ใ‚ˆใ‚Šโ€‹้…ใใ€โ€‹ใ‚ˆใ‚Šโ€‹ๅ›žๅพฉๅŠ›ใฎโ€‹ใชใ„โ€‹ใ‚ฆใ‚งใƒ–ใ‚ขใƒ—ใƒชใ‚ฑใƒผใ‚ทใƒงใƒณใ‚’โ€‹็”Ÿใฟๅ‡บใ™โ€‹ๅฏ่ƒฝๆ€งใŒโ€‹ใ‚ใ‚Šใพใ™ใ€‚

็งใฏโ€‹ใ“ใ“ใงโ€‹ไธๅฎ‰ใ‚’โ€‹็…ฝใฃใฆใ„ใ‚‹ใ ใ‘ใ‹ใ‚‚ใ—ใ‚Œใพใ›ใ‚“ใŒใ€โ€‹็งใฏโ€‹ใ‚ใ‹ใ‚Šใพใ›ใ‚“ใ€‚ Dan Abramovใฏใ€โ€‹็งใŒโ€‹้–“้•ใฃใฆใ„ใ‚‹โ€‹็†็”ฑใซโ€‹ใคใ„ใฆโ€‹้‹ญใ„โ€‹ใƒ„ใ‚คใƒผใƒˆใ‚นใƒฌใƒƒใƒ‰ๆŠ•็จฟใ™ใ‚‹ใ‹ใ‚‚ใ—ใ‚Œใพใ›ใ‚“ใŒใ€โ€‹ใ“ใ‚Œใ‚‰โ€‹ใ™ในใฆใŒโ€‹ๆ•ฐๅนดๅพŒใซโ€‹ใฉใฎใ‚ˆใ†ใซใชใ‚‹ใ‹ใฏโ€‹ๆฅฝใ—ใฟใงใ™ใ€‚

RPCใ‚’โ€‹ๅ†็™บๆ˜Žใ™ใ‚‹โ€‹ใ“ใจใ‚’โ€‹ๅพŒๆ‚”ใ™ใ‚‹โ€‹ใ“ใจใซโ€‹ใชใ‚‹โ€‹ We will regret reinventing RPC (๐ŸŒถ๐ŸŒถ๐ŸŒถ)

ๅŽŸๆ–‡

Okay, another spicy to take, we will regret reinventing RPC. RPC stands for Remote Procedure Call, itโ€™s an idea that has been around since the 70s. Basically what it means is that instead of passing a message to a server and waiting for a response, you call a function on the server instead and the RPC protocol takes care of the actual message passing. In effect, it allows you to pretend that a distributed system is not distributed, youโ€™re just calling functions. Back in the 80s, people were calling the wisdom of this idea into question. This 1988 paper by Andrew Tannenbaum called A Critique of the Remote Procedure Call Paradigm is very much of its time, but itโ€™s still worth reading. Some arguments canโ€™t be serialized correctly, serializing closures is particularly hairy. If the server mutates arguments, that mutation wonโ€™t be respected on the client. Network errors and logic errors all kind of get smushed together. All of these things are easy to deal with if youโ€™re not hiding the implementation details. But over the past few months, RPC has had a bit of a renaissance in the front-end world, except that we now call it server functions. I first saw it in Solid Start. The idea is that you write code like this, and oh, hang on, they write code like this. Iโ€™m going to have to try and remember my slides because I messed this up. And the compiler sort of waves a magic wand and you can call code on your server as though it were a local function. And so the ergonomics of this are undeniably really nice. You even get type safety because as far as TypeScript is concerned, it is just a local function. But a while back, Jason Miller, the creator of PReact, did a tweet that I found quite interesting. He said, in effect, that these abstractions are dangerous. I hope heโ€™s wrong, but I think he might be right. I can retell you this example here. This server function looks and feels like an internal implementation detail, but itโ€™s not. Weโ€™ve actually made an HTTP endpoint that anyone can call with any data. So TypeScript is telling us that fields can be name or quantity, but in reality, it could be NAME; DROP TABLE "USERS" If you know, you know. So when you make an endpoint explicit and youโ€™re working with full data, youโ€™re aware on some level that the data is untrusted. And so, you know, I think youโ€™re much less likely to make this sort of error than if it looks like a private function call. And you might be thinking, Rich, come on, I would never make that mistake. But look to your left and look to your right at the people around you. Do you trust them not to make that mistake? I donโ€™t know. Bear in mind also that if you use source maps for debugging and they contain the original server code, youโ€™re basically handing attackers a diagram of your defenses. This shit makes me very nervous. So people have asked us to add this to Sveltekit, and weโ€™ve said no. Maybe one day, once enough people have fucked around and found out, weโ€™ll do it. But not yet. We think that part of our responsibility as toolmakers is to the extent that weโ€™re able to help protect you and your users against these sorts of issues. So Sveltekit has built-in CSRF protection, it has CSP primitives, and we donโ€™t do things like that just because they feel convenient.

IMHO

ใ•ใฆใ€โ€‹ใ‚‚ใ†โ€‹1ใคใฎโ€‹ๅˆบๆฟ€็š„ใชโ€‹่ฉฑ้กŒใงใ™ใŒใ€โ€‹็งใŸใกใฏโ€‹RPCใ‚’โ€‹ๅ†็™บๆ˜Žใ™ใ‚‹โ€‹ใ“ใจใ‚’โ€‹ๅพŒๆ‚”ใ™ใ‚‹ใงใ—ใ‚‡ใ†ใ€‚ RPCใจใฏโ€‹Remote Procedure Callใฎโ€‹็•ฅใงใ€โ€‹70ๅนดไปฃใ‹ใ‚‰โ€‹ใ‚ใ‚‹โ€‹ใ‚ขใ‚คใƒ‡ใ‚ขใงใ™ใ€‚ ๅŸบๆœฌ็š„ใซใฏใ€โ€‹ใ‚ตใƒผใƒใƒผใซโ€‹ใƒกใƒƒใ‚ปใƒผใ‚ธใ‚’โ€‹ๆธกใ—ใฆโ€‹ๅฟœ็ญ”ใ‚’โ€‹ๅพ…ใคโ€‹ไปฃใ‚ใ‚Šใซใ€โ€‹ใ‚ตใƒผใƒใƒผไธŠใฎโ€‹้–ขๆ•ฐใ‚’โ€‹ๅ‘ผใณๅ‡บใ—ใ€โ€‹RPCใƒ—ใƒญใƒˆใ‚ณใƒซใŒโ€‹ๅฎŸ้š›ใฎโ€‹ใƒกใƒƒใ‚ปใƒผใ‚ธใฎโ€‹ใ‚„ใ‚Šๅ–ใ‚Šใ‚’โ€‹ๅ‡ฆ็†ใ—ใพใ™ใ€‚

ใ“ใ‚Œใ‚’โ€‹ไฝฟใ†ใจใ€โ€‹ๅˆ†ๆ•ฃใ‚ทใ‚นใƒ†ใƒ ใ‚’โ€‹ใ‚ใŸใ‹ใ‚‚โ€‹ๅˆ†ๆ•ฃใ—ใฆใ„ใชใ„ใ‚ˆใ†ใซโ€‹ๆ‰ฑใ†ใ“ใจใŒใงใใพใ™ใ€‚ ๅ˜ใซโ€‹้–ขๆ•ฐใ‚’โ€‹ๅ‘ผใณๅ‡บใ›ใฐโ€‹่‰ฏใ„ใฎใงใ™ใ€‚ 80ๅนดไปฃใซใฏใ€โ€‹ไบบใ€…ใฏโ€‹ใ“ใฎโ€‹ใ‚ขใ‚คใƒ‡ใ‚ขใฎโ€‹่ณขๆ˜Žใ•ใซโ€‹็–‘ๅ•ใ‚’โ€‹ๅ‘ˆใ—ใฆใ„ใพใ—ใŸใ€‚ Andrew Tanenbaumใฎโ€‹1988ๅนดใฎโ€‹่ซ–ๆ–‡โ€‹ใ€ŒA Critique of the Remote Procedure Call Paradigmใ€ใฏโ€‹ใ‹ใชใ‚Šโ€‹ๆ˜”ใฎโ€‹่ซ–ๆ–‡ใงใ™ใŒใ€โ€‹ไปŠใงใ‚‚โ€‹่ชญใ‚€ไพกๅ€คใŒโ€‹ใ‚ใ‚Šใพใ™ใ€‚

RPCใงใฏโ€‹ไธ€้ƒจใฎโ€‹ๅผ•ๆ•ฐใฏโ€‹ๆญฃใ—ใโ€‹ใ‚ทใƒชใ‚ขใƒฉใ‚คใ‚บใงใใšใ€โ€‹ใ‚ฏใƒญใƒผใ‚ธใƒฃใฎโ€‹ใ‚ทใƒชใ‚ขใƒฉใ‚คใ‚บใฏโ€‹็‰นใซโ€‹ๅŽ„ไป‹ใงใ™ใ€‚ ใ‚ตใƒผใƒใƒผใŒโ€‹ๅผ•ๆ•ฐใ‚’โ€‹ๅค‰ๆ›ดใ—ใŸโ€‹ๅ ดๅˆใงใ‚‚ใ€โ€‹ใใฎโ€‹ๅค‰ๆ›ดใฏโ€‹ใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆๅดใงใฏโ€‹ๅฐŠ้‡ใ•ใ‚Œใพใ›ใ‚“ใ€‚ ใƒใƒƒใƒˆใƒฏใƒผใ‚ฏใ‚จใƒฉใƒผใ‚„โ€‹ใƒญใ‚ธใƒƒใ‚ฏใ‚จใƒฉใƒผใชใฉใŒโ€‹ใ™ในใฆโ€‹ๆททๅœจใ—ใฆใ—ใพใ„ใพใ™ใ€‚ ใ“ใ‚Œใ‚‰ใฎโ€‹ใ“ใจใฏใ€โ€‹ๅฎŸ่ฃ…ใฎโ€‹่ฉณ็ดฐใ‚’โ€‹้š ใ•ใชใ„ใฎใงใ‚ใ‚Œใฐใ€โ€‹็ฐกๅ˜ใซโ€‹ๅฏพๅ‡ฆใงใใพใ™ใ€‚

IMHO

็›ด่ฟ‘ใฎโ€‹ๆ•ฐใ‹โ€‹ๆœˆ้–“ใงใ€โ€‹RPCใฏโ€‹ใƒ•ใƒญใƒณใƒˆใ‚จใƒณใƒ‰ใฎโ€‹ไธ–็•Œใงโ€‹ๅ†ใณๆณจ็›ฎใ•ใ‚Œใ‚‹ใ‚ˆใ†ใซใชใ‚Šใพใ—ใŸใ€‚ใ‚ตใƒผใƒใƒผ้–ขๆ•ฐใจโ€‹ๅ‘ผใฐใ‚Œใ‚‹โ€‹ใ‚‚ใฎใงใ™ใ€‚ ็งใฏโ€‹ๆœ€ๅˆใซSolid Startใงโ€‹ใใ‚Œใ‚’โ€‹่ฆ‹ใพใ—ใŸใ€‚ ใใ—ใฆใ€โ€‹ใ‚ณใƒณใƒ‘ใ‚คใƒฉใŒโ€‹้ญ”ๆณ•ใฎโ€‹ๆ–ใ‚’โ€‹ๆŒฏใ‚Šใ‹ใ–ใ™ใจใ€โ€‹ใ‚ตใƒผใƒใƒผไธŠใฎโ€‹ใ‚ณใƒผใƒ‰ใ‚’โ€‹ใ‚ใŸใ‹ใ‚‚โ€‹ใƒญใƒผใ‚ซใƒซ้–ขๆ•ฐใฎใ‚ˆใ†ใซโ€‹ๅ‘ผใณๅ‡บใ™ใ“ใจใŒใงใใพใ™ใ€‚ ไบบ้–“โ€‹ๅทฅๅญฆ็š„ใซโ€‹้žๅธธใซโ€‹ๅ„ชใ‚Œใฆใ„ใพใ™ใญใ€‚ TypeScriptใซโ€‹้–ขใ—ใฆใฏใ€โ€‹ใƒญใƒผใ‚ซใƒซ้–ขๆ•ฐใงใ‚ใ‚‹ใ‹ใฎใ‚ˆใ†ใซโ€‹ๆ‰ฑใ‚ใ‚Œใ‚‹โ€‹ใŸใ‚ใ€โ€‹ๅž‹ๅฎ‰ๅ…จๆ€งใ•ใˆโ€‹ๅพ—ใ‚‰ใ‚Œใพใ™ใ€‚

IMHO

ใ—ใ‹ใ—ใ€โ€‹ๆ•ฐใ‹โ€‹ๆœˆๅ‰ใ€โ€‹PReactใฎโ€‹ไฝœ่€…ใงใ‚ใ‚‹โ€‹Jason Millerใฏใ€โ€‹ใ‹ใชใ‚Šโ€‹่ˆˆๅ‘ณๆทฑใ„โ€‹ใƒ„ใ‚คใƒผใƒˆใ‚’โ€‹ใ—ใพใ—ใŸใ€‚ ๅฝผใฏใ€โ€‹ไบ‹ๅฎŸไธŠใ€โ€‹ใ“ใ‚Œใ‚‰ใฎโ€‹ๆŠฝ่ฑกๅŒ–ใฏโ€‹ๅฑ้™บใงใ‚ใ‚‹ใจโ€‹่ฟฐในใพใ—ใŸใ€‚ ๅฝผใŒโ€‹้–“้•ใฃใฆใ„ใ‚‹โ€‹ใ“ใจใ‚’โ€‹้ก˜ใฃใฆใ„ใพใ™ใŒใ€โ€‹ๅฝผใŒโ€‹ๆญฃใ—ใ„ใ‹ใ‚‚ใ—ใ‚Œใพใ›ใ‚“ใ€‚

IMHO

ใ“ใฎโ€‹ไพ‹ใ‚’โ€‹ๅ†ๅบฆ่ชฌๆ˜Žใ—ใพใ™ใ€‚ ใ“ใฎโ€‹ใ‚ตใƒผใƒใƒผ้–ขๆ•ฐใฏโ€‹ๅ†…้ƒจใฎโ€‹ๅฎŸ่ฃ…ใฎใ‚ˆใ†ใซโ€‹่ฆ‹ใˆใพใ™ใŒใ€โ€‹ๅฎŸ้š›ใซใฏโ€‹ใใ†ใงใฏโ€‹ใ‚ใ‚Šใพใ›ใ‚“ใ€‚ ่ชฐใงใ‚‚โ€‹ไปปๆ„ใฎโ€‹ใƒ‡ใƒผใ‚ฟใงโ€‹HTTPใ‚จใƒณใƒ‰ใƒใ‚คใƒณใƒˆใ‚’โ€‹ๅ‘ผใณๅ‡บใ›ใ‚‹ใ‚ˆใ†ใซใชใฃใฆใ„ใพใ™ใ€‚ TypeScriptใฏใ€โ€‹ใƒ•ใ‚ฃใƒผใƒซใƒ‰ใŒnameใพใŸใฏqtyใงใ‚ใ‚‹โ€‹ใ“ใจใ‚’โ€‹็คบใ—ใฆใ„ใพใ™ใŒใ€โ€‹ๅฎŸ้š›ใซใฏNAME; DROP TABLE "USERS"ใงใ‚ใ‚‹โ€‹ๅฏ่ƒฝๆ€งใ‚‚โ€‹ใ‚ใ‚Šใพใ™ใ€‚ ใŠๅˆ†ใ‹ใ‚Šใ ใฃใŸโ€‹ๆ–นใ‚‚โ€‹ใ„ใ‚‰ใฃใ—ใ‚ƒใ„ใพใ™ใ‚ˆใญ๏ผŸ

ๅฏพใ—ใฆใ€โ€‹ๆ˜Ž็คบ็š„ใซโ€‹ใ‚จใƒณใƒ‰ใƒใ‚คใƒณใƒˆใ‚’โ€‹่จญ่จˆใ—ใ€โ€‹ๅฎŒๅ…จใชโ€‹ใƒ‡ใƒผใ‚ฟใ‚’โ€‹ๆ‰ฑใ†ใชใ‚‰ใฐใ€โ€‹ๅ—ไฟกใ™ใ‚‹โ€‹ใƒ‡ใƒผใ‚ฟใŒโ€‹ไฟก้ ผใงใใชใ„โ€‹ใ‚‚ใฎใงใ‚ใ‚‹โ€‹ใ“ใจใ‚’โ€‹ใ‚ใ‚‹โ€‹็จ‹ๅบฆโ€‹่ช่ญ˜ใ—ใฆใ„ใ‚‹โ€‹ใ“ใจใซใชใ‚Šใพใ™ใ€‚ ใพใŸใ‚‚ใ—โ€‹ใใ‚ŒใŒโ€‹้žๅ…ฌ้–‹ใฎโ€‹้–ขๆ•ฐโ€‹ๅ‘ผใณๅ‡บใ—ใ ใฃใŸใจใ—ใฆใ‚‚ใ€โ€‹ใ“ใฎโ€‹็จฎใฎโ€‹ใ‚จใƒฉใƒผใ‚’โ€‹ไฝœใ‚‹โ€‹ๅฏ่ƒฝๆ€งใŒโ€‹ใšใฃใจโ€‹ไฝŽใ„ใจโ€‹ๆ€ใ„ใพใ™ใ€‚

ใ€ŒใŠใ„โ€‹ใŠใ„Richใ€โ€‹ไฟบใฏโ€‹ใใ‚“ใชโ€‹ใƒŸใ‚นใฏโ€‹ใ—ใชใ„ใžใ€ใจโ€‹ๆ€ใ†ใ‹ใ‚‚ใ—ใ‚Œใพใ›ใ‚“ใ€‚ ใ—ใ‹ใ—ใ€โ€‹ๅทฆใ‚’โ€‹่ฆ‹ใฆใ€โ€‹ๅณใ‚’โ€‹่ฆ‹ใฆใ€โ€‹ใ‚ใชใŸใฎโ€‹ๅ‘จใ‚Šใฎโ€‹ไบบใŸใกใ‚’โ€‹่ฆ‹ใฆใใ ใ•ใ„ใ€‚ ใใฎโ€‹ไบบใŸโ€‹ใกใŒโ€‹ใ“ใฎใ‚ˆใ†ใชโ€‹้–“้•ใ„ใ‚’โ€‹ใ—ใชใ„ใจโ€‹ไฟกใ˜ใฆใ„ใ‚‹ใฎใงใ—ใ‚‡ใ†ใ‹๏ผŸ ็งใซใฏโ€‹ใ‚ใ‹ใ‚Šใพใ›ใ‚“ใ€‚

ใพใŸใ€โ€‹ใƒ‡ใƒใƒƒใ‚ฐใฎโ€‹ใŸใ‚ใซโ€‹ใ‚ฝใƒผใ‚นใƒžใƒƒใƒ—ใ‚’โ€‹ไฝฟ็”จใ—ใ€โ€‹ใใฎโ€‹ใ‚ฝใƒผใ‚นใƒžใƒƒใƒ—ใซโ€‹ใ‚ชใƒชใ‚ธใƒŠใƒซใฎโ€‹ใ‚ตใƒผใƒใƒผใ‚ณใƒผใƒ‰ใŒโ€‹ๅซใพใ‚Œใฆใ„ใ‚‹โ€‹ๅ ดๅˆใ€โ€‹ๅŸบๆœฌ็š„ใซโ€‹ๆ”ปๆ’ƒ่€…ใซโ€‹้˜ฒๅพกใฎโ€‹ๅ›ณใ‚’โ€‹ๆธกใ—ใฆใ„ใ‚‹โ€‹ใ“ใจใซโ€‹ใชใ‚‹ใ“ใจใ‚‚โ€‹ๅฟต้ ญใซโ€‹็ฝฎใ„ใฆใŠใ„ใฆใใ ใ•ใ„ใ€‚ ็งใฏโ€‹ใจใฆใ‚‚โ€‹ไธๅฎ‰ใซโ€‹ใชใ‚Šใพใ™ใ€‚ ใ ใ‹ใ‚‰ใ€โ€‹Sveltekitใซโ€‹ใ“ใฎๆฉŸ่ƒฝใ‚’โ€‹่ฟฝๅŠ ใ—ใฆโ€‹ใปใ—ใ„ใจโ€‹ใ„ใ†โ€‹่ฆๆœ›ใŒโ€‹ใ‚ใ‚Šใพใ™ใŒใ€โ€‹็งใŸใกใฎโ€‹็ญ”ใˆใฏโ€‹ใ€ŒใƒŽใƒผใ€ใงใ™ใ€‚ ใ‚‚โ€‹ใ—ใ‹ใ—ใŸใ‚‰ใ€โ€‹ๅๅˆ†ใซโ€‹ๅคšใใฎโ€‹ไบบใ€…ใŒโ€‹่ฉฆ่กŒ้Œฏ่ชคใ—ใŸโ€‹็ตๆžœโ€‹ใ„ใคใ‹โ€‹ๅฎŸ่ฃ…ใ™ใ‚‹ใ‹ใ‚‚ใ—ใ‚Œใพใ›ใ‚“ใ€‚ ใ—ใ‹ใ—ใ€โ€‹ใพใ ใงใ™ใ€‚ ใƒ„ใƒผใƒซใƒกใƒผใ‚ซใƒผใจโ€‹ใ—ใฆใฎโ€‹็งใŸใกใฎโ€‹่ฒฌไปปใฎโ€‹ไธ€้ƒจใฏใ€โ€‹ใ“ใฎโ€‹็จฎใฎโ€‹ๅ•้กŒใซโ€‹ๅฏพใ—ใฆใ‚ใชใŸใจโ€‹ใ‚ใชใŸใฎโ€‹ใƒฆใƒผใ‚ถใƒผใ‚’โ€‹ไฟ่ญทใ™ใ‚‹โ€‹ใŸใ‚ใซโ€‹ใงใใ‚‹โ€‹้™ใ‚Šใฎโ€‹ใ“ใจใ‚’โ€‹ใ™ใ‚‹โ€‹ใ“ใจใงใ™ใ€‚ Sveltekitใซใฏใ€โ€‹็ต„ใฟ่พผใฟใฎโ€‹CSRFไฟ่ญทใŒโ€‹ใ‚ใ‚Šใ€โ€‹CSPใƒ—ใƒชใƒŸใƒ†ใ‚ฃใƒ–ใŒโ€‹ใ‚ใ‚Šใพใ™ใ€‚ ็งใŸใกใฏโ€‹ใ€ŒใŸใ โ€‹ไพฟๅˆฉใ ใ‹ใ‚‰ใ€ใจโ€‹ใ„ใ†โ€‹็†็”ฑใงโ€‹ๅ‹•ใ„ใฆใฏใ„ใชใ„ใฎใงใ™ใ€‚

ใƒ“ใƒซใƒ‰ใ‚นใƒ†ใƒƒใƒ—ใฏโ€‹่‰ฏใ„โ€‹ใ‚พ Build steps are good (๐ŸŒถ)

ๅŽŸๆ–‡

Again, Iโ€™m rating this one low on the Scoville scale, even though it seems like an unpopular opinion, because I think itโ€™s actually pretty obvious. Build steps are good. This idea that comes up every now and again in front-end, that build tools are the devilโ€™s work and that we would all be much better off without them. This is a recent example that gained some traction from the Deno blog, and itโ€™s one of the better versions of this argument that Iโ€™ve seen. Normally theyโ€™re a lot angrier, but the thing that often gets missed in discussions about build steps is that they primarily exist for a userโ€™s benefit, not for ours. Build steps let us minify code, they let us combine 100 small modules into 10 core screen chunks that load faster, they remove unused code from client-side bundles, they optimize images, they hash assets so that they can be cached immutably, they guard against bugs by type-checking and linting. This is all stuff that directly results in a better user experience. Itโ€™s true that build steps also benefit developers by letting us use non-standard dialects, easily import dependencies and things like that, but if you remove build steps, a user experience that suffers more than developer experience. And yet, interestingly, if you look at the people who complain most vociferously that our industry prizes DX over UX, and then look at the people who want to get rid of build tooling, there is a striking overlap. Itโ€™s hard not to conclude that it comes more from a reflexively anti-tooling mindset than a genuine concern for users. Hereโ€™s another example of a build step being really beneficial that I didnโ€™t get around to doing a slide for. And all of the code snippets in SvelteKitโ€™s documentation are type-checked against the SvelteKit source code. So for example, this code down here is checked at deploy time to make sure that it doesnโ€™t contain any errors and that itโ€™s up to date with current types in SvelteKit itself. And that unavoidably takes time. One of these pages might take several seconds to render on this M1 MacBook Pro. So we pre-render this content at build time, as well as ensuring that we donโ€™t publish incorrect documentation, because if we do, the deployment will fail. It means that everyone visiting this site gets content instantly. If we did that rendering on demand instead, then even if we had incredibly sophisticated caching, some users would end up having to wait multiple seconds for the page to load, and that is just not acceptable. So build steps. You might not need one, but you should probably have one anyway.

IMHO

ใ•ใฆใ€โ€‹ๆฌกใฎโ€‹ๆ„่ฆ‹ใฏโ€‹ใ‚นใ‚ณใƒดใ‚ฃใƒซๅ€ค^่พ›ใ•ใฎโ€‹ๅ˜ไฝ: [ใ‚นใ‚ณใƒดใ‚ฃใƒซๅ€ค(https://ja.wikipedia.org/wiki/ใ‚นใ‚ณใƒดใ‚ฃใƒซๅ€ค)]ใ‚’โ€‹ไฝŽใ‚ใซโ€‹ใ—ใฆใ„ใพใ™ใ€‚ ใชใœใชใ‚‰โ€‹็งใฏโ€‹ใ“ใฎโ€‹ๆ„่ฆ‹ใฏโ€‹ใ‚ใพใ‚Šโ€‹ไธ–้–“ใงโ€‹ๅ—ใ‘ๅ…ฅใ‚Œใ‚‰ใ‚Œใฆใ„ใชใ„ใซใ‚‚โ€‹ใ‹ใ‹ใ‚ใ‚‰ใšใ€โ€‹ๅฎŸใฏโ€‹็ตๆง‹โ€‹ๅฝ“ใŸใ‚Šๅ‰ใฎโ€‹ใ“ใจใ ใจโ€‹ๆ€ใ†ใ‹ใ‚‰ใงใ™ใ€‚

ใƒ“ใƒซใƒ‰ใ‚นใƒ†ใƒƒใƒ—ใŒโ€‹้žๅธธใซโ€‹้‡่ฆใงใ™ใ€‚

IMHO

ใƒ“ใƒซใƒ‰ใƒ„ใƒผใƒซใฏโ€‹ๆ‚ช้ญ”ใฎโ€‹ๆ‰€ๆฅญใงใ‚ใ‚Šใ€โ€‹ใƒ“ใƒซใƒ‰ใƒ„ใƒผใƒซใŒโ€‹ใชใ„ๆ–นใŒโ€‹ใšใฃใจโ€‹่‰ฏใ„ใจโ€‹ใ„ใ†โ€‹่€ƒใˆๆ–นใฏใ€โ€‹ใƒ•ใƒญใƒณใƒˆใ‚จใƒณใƒ‰ใงโ€‹ๆ™‚ใ€…โ€‹ๅ‡บใฆใใพใ™ใ€‚ ๆœ€่ฟ‘ใฎโ€‹ไพ‹ใงใฏใ€โ€‹Denoใƒ–ใƒญใ‚ฐใ‹ใ‚‰โ€‹ๅบƒใŒใฃใŸโ€‹่ญฐ่ซ–ใŒโ€‹ใ‚ใ‚Šใพใ™ใŒใ€โ€‹ใ“ใ‚Œใฏโ€‹็งใŒโ€‹่ฆ‹ใŸไธญใงใ‚‚โ€‹ใ‹ใชใ‚Šโ€‹ๅ„ชใ‚ŒใŸโ€‹่ญฐ่ซ–ใฎโ€‹1ใคใงใ™ใ€‚ ้€šๅธธใ€โ€‹ๅฝผใ‚‰ใฏโ€‹ใ‚‚ใฃใจโ€‹ๆ€’ใฃใฆใ„ใพใ™ใŒใ€โ€‹ใƒ“ใƒซใƒ‰ใ‚นใƒ†ใƒƒใƒ—ใซโ€‹ใคใ„ใฆใฎโ€‹่ญฐ่ซ–ใงใ—ใฐใ—ใฐโ€‹่ฆ‹่ฝใจใ•ใ‚Œใ‚‹ใฎใฏใ€โ€‹ใƒ“ใƒซใƒ‰ใ‚นใƒ†ใƒƒใƒ—ใฏโ€‹ไธปใซโ€‹ใƒฆใƒผใ‚ถใƒผใฎโ€‹ๅˆฉ็›Šใฎโ€‹ใŸใ‚ใซโ€‹ๅญ˜ๅœจใ™ใ‚‹ใฎใงใ‚ใฃใฆใ€โ€‹็งใŸใกใฎโ€‹ใŸใ‚ใซโ€‹ๅญ˜ๅœจใ™ใ‚‹ใฎใงใฏใชใ„ใจโ€‹ใ„ใ†โ€‹ใ“ใจใงใ™ใ€‚

IMHO

ใƒ“ใƒซใƒ‰ใ‚นใƒ†ใƒƒใƒ—ใฏโ€‹ใ‚ณใƒผใƒ‰ใ‚’โ€‹ๆœ€ๅฐๅŒ–ใ—ใ€โ€‹100ๅ€‹ใฎโ€‹ๅฐใ•ใชโ€‹ใƒขใ‚ธใƒฅใƒผใƒซใ‚’โ€‹10ๅ€‹ใฎโ€‹ใ‚ณใ‚ขใ‚นใ‚ฏใƒชใƒผใƒณใฎโ€‹ๅกŠใซโ€‹ใพใจใ‚ใ€โ€‹ใ‚ˆใ‚Šโ€‹้ซ˜้€Ÿใซโ€‹่ชญใฟ่พผใ‚ใ‚‹ใ‚ˆใ†ใซใ—ใพใ™ใ€‚ ใพใŸใ€โ€‹ใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆๅดใฎโ€‹ใƒใƒณใƒ‰ใƒซใ‹ใ‚‰โ€‹ๆœชไฝฟ็”จใฎโ€‹ใ‚ณใƒผใƒ‰ใ‚’โ€‹ๅ‰Š้™คใ—ใŸใ‚Šใ€โ€‹็”ปๅƒใ‚’โ€‹ๆœ€้ฉๅŒ–ใ—ใŸใ‚Šใ€โ€‹ใ‚ขใ‚ปใƒƒใƒˆใ‚’โ€‹ใƒใƒƒใ‚ทใƒฅๅŒ–ใ—ใฆโ€‹ใ‚ญใƒฃใƒƒใ‚ทใƒฅใงใใ‚‹ใ‚ˆใ†ใซใ—ใพใ™ใ€‚ Type Checkใ‚„โ€‹Lintใซโ€‹ใ‚ˆใฃใฆโ€‹ใƒใ‚ฐใ‚’โ€‹้˜ฒๆญขใ™ใ‚‹โ€‹ใ“ใจใ‚‚โ€‹ใงใใพใ™ใ€‚ ใ“ใ‚Œใ‚‰ใฏโ€‹ใ™ในใฆใ€โ€‹ใ‚ˆใ‚Šโ€‹่‰ฏใ„โ€‹ใƒฆใƒผใ‚ถใƒผใ‚จใ‚ฏใ‚นใƒšใƒชใ‚จใƒณใ‚นใซโ€‹็›ดๆŽฅใคใชใŒใ‚‹โ€‹ใ‚‚ใฎใงใ™ใ€‚

็ขบใ‹ใซโ€‹ใƒ“ใƒซใƒ‰ใ‚นใƒ†ใƒƒใƒ—ใฏใ€โ€‹้žๆจ™ๆบ–ใฎโ€‹ๆ–นโ€‹่จ€ใ‚’โ€‹ไฝฟใฃใŸใ‚Šไพๅญ˜้–ขไฟ‚ใ‚’โ€‹็ฐกๅ˜ใซโ€‹ใ‚คใƒณใƒใƒผใƒˆใงใใŸใ‚Šใจใ€โ€‹้–‹็™บ่€…ใซใ‚‚โ€‹ใƒกใƒชใƒƒใƒˆใŒโ€‹ใ‚ใ‚Šใพใ™ใ€‚ ใ—ใ‹ใ—ใ€โ€‹ใƒ“ใƒซใƒ‰ใ‚นใƒ†ใƒƒใƒ—ใ‚’โ€‹ๅ‰Š้™คใ™ใ‚‹ใจใ€โ€‹้–‹็™บ่€…ใฎโ€‹็ตŒ้จ“ใ‚ˆใ‚Šใ‚‚โ€‹ใƒฆใƒผใ‚ถใƒผใฎโ€‹็ตŒ้จ“ใฎโ€‹ๆ–นใŒโ€‹ๆใชใ‚ใ‚Œใพใ™ใ€‚

IMHO

่ˆˆๅ‘ณๆทฑใ„ใ“ใจใซใ€โ€‹็งใŸใกใฎโ€‹ๆฅญ็•ŒใŒโ€‹UXใ‚ˆใ‚Šใ‚‚โ€‹DXใ‚’โ€‹้‡่ฆ–ใ—ใฆใ„ใ‚‹ใจโ€‹ๅคงใใชโ€‹ๅฃฐใงโ€‹ๅซใ‚“ใงใ„ใ‚‹โ€‹ๅฑคใจใ€โ€‹ใƒ“ใƒซใƒ‰ใƒ„ใƒผใƒซใฎโ€‹ๅปƒๆญขใ‚’โ€‹ๆœ›ใ‚€ๅฑคใฏใ€โ€‹่ฆ‹ไบ‹ใซโ€‹้‡ใชใฃใฆใ„ใพใ™ใ€‚ ใ“ใ‚Œใฏใ€โ€‹ใƒฆใƒผใ‚ถใƒผใซโ€‹ๅฏพใ™ใ‚‹โ€‹็ด”็ฒ‹ใชโ€‹้–ขๅฟƒใจโ€‹ใ„ใ†ใ‚ˆใ‚Šใ‚‚ใ€โ€‹ๅๅฐ„็š„ใซโ€‹ๅใƒ„ใƒผใƒซๅŒ–ใฎโ€‹ใƒžใ‚คใƒณใƒ‰ใ‚ปใƒƒใƒˆใ‹ใ‚‰โ€‹ๆฅใฆใ„ใ‚‹ใจโ€‹็ต่ซ–ใฅใ‘ใ–ใ‚‹ใ‚’โ€‹ๅพ—ใพใ›ใ‚“ใ€‚

IMHO

ใ‚‚ใ†โ€‹1ใคใ€โ€‹ใƒ“ใƒซใƒ‰ใ‚นใƒ†ใƒƒใƒ—ใŒโ€‹ๆœฌๅฝ“ใซโ€‹ๆœ‰็›Šใงใ‚ใ‚‹โ€‹ไพ‹ใ‚’โ€‹็ดนไป‹ใ—ใพใ™ใ€‚ SvelteKitใฎโ€‹ใƒ‰ใ‚ญใƒฅใƒกใƒณใƒ†ใƒผใ‚ทใƒงใƒณๅ†…ใฎโ€‹ใ™ในใฆใฎโ€‹ใ‚ณใƒผใƒ‰ใ‚นใƒ‹ใƒšใƒƒใƒˆใฏใ€โ€‹SvelteKitใฎโ€‹ใ‚ฝใƒผใ‚นใ‚ณใƒผใƒ‰ใซโ€‹ๅฏพใ—ใฆโ€‹ๅž‹ใƒใ‚งใƒƒใ‚ฏใŒโ€‹่กŒใ‚ใ‚Œใฆใ„ใพใ™ใ€‚

ใŸโ€‹ใจใˆใฐใ€โ€‹ใ“ใฎโ€‹ใƒšใƒผใ‚ธใซโ€‹ใ‚ใ‚‹โ€‹ใ‚ณใƒผใƒ‰ใฏโ€‹ใƒ‡ใƒ—ใƒญใ‚คๆ™‚ใซโ€‹ใ‚จใƒฉใƒผใŒโ€‹ใชใ„ใ‹ใ€โ€‹SvelteKit่‡ชไฝ“ใฎโ€‹ๅž‹ใŒโ€‹ๆœ€ๆ–ฐใ‹โ€‹ใฉใ†ใ‹ใƒใ‚งใƒƒใ‚ฏใ•ใ‚Œใพใ™ใ€‚ ใใฎโ€‹ใŸใ‚ใ€โ€‹ใƒ‡ใƒ—ใƒญใ‚คใซใฏโ€‹ใฉใ†ใ—ใฆใ‚‚โ€‹ๆ™‚้–“ใŒโ€‹ใ‹ใ‹ใฃใฆใ—ใพใ„ใพใ™ใ€‚ ใ“ใฎโ€‹M1 MacBook Proใงใฏใ€โ€‹1ใƒšใƒผใ‚ธใฎโ€‹ใƒฌใƒณใƒ€ใƒชใƒณใ‚ฐใซโ€‹ๆ•ฐ็ง’ใ‹ใ‹ใ‚‹โ€‹ใ“ใจใ‚‚ใ‚ใ‚Šใพใ™ใ€‚ ใใ‚Œใงใ‚‚ใ€โ€‹ใ“ใฎโ€‹ใ‚ณใƒณใƒ†ใƒณใƒ„ใ‚’โ€‹ใƒ“ใƒซใƒ‰ๆ™‚ใซโ€‹ไบ‹ๅ‰ใซโ€‹ใƒฌใƒณใƒ€ใƒชใƒณใ‚ฐใ—ใ€โ€‹ไธๆญฃ็ขบใชโ€‹ใƒ‰ใ‚ญใƒฅใƒกใƒณใƒˆใ‚’โ€‹ๅ…ฌ้–‹ใ—ใชใ„ใ‚ˆใ†ใซโ€‹ใ™ใ‚‹โ€‹ใ“ใจใงใ€โ€‹ใ‚ตใ‚คใƒˆใ‚’โ€‹่จชๅ•ใ™ใ‚‹โ€‹ไบบโ€‹ๅ…จๅ“กใŒโ€‹็žฌๆ™‚ใซโ€‹ใ‚ณใƒณใƒ†ใƒณใƒ„ใ‚’โ€‹ๅ–ๅพ—ใงใใ‚‹ใ‚ˆใ†ใซโ€‹ใ—ใฆใ„ใพใ™ใ€‚ ใ‚‚ใ—ใ‚ชใƒณใƒ‡ใƒžใƒณใƒ‰ใงโ€‹ใƒฌใƒณใƒ€ใƒชใƒณใ‚ฐใ‚’โ€‹่กŒใฃใŸโ€‹ๅ ดๅˆใ€โ€‹ใ‚ญใƒฃใƒƒใ‚ทใƒณใ‚ฐใ‚’โ€‹้ ‘ๅผตใฃใŸใจใ—ใฆใ‚‚ใ€โ€‹ใƒšใƒผใ‚ธใฎโ€‹่ชญใฟ่พผใฟใซโ€‹ไฝ•็ง’ใ‚‚โ€‹ๅพ…ใŸใ•ใ‚Œใ‚‹โ€‹ใƒฆใƒผใ‚ถใƒผใŒโ€‹ๅ‡บใฆใใ‚‹ใ“ใจใซใชใ‚Šใพใ™ใ€‚ ใงใ™ใฎใงใ€โ€‹ใƒ“ใƒซใƒ‰ใ‚นใƒ†ใƒƒใƒ—ใฏโ€‹ๅฟ…่ฆใŒโ€‹ใชใ„ใ‹ใ‚‚ใ—ใ‚Œใพใ›ใ‚“ใŒใ€โ€‹ใใ‚Œใงใ‚‚โ€‹ใŠใใ‚‰ใโ€‹ๅฟ…่ฆใงใ™ใ€‚

ใถใฃใกใ‚ƒใ‘ใฉใ†ใงใ‚‚โ€‹ใ„ใ„โ€‹ None of this matters (๐ŸŒถ๐ŸŒถ๐ŸŒถ๐ŸŒถ)

ๅŽŸๆ–‡

Okay, my final take of the evening is that none of this matters. I donโ€™t think AI is going to take all our jobs, but I do think thereโ€™s a better than even chance that it is going to change them beyond all recognition. Might not be long before talking about these sorts of code preferences feel like talking about what implement you want to use to make holes in your punch cards. So for the few weeks in which any of this is still relevant, letโ€™s have interesting debates and share our ideas, but letโ€™s not take ourselves too seriously. And letโ€™s have fun building stuff whatever we like to build stuff! That is my time. Thank you for hearing me.

IMHO

ใ•ใฆใ€โ€‹ไปŠๅคœโ€‹็งใŒโ€‹ๆœ€ๅพŒใซโ€‹่จ€ใ„ใŸใ„โ€‹ใ“ใจใฏใ€โ€‹ใ€Œใถใฃใกใ‚ƒใ‘ใ“ใ‚“ใชใฎใฏโ€‹ใฉใ†ใงใ‚‚โ€‹่‰ฏใ„๏ผใ€ใงใ™ใ€‚

IMHO

็งใฏใ€โ€‹AIใŒโ€‹ๅ…จใฆใฎโ€‹ไป•ไบ‹ใ‚’โ€‹ๅฅชใ†ใจใฏโ€‹ๆ€ใ„ใพใ›ใ‚“ใŒใ€โ€‹AIใŒโ€‹็งใŸใกใฎโ€‹ไป•ไบ‹ใ‚’โ€‹ใ‚ฌใƒฉใƒชใจโ€‹ๅค‰ใˆใฆใ—ใพใ†โ€‹ๅฏ่ƒฝๆ€งใฏโ€‹ๅไบŒๅˆ†ใซโ€‹ใ‚ใ‚‹ใ€ใจโ€‹่€ƒใˆใฆใ„ใพใ™ใ€‚

ใชใฎใงใ€โ€‹ใ“ใฎโ€‹็จฎใฎโ€‹ใ‚ณใƒผใƒ‰็’ฐๅขƒใซโ€‹ใคใ„ใฆโ€‹่ฉฑใ™ใ“ใจใŒใ€โ€‹ใƒ‘ใƒณใƒใ‚ซใƒผใƒ‰ใซโ€‹็ฉดใ‚’โ€‹ใ‚ใ‘ใ‚‹โ€‹ใŸใ‚ใซโ€‹ใฉใ‚“ใชโ€‹้“ๅ…ทใ‚’โ€‹ไฝฟใ†ใ‹ใซโ€‹ใคใ„ใฆโ€‹่ฉฑใ™ใ‚ˆใ†ใชโ€‹ๆ„Ÿใ˜ใซโ€‹ใชใ‚‹ใฎใ‚‚ใ€โ€‹ใใ†โ€‹้ ใใชใ„ใ‹ใ‚‚ใ—ใ‚Œใชใ„ใงใ™ใญใ€‚ ใงใ™ใ‹ใ‚‰ใ€โ€‹ใ“ใฎโ€‹AIใƒ–ใƒผใƒ ใฎโ€‹ๆ•ฐ้€ฑ้–“ใ€โ€‹้ข็™ฝใ„โ€‹่ญฐ่ซ–ใ‚’โ€‹ใ—ใฆใ€โ€‹ใ‚ขใ‚คใƒ‡ใ‚ขใ‚’โ€‹ๅ…ฑๆœ‰ใ—ใฆโ€‹ไธ‹ใ•ใ„ใ€‚ ใ‚ใพใ‚Šโ€‹ๆ€ใ„โ€‹่ฉฐใ‚ใชใ„ใงใใ ใ•ใ„ใ€‚

ใ‚‚ใฎโ€‹ใฅใใ‚Šใ‚’โ€‹ๆฅฝใ—ใ‚‚ใ†๏ผ

ใ”ๆธ…่ดโ€‹ใ‚ใ‚ŠใŒใจใ†โ€‹ใ”ใ–ใ„ใพใ—ใŸใ€‚

comment on bluesky / twitter
CC BY-NC-SA 4.0 2022-PRESENT ยฉ ryoppippi