crelte 0.5.3 → 0.5.5

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.
@@ -20,10 +20,10 @@ export default class SsrComponents {
20
20
  let head = '';
21
21
  for (const req of requirements) {
22
22
  if (req.endsWith('.js')) {
23
- head += `\n\t\t<link rel="preload" href="${req}" as="script">`;
23
+ head += `\n\t\t<link rel="modulepreload" crossorigin href="${req}">`;
24
24
  }
25
25
  else if (req.endsWith('.css')) {
26
- head += `\n\t\t<link rel="stylesheet" href="${req}">`;
26
+ head += `\n\t\t<link rel="stylesheet" crossorigin href="${req}">`;
27
27
  }
28
28
  }
29
29
  return head;
@@ -24,12 +24,12 @@ function usedSsrComponents(code, id, options, svelte5) {
24
24
  if (svelte5) {
25
25
  // this will not catch all cases, but it should be enough
26
26
  // since almost all components will have props
27
- const initFnSign = '($$payload, $$props) {';
27
+ const initFnSign = '($$renderer, $$props) {';
28
28
  idx = code.indexOf(initFnSign);
29
29
  if (idx < 0)
30
30
  return;
31
- const pushSign = '$.push(';
32
- idx = code.indexOf(pushSign, idx);
31
+ const renderCompSign = '$$renderer.component(($$renderer) => {';
32
+ idx = code.indexOf(renderCompSign, idx);
33
33
  if (idx < 0)
34
34
  return;
35
35
  // Find the end of the line where the pattern was found
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crelte",
3
- "version": "0.5.3",
3
+ "version": "0.5.5",
4
4
  "author": "Crelte <support@crelte.com>",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -102,7 +102,7 @@
102
102
  "trouter": "^4.0.0"
103
103
  },
104
104
  "peerDependencies": {
105
- "svelte": "^4.0.0 || ^5.0.0",
105
+ "svelte": "^4.0.0 || ^5.39.1",
106
106
  "vite": "^5.0.0 || ^6.0.0"
107
107
  },
108
108
  "devDependencies": {
@@ -24,9 +24,9 @@ export default class SsrComponents {
24
24
  let head = '';
25
25
  for (const req of requirements) {
26
26
  if (req.endsWith('.js')) {
27
- head += `\n\t\t<link rel="preload" href="${req}" as="script">`;
27
+ head += `\n\t\t<link rel="modulepreload" crossorigin href="${req}">`;
28
28
  } else if (req.endsWith('.css')) {
29
- head += `\n\t\t<link rel="stylesheet" href="${req}">`;
29
+ head += `\n\t\t<link rel="stylesheet" crossorigin href="${req}">`;
30
30
  }
31
31
  }
32
32
 
package/src/vite/index.ts CHANGED
@@ -50,12 +50,12 @@ function usedSsrComponents(
50
50
  if (svelte5) {
51
51
  // this will not catch all cases, but it should be enough
52
52
  // since almost all components will have props
53
- const initFnSign = '($$payload, $$props) {';
53
+ const initFnSign = '($$renderer, $$props) {';
54
54
  idx = code.indexOf(initFnSign);
55
55
  if (idx < 0) return;
56
56
 
57
- const pushSign = '$.push(';
58
- idx = code.indexOf(pushSign, idx);
57
+ const renderCompSign = '$$renderer.component(($$renderer) => {';
58
+ idx = code.indexOf(renderCompSign, idx);
59
59
  if (idx < 0) return;
60
60
 
61
61
  // Find the end of the line where the pattern was found