react-streaming
Advanced tools
Comparing version 0.3.10 to 0.3.11-commit-fbcc062
@@ -8,1 +8,3 @@ "use strict"; | ||
Object.defineProperty(exports, "useStream", { enumerable: true, get: function () { return useStream_1.useStream; } }); | ||
const utils_1 = require("./utils"); | ||
(0, utils_1.assert)(!(0, utils_1.isBrowser)(), 'server/hooks.js loaded in browser'); |
@@ -7,1 +7,3 @@ "use strict"; | ||
Object.defineProperty(exports, "disable", { enumerable: true, get: function () { return renderToStream_1.disable; } }); | ||
const utils_1 = require("./utils"); | ||
(0, utils_1.assert)(!(0, utils_1.isBrowser)(), 'server/index.js loaded in browser'); |
@@ -27,3 +27,9 @@ "use strict"; | ||
onBeforeWrite(chunk); | ||
writableFromUser.write(chunk, encoding, callback); | ||
if (!writableFromUser.destroyed) { | ||
writableFromUser.write(chunk, encoding, callback); | ||
} | ||
else { | ||
// Destroying twice is fine: https://github.com/brillout/react-streaming/pull/21#issuecomment-1554517163 | ||
writableForReact.destroy(); | ||
} | ||
}, | ||
@@ -30,0 +36,0 @@ final(callback) { |
@@ -5,1 +5,2 @@ export * from '../utils/assert'; | ||
export * from '../utils/isPromise'; | ||
export * from '../utils/isBrowser'; |
@@ -21,1 +21,2 @@ "use strict"; | ||
__exportStar(require("../utils/isPromise"), exports); | ||
__exportStar(require("../utils/isBrowser"), exports); |
@@ -9,4 +9,4 @@ "use strict"; | ||
// Ensure that this is never loaded in the browser. (In order to avoid this file to be included in the client-side bundle.) | ||
// For isomorphic code: instead of `import { createDebugger } from './utils'`, use `globalThis.createDebugger()`. | ||
(0, assert_1.assert)(!(0, isBrowser_1.isBrowser)()); | ||
// For isomorphic code: use `globalThis.createDebugger()` instead of `import { createDebugger } from './utils'`. | ||
(0, assert_1.assert)(!(0, isBrowser_1.isBrowser)(), 'utils/debug.js loaded in browser'); | ||
globalThis.__brillout_debug_createDebugger = createDebugger; | ||
@@ -13,0 +13,0 @@ function createDebugger(namespace, optionsGlobal) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.projectInfo = void 0; | ||
const PROJECT_VERSION = '0.3.10'; | ||
const PROJECT_VERSION = '0.3.11-commit-fbcc062'; | ||
exports.projectInfo = { | ||
@@ -6,0 +6,0 @@ projectName: 'react-streaming', |
export { useAsync } from './useAsync'; | ||
export { useStream } from './useStream'; | ||
import { assert, isBrowser } from './utils'; | ||
assert(!isBrowser(), 'server/hooks.js loaded in browser'); |
export { renderToStream, disable } from './renderToStream'; | ||
import { assert, isBrowser } from './utils'; | ||
assert(!isBrowser(), 'server/index.js loaded in browser'); |
@@ -25,3 +25,9 @@ export { createPipeWrapper }; | ||
onBeforeWrite(chunk); | ||
writableFromUser.write(chunk, encoding, callback); | ||
if (!writableFromUser.destroyed) { | ||
writableFromUser.write(chunk, encoding, callback); | ||
} | ||
else { | ||
// Destroying twice is fine: https://github.com/brillout/react-streaming/pull/21#issuecomment-1554517163 | ||
writableForReact.destroy(); | ||
} | ||
}, | ||
@@ -28,0 +34,0 @@ final(callback) { |
@@ -5,1 +5,2 @@ export * from '../utils/assert'; | ||
export * from '../utils/isPromise'; | ||
export * from '../utils/isBrowser'; |
@@ -5,1 +5,2 @@ export * from '../utils/assert'; | ||
export * from '../utils/isPromise'; | ||
export * from '../utils/isBrowser'; |
@@ -8,4 +8,4 @@ export { createDebugger }; | ||
// Ensure that this is never loaded in the browser. (In order to avoid this file to be included in the client-side bundle.) | ||
// For isomorphic code: instead of `import { createDebugger } from './utils'`, use `globalThis.createDebugger()`. | ||
assert(!isBrowser()); | ||
// For isomorphic code: use `globalThis.createDebugger()` instead of `import { createDebugger } from './utils'`. | ||
assert(!isBrowser(), 'utils/debug.js loaded in browser'); | ||
globalThis.__brillout_debug_createDebugger = createDebugger; | ||
@@ -12,0 +12,0 @@ function createDebugger(namespace, optionsGlobal) { |
@@ -1,2 +0,2 @@ | ||
const PROJECT_VERSION = '0.3.10'; | ||
const PROJECT_VERSION = '0.3.11-commit-fbcc062'; | ||
export const projectInfo = { | ||
@@ -3,0 +3,0 @@ projectName: 'react-streaming', |
{ | ||
"name": "react-streaming", | ||
"description": "React 18 Streaming. Full-fledged & Easy.", | ||
"version": "0.3.10", | ||
"version": "0.3.11-commit-fbcc062", | ||
"main": "./dist/cjs/server/hooks.js", | ||
@@ -28,3 +28,4 @@ "peerDependencies": { | ||
"// === Release ===": "", | ||
"release": "release-me patch" | ||
"release": "release-me patch", | ||
"release:commit": "release-me commit" | ||
}, | ||
@@ -46,3 +47,3 @@ "exports": { | ||
"@brillout/part-regex": "^0.1.2", | ||
"@brillout/release-me": "^0.0.7", | ||
"@brillout/release-me": "^0.1.6", | ||
"@types/node": "^15.12.2", | ||
@@ -49,0 +50,0 @@ "@types/react": "^18.0.9", |
@@ -33,3 +33,3 @@ <p align="center"> | ||
Features (for React users): | ||
**Features (for React users)** | ||
@@ -42,3 +42,3 @@ - Unlocks `<Suspense>` for SSR apps. | ||
Features (for library authors): | ||
**Features (for library authors)** | ||
@@ -48,3 +48,3 @@ - `useAsync()`: add data fetching capabilities to your library. High-level and easy to use. | ||
Easy: | ||
**Easy** | ||
@@ -51,0 +51,0 @@ ```jsx |
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
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
118672
2632