@solidjs/start 2.0.0-alpha.0 → 2.0.0-alpha.2

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.
Files changed (108) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/client/mount.d.ts +1 -7
  3. package/dist/client/mount.js +1 -99
  4. package/dist/config/constants.js +2 -2
  5. package/dist/config/dev-server.js +10 -0
  6. package/dist/config/fs-router.js +10 -22
  7. package/dist/config/fs-routes/fs-watcher.js +4 -4
  8. package/dist/config/fs-routes/index.js +4 -6
  9. package/dist/config/fs-routes/router.js +10 -11
  10. package/dist/config/fs-routes/tree-shake.js +12 -21
  11. package/dist/config/index.js +42 -42
  12. package/dist/config/lazy.js +42 -12
  13. package/dist/config/manifest.js +4 -3
  14. package/dist/config/vite-utils.d.ts +5 -0
  15. package/dist/config/vite-utils.js +7 -3
  16. package/dist/http/index.d.ts +1 -4
  17. package/dist/http/index.js +3 -5
  18. package/dist/index.d.ts +0 -1
  19. package/dist/middleware/index.d.ts +5 -2
  20. package/dist/middleware/index.js +6 -1
  21. package/dist/router.jsx +2 -2
  22. package/dist/server/StartServer.jsx +2 -0
  23. package/dist/server/assets/PatchVirtualDevStyles.d.ts +4 -0
  24. package/dist/server/assets/PatchVirtualDevStyles.jsx +28 -0
  25. package/dist/server/assets/index.js +1 -1
  26. package/dist/server/assets/render.jsx +2 -2
  27. package/dist/server/collect-styles.js +9 -21
  28. package/dist/server/fetchEvent.spec.js +1 -1
  29. package/dist/server/handler.js +30 -15
  30. package/dist/server/index.d.ts +1 -0
  31. package/dist/server/manifest/dev-client-manifest.js +1 -1
  32. package/dist/server/manifest/dev-ssr-manifest.js +1 -1
  33. package/dist/server/manifest/prod-ssr-manifest.js +7 -12
  34. package/dist/server/routes.js +3 -3
  35. package/dist/server/server-fns-runtime.js +2 -2
  36. package/dist/server/server-functions-handler.js +6 -11
  37. package/dist/server/server-runtime.js +8 -8
  38. package/dist/server/spa/StartServer.jsx +2 -0
  39. package/dist/shared/dev-overlay/CodeView.d.ts +1 -1
  40. package/dist/shared/dev-overlay/CodeView.jsx +23 -34
  41. package/dist/shared/dev-overlay/DevOverlayDialog.jsx +4 -4
  42. package/dist/shared/dev-overlay/get-source-map.d.ts +1 -1
  43. package/dist/shared/dev-overlay/get-source-map.js +5 -5
  44. package/dist/shared/dev-overlay/icons.d.ts +10 -10
  45. package/dist/shared/dev-overlay/icons.jsx +91 -91
  46. package/dist/shared/dev-overlay/index.jsx +1 -1
  47. package/dist/shared/lazy.js +4 -2
  48. package/env.d.ts +9 -0
  49. package/package.json +5 -4
  50. package/scripts/build.js +3 -3
  51. package/scripts/validate-imports.js +8 -8
  52. package/src/client/mount.ts +1 -114
  53. package/src/config/constants.ts +3 -3
  54. package/src/config/dev-server.ts +107 -99
  55. package/src/config/fs-router.ts +140 -155
  56. package/src/config/fs-routes/fs-watcher.ts +57 -61
  57. package/src/config/fs-routes/index.ts +117 -119
  58. package/src/config/fs-routes/router.ts +12 -13
  59. package/src/config/fs-routes/tree-shake.ts +342 -363
  60. package/src/config/index.ts +42 -43
  61. package/src/config/lazy.ts +47 -16
  62. package/src/config/manifest.ts +8 -7
  63. package/src/config/vite-utils.ts +9 -9
  64. package/src/env.d.ts +10 -28
  65. package/src/http/index.ts +105 -142
  66. package/src/index.tsx +0 -12
  67. package/src/internal.d.ts +1 -1
  68. package/src/middleware/index.ts +42 -49
  69. package/src/router.tsx +4 -3
  70. package/src/server/StartServer.tsx +3 -7
  71. package/src/server/assets/PatchVirtualDevStyles.tsx +31 -0
  72. package/src/server/assets/index.ts +1 -1
  73. package/src/server/assets/render.tsx +6 -2
  74. package/src/server/collect-styles.ts +49 -73
  75. package/src/server/fetchEvent.spec.ts +71 -75
  76. package/src/server/fetchEvent.ts +17 -17
  77. package/src/server/handler.ts +138 -129
  78. package/src/server/index.tsx +13 -0
  79. package/src/server/manifest/client-manifest.ts +1 -1
  80. package/src/server/manifest/dev-client-manifest.ts +7 -5
  81. package/src/server/manifest/dev-ssr-manifest.ts +8 -6
  82. package/src/server/manifest/prod-client-manifest.ts +7 -4
  83. package/src/server/manifest/prod-ssr-manifest.ts +78 -94
  84. package/src/server/manifest/ssr-manifest.ts +4 -2
  85. package/src/server/routes.ts +96 -108
  86. package/src/server/server-fns-runtime.ts +3 -3
  87. package/src/server/server-functions-handler.ts +294 -319
  88. package/src/server/server-runtime.ts +13 -13
  89. package/src/server/spa/StartServer.tsx +2 -0
  90. package/src/server/spa/handler.ts +12 -12
  91. package/src/server/types.ts +46 -46
  92. package/src/server/util.ts +4 -4
  93. package/src/shared/ErrorBoundary.tsx +1 -1
  94. package/src/shared/HttpHeader.tsx +20 -20
  95. package/src/shared/HttpStatusCode.ts +14 -14
  96. package/src/shared/clientOnly.ts +3 -3
  97. package/src/shared/dev-overlay/CodeView.tsx +43 -46
  98. package/src/shared/dev-overlay/DevOverlayDialog.tsx +4 -4
  99. package/src/shared/dev-overlay/createStackFrame.ts +59 -62
  100. package/src/shared/dev-overlay/env.d.ts +2 -2
  101. package/src/shared/dev-overlay/get-source-map.ts +5 -7
  102. package/src/shared/dev-overlay/icons.tsx +289 -121
  103. package/src/shared/dev-overlay/index.tsx +1 -1
  104. package/src/shared/lazy.ts +4 -3
  105. package/src/shared/serverFunction.ts +1 -1
  106. package/src/virtual.d.ts +10 -10
  107. package/tsconfig.json +2 -2
  108. package/vitest.config.ts +2 -2
