@csedl/svelte-on-rails 0.0.8 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/package.json +1 -1
- package/src/initializeSvelteComponents.js +2 -2
package/README.md
CHANGED
|
@@ -36,8 +36,8 @@ document.addEventListener('turbo:before-cache', () => {
|
|
|
36
36
|
});
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
- The last boolean argument is for debugging logs to the console
|
|
40
|
-
- I have inserted very detailed error logs
|
|
39
|
+
- The last boolean argument is for debugging logs to the browser console
|
|
40
|
+
- I also have inserted very detailed error logs.
|
|
41
41
|
|
|
42
42
|
## How it works
|
|
43
43
|
|
package/package.json
CHANGED
|
@@ -11,9 +11,9 @@ const svelteInstances = new WeakMap();
|
|
|
11
11
|
* @param {boolean} debug - Enable debug logging
|
|
12
12
|
*/
|
|
13
13
|
export function initializeSvelteComponents(componentsRoot, components, debug = false) {
|
|
14
|
-
const virginClass = 'svelte-on-rails
|
|
14
|
+
const virginClass = 'please-hydrate-me-svelte-on-rails';
|
|
15
15
|
const virginElements = document.getElementsByClassName(virginClass);
|
|
16
|
-
debugLog(`Found ${virginElements.length} elements with class
|
|
16
|
+
debugLog(`Found ${virginElements.length} elements with class «${virginClass}»`, debug);
|
|
17
17
|
if (virginElements.length === 0) return;
|
|
18
18
|
|
|
19
19
|
// Convert live HTMLCollection to a static array
|