@quilted/threads
Advanced tools
Comparing version 0.0.0-preview-20231031044205 to 0.0.0-preview-20231113053310
export { retain, release, StackFrame, isMemoryManageable } from './memory.ts'; | ||
export type { MemoryManageable, MemoryRetainer } from './memory.ts'; | ||
export { RELEASE_METHOD, RETAIN_METHOD, RETAINED_BY, ENCODE_METHOD, } from './constants.ts'; | ||
export { createThread, createThreadFromBrowserWebSocket, createThreadFromIframe, createThreadFromInsideIframe, createThreadFromMessagePort, createThreadFromWebWorker, type ThreadOptions, } from './targets.ts'; | ||
export { createThread, createThreadFromBroadcastChannel, createThreadFromBrowserWebSocket, createThreadFromIframe, createThreadFromInsideIframe, createThreadFromMessagePort, createThreadFromWebWorker, type ThreadOptions, } from './targets.ts'; | ||
export { createBasicEncoder } from './encoding.ts'; | ||
@@ -6,0 +6,0 @@ export { createThreadAbortSignal, acceptThreadAbortSignal, type ThreadAbortSignal, } from './abort-signal.ts'; |
export { createThread, type ThreadOptions } from './targets/target.ts'; | ||
export { createThreadFromBroadcastChannel } from './targets/broadcast-channel.ts'; | ||
export { createThreadFromIframe } from './targets/iframe/iframe.ts'; | ||
@@ -3,0 +4,0 @@ export { createThreadFromInsideIframe } from './targets/iframe/nested.ts'; |
import { type ThreadOptions } from './target.ts'; | ||
/** | ||
* Creates a thread from a `WebSocket` instance in the browser. | ||
* Creates a thread from a `MessagePort` instance in the browser. | ||
* | ||
@@ -5,0 +5,0 @@ * @see https://developer.mozilla.org/en-US/docs/Web/API/MessagePort |
# @quilted/threads | ||
## 0.0.0-preview-20231031044205 | ||
## 0.0.0-preview-20231113053310 | ||
### Major Changes | ||
### Minor Changes | ||
- Removed CommonJS support | ||
- Add utility to turn `BroadcastChannel` objects into threads | ||
The `require` export condition is no longer provided by any package. Quilt only supports ESModules, so if you need to use the CommonJS version, you will need to pre-process Quilt’s output code on your own. | ||
## 2.1.0 | ||
### Patch Changes | ||
### Minor Changes | ||
- Updated dependencies []: | ||
- @quilted/events@0.0.0-preview-20231031044205 | ||
- [`e3789679`](https://github.com/lemonmade/quilt/commit/e3789679d5de2f4e5e48902c902032febee1efac) Thanks [@lemonmade](https://github.com/lemonmade)! - Add utility to turn `BroadcastChannel` objects into threads | ||
@@ -16,0 +15,0 @@ ## 2.0.0 |
@@ -5,3 +5,3 @@ { | ||
"type": "module", | ||
"version": "0.0.0-preview-20231031044205", | ||
"version": "0.0.0-preview-20231113053310", | ||
"license": "MIT", | ||
@@ -44,3 +44,3 @@ "engines": { | ||
"dependencies": { | ||
"@quilted/events": "0.0.0-preview-20231031044205" | ||
"@quilted/events": "^2.0.0" | ||
}, | ||
@@ -47,0 +47,0 @@ "peerDependencies": { |
@@ -49,2 +49,14 @@ # `@quilted/threads` | ||
const thread = createThreadFromBrowserWebSocket(socket); | ||
// Create a thread from a MessagePort. | ||
import {createThreadFromMessagePort} from '@quilted/threads'; | ||
const {port1, port2} = new MessageChannel(); | ||
const thread1 = createThreadFromMessagePort(port1); | ||
// Create a thread from a BroadcastChannel. | ||
import {createThreadFromBroadcastChannel} from '@quilted/threads'; | ||
const channel = new BroadcastChannel('my-channel'); | ||
const thread = createThreadFromBroadcastChannel(channel); | ||
``` | ||
@@ -51,0 +63,0 @@ |
@@ -11,2 +11,3 @@ export {retain, release, StackFrame, isMemoryManageable} from './memory.ts'; | ||
createThread, | ||
createThreadFromBroadcastChannel, | ||
createThreadFromBrowserWebSocket, | ||
@@ -13,0 +14,0 @@ createThreadFromIframe, |
export {createThread, type ThreadOptions} from './targets/target.ts'; | ||
export {createThreadFromBroadcastChannel} from './targets/broadcast-channel.ts'; | ||
export {createThreadFromIframe} from './targets/iframe/iframe.ts'; | ||
@@ -3,0 +4,0 @@ export {createThreadFromInsideIframe} from './targets/iframe/nested.ts'; |
import {createThread, type ThreadOptions} from './target.ts'; | ||
/** | ||
* Creates a thread from a `WebSocket` instance in the browser. | ||
* Creates a thread from a `MessagePort` instance in the browser. | ||
* | ||
@@ -6,0 +6,0 @@ * @see https://developer.mozilla.org/en-US/docs/Web/API/MessagePort |
{ | ||
"extends": "@quilted/typescript/project.json", | ||
"extends": "@quilted/craft/typescript/project.json", | ||
"compilerOptions": { | ||
@@ -4,0 +4,0 @@ "rootDir": "source", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
235312
116
3441
290
+ Added@quilted/events@2.1.1(transitive)
- Removed@quilted/events@0.0.0-preview-20231031044205(transitive)
Updated@quilted/events@^2.0.0