@csedl/svelte-on-rails 0.0.9 → 0.0.11
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/package.json
CHANGED
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@csedl/svelte-on-rails",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "Hydrates or mounts
|
|
3
|
+
"version": "0.0.11",
|
|
4
|
+
"description": "Hydrates or mounts Svelte components rendered by the svelte-on-rails Ruby gem and holds the peer dependencies necessary for the gems server-side-rendering.",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"exports": {
|
|
7
8
|
".": "./index.js"
|
|
8
9
|
},
|
|
10
|
+
"peerDependencies": {
|
|
11
|
+
"svelte": "^5.25.12",
|
|
12
|
+
"svelte-preprocess": "^6.0.3",
|
|
13
|
+
"pug": "^3.0.3",
|
|
14
|
+
"typescript": "^5.8.3",
|
|
15
|
+
"rollup": "^4.39.0",
|
|
16
|
+
"rollup-plugin-svelte": "^7.2.2",
|
|
17
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
18
|
+
"@rollup/plugin-commonjs": "^28.0.3",
|
|
19
|
+
"@rollup/plugin-url": "^8.0.2",
|
|
20
|
+
"rollup-plugin-css-only": "^4.5.2",
|
|
21
|
+
"rollup-plugin-string": "^3.0.0"
|
|
22
|
+
},
|
|
9
23
|
"scripts": {
|
|
10
24
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
11
25
|
},
|
|
@@ -15,12 +29,13 @@
|
|
|
15
29
|
},
|
|
16
30
|
"keywords": [
|
|
17
31
|
"svelte",
|
|
18
|
-
"rails"
|
|
32
|
+
"rails",
|
|
33
|
+
"ssr"
|
|
19
34
|
],
|
|
20
35
|
"author": "Christian Sedlmair",
|
|
21
36
|
"license": "MIT",
|
|
22
37
|
"bugs": {
|
|
23
|
-
"url": ""
|
|
38
|
+
"url": "https://gitlab.com/sedl/csedl-svelte-on-rails/-/issues"
|
|
24
39
|
},
|
|
25
40
|
"homepage": "https://gitlab.com/sedl/csedl-svelte-on-rails"
|
|
26
|
-
}
|
|
41
|
+
}
|
|
@@ -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
|