react-streaming
Advanced tools
Comparing version 0.2.8 to 0.2.9
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -23,13 +46,5 @@ exports.nodeStreamModuleIsAvailable = exports.loadNodeStreamModule = void 0; | ||
} | ||
async function loadModule(moduleId) { | ||
// bypass static analysis of bundlers, especially webpack's tenacious analysis | ||
const req = new Date().getTime() < 123 ? 456 : require; | ||
// The following doesn't work with Vitest nor Jest. | ||
// ```js | ||
// const load = new Function('moduleId', 'return import(moduleId)') | ||
// const moduleExports = await load(moduleId) | ||
// ``` | ||
// https://github.com/facebook/jest/issues/9580 | ||
const moduleExports = req(moduleId); | ||
return moduleExports; | ||
function loadModule(moduleId) { | ||
// #6 | ||
return Promise.resolve().then(() => __importStar(require(/*webpackIgnore: true*/ moduleId))); | ||
} |
@@ -20,13 +20,5 @@ export { loadNodeStreamModule }; | ||
} | ||
async function loadModule(moduleId) { | ||
// bypass static analysis of bundlers, especially webpack's tenacious analysis | ||
const req = new Date().getTime() < 123 ? 456 : require; | ||
// The following doesn't work with Vitest nor Jest. | ||
// ```js | ||
// const load = new Function('moduleId', 'return import(moduleId)') | ||
// const moduleExports = await load(moduleId) | ||
// ``` | ||
// https://github.com/facebook/jest/issues/9580 | ||
const moduleExports = req(moduleId); | ||
return moduleExports; | ||
function loadModule(moduleId) { | ||
// #6 | ||
return import(/*webpackIgnore: true*/ moduleId); | ||
} |
{ | ||
"name": "react-streaming", | ||
"description": "React 18 Streaming. Full-fledged & Easy.", | ||
"version": "0.2.8", | ||
"version": "0.2.9", | ||
"main": "./dist/cjs/index.js", | ||
@@ -6,0 +6,0 @@ "peerDependencies": { |
@@ -34,3 +34,3 @@ <p align="center"> | ||
- Unlocks React libraries of tomorrow. (Such as using [Telefunc](https://telefunc.com/) for SSR data fetching.) | ||
- Seamless support for Node.js (serverless) platforms (Vercel, AWS EC2, ...) and Edge platforms (Cloudflare Workers, Netlify Edge, Vercel Edge, ...). | ||
- Seamless support for Node.js (serverless) platforms (Vercel, AWS EC2, ...) and Edge platforms (Cloudflare Workers, Deno Deploy, Netlify Edge, Vercel Edge, ...). | ||
- Two SEO strategies: `conservative` or `google-speed`. | ||
@@ -51,3 +51,3 @@ - Easy error handling. | ||
pipe, // Node.js (Vercel, AWS EC2, ...) | ||
readable // Edge (Coudflare Workers, Netlify Edge, Vercel Edge, ...) | ||
readable // Edge (Coudflare Workers, Deno Deploy, Netlify Edge, Vercel Edge, ...) | ||
} = await renderToStream(<Page />) | ||
@@ -54,0 +54,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
72028
1512
8