@@ -52,99 +52,99 @@ export function SolidStartIcon(props) {
52
52
  return (<svg viewBox="0 0 701 701" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
53
53
  <title>{props.title}</title>
54
54
  <g filter="url(#filter0_d_1_2)">
55
- <rect width="693" height="693" transform="translate(4)" fill="white"/>
56
- <mask id="mask0_1_2" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="323" y="556" width="174" height="72">
57
- <path d="M323.508 627.978L435.81 619.384C435.81 619.384 474.315 613.168 496.842 576.082L417.413 556.809L323.508 627.978Z" fill="white"/>
58
- </mask>
59
- <g mask="url(#mask0_1_2)">
60
- <path d="M510.734 559.645L490 661.769L309.658 625.183L330.349 523.018L510.734 559.645Z" fill="url(#paint0_linear_1_2)"/>
61
- </g>
62
- <mask id="mask1_1_2" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="73" y="364" width="424" height="220">
63
- <path d="M168.488 364.785C135.031 366.371 73.2477 372.295 73.2477 372.295L342.489 567.989L403.813 583.341L496.884 576.124L225.974 380.096C225.974 380.096 204.072 364.66 172.91 364.66C171.491 364.66 169.989 364.702 168.488 364.785Z" fill="white"/>
64
- </mask>
65
- <g mask="url(#mask1_1_2)">
66
- <path d="M192.016 773.57L-24.954 425.942L378.115 174.389L595.085 522.017L192.016 773.57Z" fill="url(#paint1_linear_1_2)"/>
67
- </g>
68
- <mask id="mask2_1_2" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="515" y="255" width="179" height="71">
69
- <path d="M515.573 325.822L631.254 318.688C631.254 318.688 670.885 312.931 693.621 275.928L611.438 255.487L515.573 325.822Z" fill="white"/>
70
- </mask>
71
- <g mask="url(#mask2_1_2)">
72
- <path d="M557.832 401.58L485.62 272.174L651.32 179.729L723.532 309.135L557.832 401.58Z" fill="url(#paint2_linear_1_2)"/>
73
- </g>
74
- <mask id="mask3_1_2" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="254" y="59" width="440" height="223">
75
- <path d="M352.251 59.0417C317.751 60.1681 254.132 65.2993 254.132 65.2993L534.345 265.666L597.755 281.936L693.621 275.928L411.697 75.2279C411.697 75.2279 388.294 59 355.505 59C354.42 59 353.335 59 352.251 59.0417Z" fill="white"/>
76
- </mask>
77
- <g mask="url(#mask3_1_2)">
78
- <path d="M623.161 -102.236L775.386 246.226L324.592 443.172L172.325 94.7097L623.161 -102.236Z" fill="url(#paint3_linear_1_2)"/>
79
- </g>
80
- <mask id="mask4_1_2" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="6" y="371" width="396" height="257">
81
- <path d="M6.62575 415.555C6.41717 415.889 6.20858 416.264 6 416.64L79.6305 469.912L153.261 523.185L275.909 611.917C317.125 641.744 373.318 628.895 401.393 583.215L326.762 529.234L252.13 475.252L130.483 387.229C115.632 376.508 98.8203 371.377 82.1335 371.377C53.0567 371.335 24.272 386.895 6.62575 415.555Z" fill="white"/>
82
- </mask>
83
- <g mask="url(#mask4_1_2)">
84
- <path d="M529.756 464.03L265.855 829.387L-122.321 549.008L141.538 183.65L529.756 464.03Z" fill="url(#paint4_linear_1_2)"/>
85
- </g>
86
- <mask id="mask5_1_2" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="187" y="64" width="411" height="263">
87
- <path d="M188.47 108.101C188.261 108.476 188.053 108.81 187.844 109.186L264.478 163.751L341.112 218.317L468.725 309.177C511.61 339.714 569.388 327.532 597.755 281.977L520.078 226.661L442.401 171.386L315.832 81.2352C300.063 70.0133 282.25 64.6318 264.645 64.6318C235.026 64.6318 206.074 79.9002 188.47 108.101Z" fill="white"/>
88
- </mask>
89
- <g mask="url(#mask5_1_2)">
90
- <path d="M685.945 96.6704L550.031 471.164L99.6544 307.675L235.527 -66.8184L685.945 96.6704Z" fill="url(#paint5_linear_1_2)"/>
91
- </g>
92
- <mask id="mask6_1_2" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="134" y="164" width="419" height="344">
93
- <path d="M134.363 170.051L233.149 278.64C237.571 284.856 242.744 290.571 248.626 295.66L441.567 507.791L537.432 501.784C565.8 456.229 554.036 394.53 511.151 363.993L383.539 273.133L306.863 218.567L230.229 164.002L134.363 170.051Z" fill="white"/>
94
- </mask>
95
- <g mask="url(#mask6_1_2)">
96
- <path d="M291.886 715.5L-31.1699 289.528L408.235 -43.7072L731.291 382.265L291.886 715.5Z" fill="url(#paint6_linear_1_2)"/>
97
- </g>
98
- <mask id="mask7_1_2" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="118" y="170" width="340" height="338">
99
- <path d="M133.696 171.094C105.703 216.065 117.301 276.971 159.644 307.091L286.255 397.241L363.932 452.516L441.609 507.791C469.976 462.236 458.212 400.537 415.327 370L287.631 279.141L210.997 224.575L134.363 170.051C134.154 170.384 133.904 170.718 133.696 171.094Z" fill="white"/>
100
- </mask>
101
- <g mask="url(#mask7_1_2)">
102
- <path d="M606.057 239.009L395.553 654.635L-30.4607 438.833L180.043 23.2069L606.057 239.009Z" fill="url(#paint7_linear_1_2)"/>
103
- </g>
55
+ <rect width="693" height="693" transform="translate(4)" fill="white"/>
56
+ <mask id="mask0_1_2" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="323" y="556" width="174" height="72">
57
+ <path d="M323.508 627.978L435.81 619.384C435.81 619.384 474.315 613.168 496.842 576.082L417.413 556.809L323.508 627.978Z" fill="white"/>
58
+ </mask>
59
+ <g mask="url(#mask0_1_2)">
60
+ <path d="M510.734 559.645L490 661.769L309.658 625.183L330.349 523.018L510.734 559.645Z" fill="url(#paint0_linear_1_2)"/>
61
+ </g>
62
+ <mask id="mask1_1_2" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="73" y="364" width="424" height="220">
63
+ <path d="M168.488 364.785C135.031 366.371 73.2477 372.295 73.2477 372.295L342.489 567.989L403.813 583.341L496.884 576.124L225.974 380.096C225.974 380.096 204.072 364.66 172.91 364.66C171.491 364.66 169.989 364.702 168.488 364.785Z" fill="white"/>
64
+ </mask>
65
+ <g mask="url(#mask1_1_2)">
66
+ <path d="M192.016 773.57L-24.954 425.942L378.115 174.389L595.085 522.017L192.016 773.57Z" fill="url(#paint1_linear_1_2)"/>
67
+ </g>
68
+ <mask id="mask2_1_2" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="515" y="255" width="179" height="71">
69
+ <path d="M515.573 325.822L631.254 318.688C631.254 318.688 670.885 312.931 693.621 275.928L611.438 255.487L515.573 325.822Z" fill="white"/>
70
+ </mask>
71
+ <g mask="url(#mask2_1_2)">
72
+ <path d="M557.832 401.58L485.62 272.174L651.32 179.729L723.532 309.135L557.832 401.58Z" fill="url(#paint2_linear_1_2)"/>
73
+ </g>
74
+ <mask id="mask3_1_2" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="254" y="59" width="440" height="223">
75
+ <path d="M352.251 59.0417C317.751 60.1681 254.132 65.2993 254.132 65.2993L534.345 265.666L597.755 281.936L693.621 275.928L411.697 75.2279C411.697 75.2279 388.294 59 355.505 59C354.42 59 353.335 59 352.251 59.0417Z" fill="white"/>
76
+ </mask>
77
+ <g mask="url(#mask3_1_2)">
78
+ <path d="M623.161 -102.236L775.386 246.226L324.592 443.172L172.325 94.7097L623.161 -102.236Z" fill="url(#paint3_linear_1_2)"/>
79
+ </g>
80
+ <mask id="mask4_1_2" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="6" y="371" width="396" height="257">
81
+ <path d="M6.62575 415.555C6.41717 415.889 6.20858 416.264 6 416.64L79.6305 469.912L153.261 523.185L275.909 611.917C317.125 641.744 373.318 628.895 401.393 583.215L326.762 529.234L252.13 475.252L130.483 387.229C115.632 376.508 98.8203 371.377 82.1335 371.377C53.0567 371.335 24.272 386.895 6.62575 415.555Z" fill="white"/>
82
+ </mask>
83
+ <g mask="url(#mask4_1_2)">
84
+ <path d="M529.756 464.03L265.855 829.387L-122.321 549.008L141.538 183.65L529.756 464.03Z" fill="url(#paint4_linear_1_2)"/>
85
+ </g>
86
+ <mask id="mask5_1_2" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="187" y="64" width="411" height="263">
87
+ <path d="M188.47 108.101C188.261 108.476 188.053 108.81 187.844 109.186L264.478 163.751L341.112 218.317L468.725 309.177C511.61 339.714 569.388 327.532 597.755 281.977L520.078 226.661L442.401 171.386L315.832 81.2352C300.063 70.0133 282.25 64.6318 264.645 64.6318C235.026 64.6318 206.074 79.9002 188.47 108.101Z" fill="white"/>
88
+ </mask>
89
+ <g mask="url(#mask5_1_2)">
90
+ <path d="M685.945 96.6704L550.031 471.164L99.6544 307.675L235.527 -66.8184L685.945 96.6704Z" fill="url(#paint5_linear_1_2)"/>
91
+ </g>
92
+ <mask id="mask6_1_2" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="134" y="164" width="419" height="344">
93
+ <path d="M134.363 170.051L233.149 278.64C237.571 284.856 242.744 290.571 248.626 295.66L441.567 507.791L537.432 501.784C565.8 456.229 554.036 394.53 511.151 363.993L383.539 273.133L306.863 218.567L230.229 164.002L134.363 170.051Z" fill="white"/>
94
+ </mask>
95
+ <g mask="url(#mask6_1_2)">
96
+ <path d="M291.886 715.5L-31.1699 289.528L408.235 -43.7072L731.291 382.265L291.886 715.5Z" fill="url(#paint6_linear_1_2)"/>
97
+ </g>
98
+ <mask id="mask7_1_2" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="118" y="170" width="340" height="338">
99
+ <path d="M133.696 171.094C105.703 216.065 117.301 276.971 159.644 307.091L286.255 397.241L363.932 452.516L441.609 507.791C469.976 462.236 458.212 400.537 415.327 370L287.631 279.141L210.997 224.575L134.363 170.051C134.154 170.384 133.904 170.718 133.696 171.094Z" fill="white"/>
100
+ </mask>
101
+ <g mask="url(#mask7_1_2)">
102
+ <path d="M606.057 239.009L395.553 654.635L-30.4607 438.833L180.043 23.2069L606.057 239.009Z" fill="url(#paint7_linear_1_2)"/>
103
+ </g>
104
104
  </g>
105
105
  <defs>
106
- <filter id="filter0_d_1_2" x="0" y="0" width="701" height="701" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
107
- <feFlood flood-opacity="0" result="BackgroundImageFix"/>
108
- <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
109
- <feOffset dy="4"/>
110
- <feGaussianBlur stdDeviation="2"/>
111
- <feComposite in2="hardAlpha" operator="out"/>
112
- <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
113
- <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1_2"/>
114
- <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1_2" result="shape"/>
115
- </filter>
116
- <linearGradient id="paint0_linear_1_2" x1="522.269" y1="40.5341" x2="374.272" y2="769.949" gradientUnits="userSpaceOnUse">
117
- <stop stop-color="#1593F5"/>
118
- <stop offset="1" stop-color="#0084CE"/>
119
- </linearGradient>
120
- <linearGradient id="paint1_linear_1_2" x1="507.729" y1="830.625" x2="-112.45" y2="-163.072" gradientUnits="userSpaceOnUse">
121
- <stop stop-color="#1593F5"/>
122
- <stop offset="1" stop-color="#0084CE"/>
123
- </linearGradient>
124
- <linearGradient id="paint2_linear_1_2" x1="915.255" y1="847.35" x2="541.738" y2="177.838" gradientUnits="userSpaceOnUse">
125
- <stop stop-color="white"/>
126
- <stop offset="1" stop-color="#15ABFF"/>
127
- </linearGradient>
128
- <linearGradient id="paint3_linear_1_2" x1="254.189" y1="-332.587" x2="571.326" y2="393.304" gradientUnits="userSpaceOnUse">
129
- <stop stop-color="white"/>
130
- <stop offset="1" stop-color="#79CFFF"/>
131
- </linearGradient>
132
- <linearGradient id="paint4_linear_1_2" x1="610.213" y1="-56.2573" x2="106.317" y2="641.444" gradientUnits="userSpaceOnUse">
133
- <stop stop-color="#0057E5"/>
134
- <stop offset="1" stop-color="#0084CE"/>
135
- </linearGradient>
136
- <linearGradient id="paint5_linear_1_2" x1="496.212" y1="-82.6564" x2="337.643" y2="354.288" gradientUnits="userSpaceOnUse">
137
- <stop stop-color="white"/>
138
- <stop offset="1" stop-color="#15ABFF"/>
139
- </linearGradient>
140
- <linearGradient id="paint6_linear_1_2" x1="693.692" y1="789.133" x2="-102.675" y2="-260.944" gradientUnits="userSpaceOnUse">
141
- <stop stop-color="white"/>
142
- <stop offset="1" stop-color="#79CFFF"/>
143
- </linearGradient>
144
- <linearGradient id="paint7_linear_1_2" x1="555.118" y1="-188.777" x2="146.363" y2="618.161" gradientUnits="userSpaceOnUse">
145
- <stop stop-color="white"/>
146
- <stop offset="1" stop-color="#79CFFF"/>
147
- </linearGradient>
106
+ <filter id="filter0_d_1_2" x="0" y="0" width="701" height="701" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
107
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
108
+ <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
109
+ <feOffset dy="4"/>
110
+ <feGaussianBlur stdDeviation="2"/>
111
+ <feComposite in2="hardAlpha" operator="out"/>
112
+ <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
113
+ <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1_2"/>
114
+ <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1_2" result="shape"/>
115
+ </filter>
116
+ <linearGradient id="paint0_linear_1_2" x1="522.269" y1="40.5341" x2="374.272" y2="769.949" gradientUnits="userSpaceOnUse">
117
+ <stop stop-color="#1593F5"/>
118
+ <stop offset="1" stop-color="#0084CE"/>
119
+ </linearGradient>
120
+ <linearGradient id="paint1_linear_1_2" x1="507.729" y1="830.625" x2="-112.45" y2="-163.072" gradientUnits="userSpaceOnUse">
121
+ <stop stop-color="#1593F5"/>
122
+ <stop offset="1" stop-color="#0084CE"/>
123
+ </linearGradient>
124
+ <linearGradient id="paint2_linear_1_2" x1="915.255" y1="847.35" x2="541.738" y2="177.838" gradientUnits="userSpaceOnUse">
125
+ <stop stop-color="white"/>
126
+ <stop offset="1" stop-color="#15ABFF"/>
127
+ </linearGradient>
128
+ <linearGradient id="paint3_linear_1_2" x1="254.189" y1="-332.587" x2="571.326" y2="393.304" gradientUnits="userSpaceOnUse">
129
+ <stop stop-color="white"/>
130
+ <stop offset="1" stop-color="#79CFFF"/>
131
+ </linearGradient>
132
+ <linearGradient id="paint4_linear_1_2" x1="610.213" y1="-56.2573" x2="106.317" y2="641.444" gradientUnits="userSpaceOnUse">
133
+ <stop stop-color="#0057E5"/>
134
+ <stop offset="1" stop-color="#0084CE"/>
135
+ </linearGradient>
136
+ <linearGradient id="paint5_linear_1_2" x1="496.212" y1="-82.6564" x2="337.643" y2="354.288" gradientUnits="userSpaceOnUse">
137
+ <stop stop-color="white"/>
138
+ <stop offset="1" stop-color="#15ABFF"/>
139
+ </linearGradient>
140
+ <linearGradient id="paint6_linear_1_2" x1="693.692" y1="789.133" x2="-102.675" y2="-260.944" gradientUnits="userSpaceOnUse">
141
+ <stop stop-color="white"/>
142
+ <stop offset="1" stop-color="#79CFFF"/>
143
+ </linearGradient>
144
+ <linearGradient id="paint7_linear_1_2" x1="555.118" y1="-188.777" x2="146.363" y2="618.161" gradientUnits="userSpaceOnUse">
145
+ <stop stop-color="white"/>
146
+ <stop offset="1" stop-color="#79CFFF"/>
147
+ </linearGradient>
148
148
  </defs>
149
149
  </svg>);
150
150
  }
