xplorajs-react 0.1.1 → 0.2.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.
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/render.d.ts +16 -1
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +2 -2
- package/package.json +2 -2
- package/dist/App.d.ts +0 -4
- package/dist/App.d.ts.map +0 -1
- package/dist/App.js +0 -5
- package/dist/server.d.ts +0 -2
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js +0 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { renderToStream } from "./render";
|
|
1
|
+
export { renderToStream, generateStaticPage, getStaticProps } from "./render";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/render.d.ts
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
import type React from "react";
|
|
2
2
|
/**
|
|
3
|
-
* Render React element ke stream HTML.
|
|
3
|
+
* Render React element ke stream HTML untuk development mode (SSR).
|
|
4
4
|
* Otomatis fallback ke string jika Streaming tidak didukung.
|
|
5
5
|
*/
|
|
6
6
|
export declare function renderToStream(element: React.ReactElement): Promise<string | import("react-dom/server").ReactDOMServerReadableStream>;
|
|
7
|
+
/**
|
|
8
|
+
* Generate static HTML file untuk production mode (SSG).
|
|
9
|
+
*/
|
|
10
|
+
export declare function generateStaticPage(options: {
|
|
11
|
+
component: React.ReactElement;
|
|
12
|
+
outputPath: string;
|
|
13
|
+
props?: Record<string, unknown>;
|
|
14
|
+
}): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Get static props untuk data fetching di build time.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getStaticProps(fn: () => Promise<Record<string, unknown>>): Promise<{
|
|
19
|
+
props: Record<string, unknown>;
|
|
20
|
+
revalidate: number;
|
|
21
|
+
}>;
|
|
7
22
|
//# sourceMappingURL=render.d.ts.map
|
package/dist/render.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B;;;GAGG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC,YAAY,6EAK/D;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE;IAChD,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC,iBAQA;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,EAAE,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;;;GAe3C"}
|
package/dist/render.js
CHANGED
|
@@ -144,11 +144,11 @@ import { renderToReadableStream, renderToString } from "react-dom/server";
|
|
|
144
144
|
* Generate static HTML file untuk production mode (SSG).
|
|
145
145
|
*/ export function generateStaticPage(options) {
|
|
146
146
|
return _async_to_generator(function() {
|
|
147
|
-
var component, outputPath,
|
|
147
|
+
var component, outputPath, html;
|
|
148
148
|
return _ts_generator(this, function(_state) {
|
|
149
149
|
switch(_state.label){
|
|
150
150
|
case 0:
|
|
151
|
-
component = options.component, outputPath = options.outputPath
|
|
151
|
+
component = options.component, outputPath = options.outputPath;
|
|
152
152
|
return [
|
|
153
153
|
4,
|
|
154
154
|
renderToString(component)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xplorajs-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"README.md"
|
|
11
11
|
],
|
|
12
12
|
"scripts": {
|
|
13
|
-
"build": "swc src -d dist",
|
|
13
|
+
"build": "swc src -d dist && tsc --emitDeclarationOnly",
|
|
14
14
|
"dev": "swc src -d dist --watch",
|
|
15
15
|
"prepublishOnly": "bun run build"
|
|
16
16
|
},
|
package/dist/App.d.ts
DELETED
package/dist/App.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,QAAA,MAAM,GAAG,EAAE,KAAK,CAAC,EAEhB,CAAC;AAEF,eAAe,GAAG,CAAC"}
|
package/dist/App.js
DELETED
package/dist/server.d.ts
DELETED
package/dist/server.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAKA,wBAAgB,MAAM,IAAI,MAAM,CAE/B"}
|