@lomray/vite-ssr-boost 1.0.0-beta.27 → 1.0.0-beta.28

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 CHANGED
@@ -98,6 +98,10 @@ import App from './App';
98
98
  import routes from './routes';
99
99
 
100
100
  export default entryServer(App, routes, {
101
+ /**
102
+ * Request timeout (If your backend is slow, increase this value)
103
+ */
104
+ abortDelay: 15000, // default: 15000 (ms)
101
105
  /**
102
106
  * Server configuration (optional)
103
107
  */
@@ -168,23 +172,25 @@ import type { FCRoute } from '@lomray/vite-ssr-boost/interfaces/fc-route';
168
172
  */
169
173
  SsrBoost({
170
174
  /**
171
- * With this option you can export route components like FCRoute or FCCRoute
172
- * @example
173
- * const Page: FCRoute = () => <div>Hi</div>;
174
- *
175
- * Page.ErrorBoudary = () => <div>Error</div>;
176
- *
177
- * export default Page;
178
- *
179
- * Routes:
180
- * const routes = [{ path: '/', lazyNR: () => import('./pages/home') }]
175
+ * index.html file path
181
176
  */
182
- hasLazyRoutePlugin: true, // default: true
183
-
177
+ indexFile: 'index.html', // default: index.html
178
+ /**
179
+ * Server entrypoint file
180
+ */
181
+ serverFile: 'server.ts', // default: server.ts
182
+ /**
183
+ * Client entrypoint file
184
+ */
185
+ clientFile: 'client.ts', // default: client.ts
184
186
  /**
185
187
  * Add tsconfig aliases to vite config aliases
186
188
  */
187
189
  tsconfigAliases: true, // default: true
190
+ /**
191
+ * Production: add scripts to head (server-side)
192
+ */
193
+ preloadAssets: false, // default: false
188
194
  })
189
195
  ```
190
196
 
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ /**
3
+ * Scroll page to top on every pathname (url) change
4
+ * @constructor
5
+ */
6
+ declare const ScrollToTop: FC;
7
+ export { ScrollToTop as default };
@@ -0,0 +1,2 @@
1
+ import{useEffect as o}from"react";import{useLocation as r}from"react-router-dom";const t=()=>{const{pathname:t}=r();return o((()=>{window.scrollTo(0,0)}),[t]),null};export{t as default};
2
+ //# sourceMappingURL=scroll-to-top.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scroll-to-top.js","sources":["../../src/components/scroll-to-top.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useEffect } from 'react';\nimport { useLocation } from 'react-router-dom';\n\n/**\n * Scroll page to top on every pathname (url) change\n * @constructor\n */\nconst ScrollToTop: FC = () => {\n const { pathname } = useLocation();\n\n useEffect(() => {\n window.scrollTo(0, 0);\n }, [pathname]);\n\n return null;\n};\n\nexport default ScrollToTop;\n"],"names":["ScrollToTop","pathname","useLocation","useEffect","window","scrollTo"],"mappings":"iFAQM,MAAAA,EAAkB,KACtB,MAAMC,SAAEA,GAAaC,IAMrB,OAJAC,GAAU,KACRC,OAAOC,SAAS,EAAG,EAAE,GACpB,CAACJ,IAEG,IAAI"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lomray/vite-ssr-boost",
3
- "version": "1.0.0-beta.27",
3
+ "version": "1.0.0-beta.28",
4
4
  "description": "Vite plugin for create awesome SSR or SPA applications on React.",
5
5
  "type": "module",
6
6
  "keywords": [