@@ -1,5 +1,5 @@
1
1
  // @refresh skip
2
- import { ErrorBoundary, Show, createEffect, createSignal, onCleanup, resetErrorBoundaries } from "solid-js";
2
+ import { ErrorBoundary, Show, createEffect, createSignal, onCleanup, resetErrorBoundaries, } from "solid-js";
3
3
  import { HttpStatusCode } from "../HttpStatusCode.js";
4
4
  import clientOnly from "../clientOnly.js";
5
5
  const DevOverlayDialog = import.meta.env.PROD
@@ -31,10 +31,12 @@ const withAssets = function (fn) {
31
31
  const { nonce } = getRequestEvent();
32
32
  useAssets(assets, nonce);
33
33
  return mod.default(props);
34
- }
34
+ },
35
35
  };
36
36
  };
37
37
  return wrapper;
38
38
  };
39
- const lazy = !isServer ? solidLazy : (fn) => solidLazy(withAssets(fn));
39
+ const lazy = !isServer
40
+ ? solidLazy
41
+ : (fn) => solidLazy(withAssets(fn));
40
42
  export default lazy;
package/env.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ // This file contains global type definitions that are exported as @solidjs/start/env
2
+
3
+ /// <reference types="vite/client" />
4
+
5
+ declare namespace App {
6
+ export interface RequestEventLocals {
7
+ [key: string | symbol]: any;
8
+ }
9
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solidjs/start",
3
- "version": "2.0.0-alpha.0",
3
+ "version": "2.0.0-alpha.2",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./dist/index.jsx",
@@ -11,7 +11,8 @@
11
11
  "./server/spa": "./dist/server/spa/index.jsx",
12
12
  "./client/spa": "./dist/client/spa/index.jsx",
13
13
  "./middleware": "./dist/middleware/index.js",
14
- "./http": "./dist/http/index.js"
14
+ "./http": "./dist/http/index.js",
15
+ "./env": "./env.d.ts"
15
16
  },
