@rsc-kit/core 0.9.0 → 0.11.0

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 (50) hide show
  1. package/dist/action.d.ts +21 -0
  2. package/dist/action.js +67 -36
  3. package/dist/action.js.map +1 -1
  4. package/dist/apiPrerender.d.ts +33 -0
  5. package/dist/apiPrerender.js +200 -0
  6. package/dist/apiPrerender.js.map +1 -0
  7. package/dist/appAssets.d.ts +30 -0
  8. package/dist/appAssets.js +90 -0
  9. package/dist/appAssets.js.map +1 -0
  10. package/dist/buildReport.d.ts +43 -0
  11. package/dist/buildReport.js +40 -0
  12. package/dist/buildReport.js.map +1 -0
  13. package/dist/host.d.ts +12 -0
  14. package/dist/host.js +148 -2
  15. package/dist/host.js.map +1 -1
  16. package/dist/js/RouteErrorBoundary.d.ts +36 -0
  17. package/dist/js/RouteErrorBoundary.js +43 -0
  18. package/dist/js/RouteErrorBoundary.js.map +1 -0
  19. package/dist/js/queryClient.js +21 -1
  20. package/dist/js/queryClient.js.map +1 -1
  21. package/dist/manifest.d.ts +33 -0
  22. package/dist/manifest.js.map +1 -1
  23. package/dist/notFound.d.ts +24 -0
  24. package/dist/notFound.js +107 -0
  25. package/dist/notFound.js.map +1 -0
  26. package/dist/prerender.d.ts +48 -4
  27. package/dist/prerender.js +79 -9
  28. package/dist/prerender.js.map +1 -1
  29. package/dist/query.d.ts +23 -0
  30. package/dist/query.js +45 -3
  31. package/dist/query.js.map +1 -1
  32. package/dist/redirect.d.ts +8 -0
  33. package/dist/redirect.js +11 -1
  34. package/dist/redirect.js.map +1 -1
  35. package/dist/request.d.ts +27 -0
  36. package/dist/request.js +50 -6
  37. package/dist/request.js.map +1 -1
  38. package/dist/routeSchema.d.ts +115 -0
  39. package/dist/routeSchema.js +182 -0
  40. package/dist/routeSchema.js.map +1 -0
  41. package/dist/routing.d.ts +20 -1
  42. package/dist/routing.js +30 -7
  43. package/dist/routing.js.map +1 -1
  44. package/dist/vite.d.ts +34 -1
  45. package/dist/vite.js +837 -33
  46. package/dist/vite.js.map +1 -1
  47. package/dist/webManifest.d.ts +54 -0
  48. package/dist/webManifest.js +81 -0
  49. package/dist/webManifest.js.map +1 -0
  50. package/package.json +17 -1
package/dist/vite.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { WebManifestOptions } from './webManifest.js';
1
2
  import type { PluginOption } from 'vite';
2
3
  export interface RscKitOptions {
3
4
  /** Project root. Defaults to RSC_PROJECT_ROOT, then cwd. */
@@ -188,5 +189,37 @@ export interface RscKitOptions {
188
189
  * Nothing else is touched. An action is a POST and must never be answered from
189
190
  * a cache; anything cross-origin is somebody else's to cache.
190
191
  */
191
- export declare const SERVICE_WORKER: (version: string, precache: string[]) => string;
192
+ export declare const SERVICE_WORKER: (version: string, precache: string[], frozen?: string[]) => string;
193
+ /**
194
+ * Write the worker beside the assets it caches.
195
+ *
196
+ * The version is a hash of what is being precached rather than a build id from
197
+ * the environment. The names are content-hashed already, so a build that
198
+ * changed nothing produces the same list and leaves the visitor's cache alone,
199
+ * and a build that changed anything produces a different one — which is the
200
+ * whole of cache invalidation, without asking anyone to set a variable.
201
+ */
202
+ /**
203
+ * Write the web app manifest into the client output, beside the assets.
204
+ *
205
+ * Into the same directory the browser is served from, because that is where a
206
+ * relative icon path resolves — a manifest served from somewhere else resolves
207
+ * its icons somewhere else too, and the failure is a browser that quietly does
208
+ * not offer to install.
209
+ */
210
+ /**
211
+ * The manifest an app declared beside its routes.
212
+ *
213
+ * `src/app/manifest.ts`, default-exporting the object — the same shape every
214
+ * other thing about a route tree takes here, and the reason this is a file
215
+ * rather than a `vite.config.ts` key. A manifest is not build configuration
216
+ * any more than a page is; it is one more thing the app declares about itself,
217
+ * and it belongs where the app is.
218
+ *
219
+ * Evaluated with the TypeScript stripped rather than imported: this runs while
220
+ * the plugin is being constructed, long before there is a module graph to pull
221
+ * it through, and importing an app module here would drag its imports in with
222
+ * it. The file is a literal object by contract, which is all that has to parse.
223
+ */
224
+ export declare function declaredManifest(appDir: string): WebManifestOptions | null;
192
225
  export declare function rscKit(options?: RscKitOptions): PluginOption[];