A music player that connects to your cloud/distributed storage.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: explain cross-origin usage

+26 -7
+26 -7
src/pages/index.astro
··· 213 213 <List items={demos} /> 214 214 </section> 215 215 216 + <!-- CROSS-ORIGIN --> 217 + <section> 218 + <h2 id="cross-origin">Cross-Origin</h2> 219 + 220 + <p> 221 + You can use applets from different origins. However, one important caveat to remember is <a 222 + href="https://developer.mozilla.org/en-US/docs/Web/Privacy/Guides/State_Partitioning#state_partitioning" 223 + >state partitioning</a 224 + >. This causes local state (eg. IndexedDB) to be different when the applet is used on a 225 + different domain versus using the applet directly. There might be ways around state 226 + partitioning, but I haven't found a user-friendly way of doing so. 227 + </p> 228 + 229 + <p> 230 + <strong 231 + >That said, there isn't that much local state that needs to be shared cross origin.</strong 232 + > Much of it is associated with the input applets and that configuration is saved in your chosen 233 + output applet. So essentially, state partitioning behaves as if the two domains are on different 234 + devices; so using an output applet to sync data works nicely. 235 + </p> 236 + </section> 237 + 216 238 <!-- BUILD YOUR OWN --> 217 239 <section> 218 240 <h2 id="yours">Build your own</h2> ··· 224 246 225 247 <ul> 226 248 <li> 227 - Haven't tested this idea cross-origin. No idea if the applets work when included on a 228 - different origin (though it should). 229 - </li> 230 - <li> 231 - Currently using a fork of the web applets SDK that adds a few features (waiting on PRs). 232 - Meaning that it won't be as easy to write your own applets in the same way as done here. 249 + This is currently using a fork of the web applets SDK that adds a few features (waiting on 250 + PRs). Meaning that it won't be as easy to write your own applets in the same way as done 251 + here. 233 252 </li> 234 253 <li> 235 254 I wrote some custom code on top of the web applets SDK that makes the applets talk to each ··· 237 256 web applets SDK. Though you can just copy-paste from the Diffuse repo if you want (it's 238 257 not that much code). 239 258 </li> 240 - <li><em>... Probably a bunch of stuff I'm forgetting, teaching materials, ...</em></li> 259 + <li><em>... Probably a bunch of stuff I'm forgetting, teaching materials, etc ...</em></li> 241 260 </ul> 242 261 </section> 243 262 </main>