16
17
  "publishConfig": {
17
18
  "access": "public"
@@ -36,8 +37,8 @@
36
37
  "path-to-regexp": "^8.2.0",
37
38
  "pathe": "^2.0.3",
38
39
  "radix3": "^1.1.2",
39
- "seroval": "^1.3.2",
40
- "seroval-plugins": "^1.2.1",
40
+ "seroval": "^1.4.1",
41
+ "seroval-plugins": "^1.4.0",
41
42
  "shiki": "^1.26.1",
42
43
  "solid-js": "^1.9.9",
43
44
  "source-map-js": "^1.2.1",
package/scripts/build.js CHANGED
@@ -9,7 +9,7 @@ await Promise.all(
9
9
  fs.cp(
10
10
  path.join(import.meta.dirname, "../src", file),
11
11
  path.join(import.meta.dirname, "../dist", file),
12
- { recursive: true }
13
- )
14
- )
12
+ { recursive: true },
13
+ ),
14
+ ),
15
15
  );
@@ -115,7 +115,7 @@ function extractImportExportStatements(content, filePath) {
115
115
  // Export from: export { ... } from '...'
116
116
  /export\s+(?:\{[^}]*\}|\*)\s+from\s+['"`]([^'"`]+)['"`]/g,
117
117
  // Export default from: export { default } from '...'
118
- /export\s+\{\s*default\s*\}\s+from\s+['"`]([^'"`]+)['"`]/g
118
+ /export\s+\{\s*default\s*\}\s+from\s+['"`]([^'"`]+)['"`]/g,
119
119
  // Note: Dynamic imports are excluded as they're handled by bundlers
120
120
  ];
121
121
 
@@ -147,7 +147,7 @@ function extractImportExportStatements(content, filePath) {
147
147
  path: importPath,
148
148
  line: lineNumber + 1,
149
149
  fullLine: line.trim(),
150
- filePath
150
+ filePath,
151
151
  });
152
152
  }
153
153
  }
@@ -175,7 +175,7 @@ function validateFile(filePath) {
175
175
  line: statement.line,
176
176
  importPath: statement.path,
177
177
  fullLine: statement.fullLine,
178
- type: "invalid-extension"
178
+ type: "invalid-extension",
179
179
  });
180
180
  } else if (!hasValidExtension(statement.path)) {
181
181
  errors.push({
@@ -183,7 +183,7 @@ function validateFile(filePath) {
183
183
  line: statement.line,
184
184
  importPath: statement.path,
185
185
  fullLine: statement.fullLine,
186
- type: "missing-extension"
186
+ type: "missing-extension",
187
187
  });
188
188
  }
189
189
  }
@@ -243,7 +243,7 @@ function validateImports() {
243
243
 
244
244
  if (missingExtensionErrors.length > 0) {
245
245
  console.log(
246
- `❌ Found ${missingExtensionErrors.length} relative import(s) without extensions:\n`
246
+ `❌ Found ${missingExtensionErrors.length} relative import(s) without extensions:\n`,
247
247
  );
248
248
 
249
249
  const missingByFile = new Map();
@@ -262,7 +262,7 @@ function validateImports() {
262
262
  console.log(` Line ${error.line}: ${error.importPath}`);
263
263
  console.log(` ${error.fullLine}`);
264
264
  console.log(
265
- ` ${"".padStart(error.fullLine.indexOf(error.importPath), " ")}${"".padStart(error.importPath.length, "^")}`
265
+ ` ${"".padStart(error.fullLine.indexOf(error.importPath), " ")}${"".padStart(error.importPath.length, "^")}`,
266
266
  );
267
267
  });
268
268
  console.log("");
@@ -271,7 +271,7 @@ function validateImports() {
271
271
 
272
272
  if (invalidExtensionErrors.length > 0) {
273
273
  console.log(
274
- `❌ Found ${invalidExtensionErrors.length} relative import(s) with invalid extensions:\n`
274
+ `❌ Found ${invalidExtensionErrors.length} relative import(s) with invalid extensions:\n`,
275
275
  );
276
276
 
277
277
  const invalidByFile = new Map();
@@ -290,7 +290,7 @@ function validateImports() {
290
290
  console.log(` Line ${error.line}: ${error.importPath}`);
291
291
  console.log(` ${error.fullLine}`);
292
292
  console.log(
293
- ` ${"".padStart(error.fullLine.indexOf(error.importPath), " ")}${"".padStart(error.importPath.length, "^")}`
293
+ ` ${"".padStart(error.fullLine.indexOf(error.importPath), " ")}${"".padStart(error.importPath.length, "^")}`,
294
294
  );
295
295
  });
296
296
  console.log("");
@@ -1,114 +1 @@
1
- import type { JSX } from "solid-js";
2
- import { createStore } from "solid-js/store";
3
- import {
4
- createComponent,
5
- getHydrationKey,
6
- getOwner,
7
- hydrate,
8
- type MountableElement
9
- } from "solid-js/web";
10
-
11
- /**
12
- *
13
- * Read more: https://docs.solidjs.com/solid-start/reference/client/mount
14
- */
15
- export function mount(fn: () => JSX.Element, el: MountableElement) {
16
- if (import.meta.env.START_ISLANDS) {
17
- const map = new WeakMap();
18
- async function mountIsland(el: HTMLElement) {
19
- if (el.dataset.css) {
20
- let css = JSON.parse(el.dataset.css);
21
- for (let href of css) {
22
- if (!document.querySelector(`link[href="${href}"]`)) {
23
- let link = document.createElement("link");
24
- link.rel = "stylesheet";
25
- link.href = href;
26
- document.head.appendChild(link);
27
- }
28
- }
29
- }
30
-
31
- let mod = await import(
32
- /* @vite-ignore */
33
- import.meta.env.MANIFEST["client"]!.chunks[el.dataset.id!.split("#")[0] as string]!.output
34
- .path
35
- );
36
- if (!mod || !el.dataset.hk) return;
37
-
38
- let Component = mod[el.dataset.id!.split("#")[1] as string];
39
- let hk = el.dataset.hk;
40
- // _$DEBUG("hydrating island", el.dataset.island, hk.slice(0, hk.length - 1) + `1-`, el);
41
-
42
- let props = createStore({
43
- ...JSON.parse(el.dataset.props!),
44
- get children() {
45
- const p = el.getElementsByTagName("solid-children");
46
- getHydrationKey();
47
- [...p].forEach(a => {
48
- (a as any).__$owner = getOwner();
49
- });
50
- return;
51
- }
52
- });
53
-
54
- map.set(el, props);
55
-
56
- hydrate(() => createComponent(Component, props[0]), el, {
57
- renderId: hk.slice(0, hk.length - 1) + `${1 + Number(el.dataset.offset)}-`,
58
- owner: lookupOwner(el)
59
- });
60
-
61
- delete el.dataset.hk;
62
- el.dataset.hkk = hk;
63
- }
64
-
65
- let queue: HTMLElement[] = [];
66
- let queued = false;
67
- function runTaskQueue(info: any) {
68
- while (info.timeRemaining() > 0 && queue.length) {
69
- mountIsland(queue.shift()!);
70
- }
71
- if (queue.length) {
72
- requestIdleCallback(runTaskQueue);
73
- } else queued = false;
74
- }
75
-
76
- const hydrateIslands = () => {
77
- const islands: NodeListOf<HTMLElement> = document.querySelectorAll("solid-island[data-hk]");
78
- const assets = new Set<string>();
79
- islands.forEach((el: HTMLElement) => el.dataset.id && assets.add(el.dataset.id));
80
- Promise.all(
81
- [...assets].map(
82
- asset =>
83
- import(
84
- /* @vite-ignore */ import.meta.env.MANIFEST["client"]!.chunks[
85
- asset.split("#")[0] as string
86
- ]!.output.path
87
- )
88
- )
89
- )
90
- .then(() => {
91
- islands.forEach((el: HTMLElement) => {
92
- if (el.dataset.when === "idle" && "requestIdleCallback" in window) {
93
- if (!queued) {
94
- queued = true;
95
- requestIdleCallback(runTaskQueue);
96
- }
97
- queue.push(el);
98
- } else mountIsland(el as HTMLElement);
99
- });
100
- })
101
- .catch(e => console.error(e));
102
- };
103
-
104
- function lookupOwner(el: HTMLElement) {
105
- const parent = el.closest("solid-children");
106
- return parent && (parent as any).__$owner;
107
- }
108
-
109
- hydrateIslands();
110
-
111
- return;
112
- }
113
- return hydrate(fn, el);
114
- }
1
+ export { hydrate as mount } from "solid-js/web"
@@ -10,10 +10,10 @@ export const VIRTUAL_MODULES = {
10
10
  serverFnManifest: "solidstart:server-fn-manifest",
11
11
  clientEntry: "solid-start:client-entry",
12
12
  serverEntry: "solid-start:server-entry",
13
- app: "solid-start:app"
13
+ app: "solid-start:app",
14
14
  } as const;
15
15
 
16
16
  export const VITE_ENVIRONMENTS = {
17
17
  client: "client",
18
- server: "ssr"
19
- }
18
+ server: "ssr",
19
+ };