I want to collect some feedback with regards to the element id namespacing and the general approach to access these JSON blobs. document.getElementById().innerHTML is used here but there are many options to select them(ids, classes, data attributes).
I'd also like to talk about line 45 and its surroundings now, which is pretty dirty. Doing what is basically abstracted eval'ing(but I didn't want to include this change immediately):
This is the proof of concept fix for #121
I want to collect some feedback with regards to the element id namespacing and the general approach to access these JSON blobs.
document.getElementById().innerHTML
is used here but there are many options to select them(ids, classes, data attributes).I'd also like to talk about line 45 and its surroundings now, which is pretty dirty. Doing what is basically abstracted
eval
'ing(but I didn't want to include this change immediately):My suggestion is to replace this script tag with another JSON blob containing our keys and moving all the window rehydration logic over into
kit/entry/browser.js
, check out my approach to that over at https://github.com/klarstrup/kit/compare/json-window...klarstrup:json-window-clean?expand=1 and tell me what you think.