Use a single, unique symbol for resources#150
Merged
Conversation
When installing bigtest into an existing codebase, we ended up with multiple versions of effection. That meant that resources created with one version were not being recognized by another. An example was when we created a ParceProcess to build the manifest. Because the calling context (@bigtest/server) did not recognize the child resource that was returned by @bigtest/parcel as a resource. As a result, the child process was shutdown immediately. This uses the [Symbol.for][1] method to always return the same symbol no matter which version of effection that it is imported from. Note that this will only work for all versions of effection that include this specific change. Previous versions will continue to have the same problem.
🦋 Changeset is good to goLatest commit: 0e8951f We got this. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
|
The preview packages of this pull request have been published. effectionInstall using the following command: $ npm install effection@universal-symbolOr update your package.json file: {
"effection": "universal-symbol"
}@effection/eventsInstall using the following command: $ npm install @effection/events@universal-symbolOr update your package.json file: {
"@effection/events": "universal-symbol"
}@effection/fetchInstall using the following command: $ npm install @effection/fetch@universal-symbolOr update your package.json file: {
"@effection/fetch": "universal-symbol"
}@effection/nodeInstall using the following command: $ npm install @effection/node@universal-symbolOr update your package.json file: {
"@effection/node": "universal-symbol"
}@effection/subscriptionInstall using the following command: $ npm install @effection/subscription@universal-symbolOr update your package.json file: {
"@effection/subscription": "universal-symbol"
} |
pittst3r
approved these changes
Jun 16, 2020
taras
added a commit
that referenced
this pull request
Jul 5, 2026
* ⬆️ Upgrade @deno/doc to 0.199.0 and migrate docs pipeline to v2 Bumps `@deno/doc` 0.188.0 -> 0.199.0 and `@deno/graph` 0.89.0 -> 0.100.1, and aligns the www CI job to Deno v2.9.1 (matches #1202). `@deno/doc` >= 0.195.0 replaced the flat v1 `DocNode[]` model with the v2 `Document`/`Symbol`/`Declaration` model. The docs-rendering pipeline is migrated to consume it natively: - `doc()` returns `Record<url, Document>`; `Document.symbols` group declarations by name. `DocPageSection` holds a raw `Declaration`; render helpers receive the owning symbol via `type SymbolInfo = Omit<Symbol, "declarations">` (`extract(declaration, symbol)`, `Type({ declaration, symbol })`, `exportHash(declaration, symbol, i)`). - `.def` replaces the per-kind def fields; `ClassMethodDef.def`; every `TsType*Def` payload is `.value`; namespace members recurse over `NamespaceDef.elements` (member Symbols). - `kind === "import"` checks dropped; `Uint8Array` cast in blog-image-route.ts. Note: `@deno/doc` 0.200.0-0.202.0 ship broken wasm bindings that fail to instantiate under Deno (`__wbindgen_placeholder__`), so 0.199.0 is the newest usable v2 release. * 🐛 Fix off-by-one in API "View code" source links `@deno/doc` v2 changed `Location.line` from 1-indexed to 0-indexed (deno_doc #150/#777). GitHub's `#L<n>` anchor is 1-indexed, so the source links generated in package.ts / package/node.ts pointed one line above the symbol's declaration. Add `+ 1`. --------- Co-authored-by: Taras Mankovski <74687+taras@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
When installing bigtest into an existing codebase, we ended up with multiple versions of effection. That meant that resources created with one version were not being recognized by another. An example was when we created a ParceProcess to build the manifest. Because the calling context (@bigtest/server) did not recognize the child resource that was returned by @bigtest/parcel as a resource. As a result, the child process was shutdown immediately.
Approach
This uses the Symbol.for method to always return the same symbol no matter which version of effection that it is imported from.
Note that this will only work for all versions of effection that include this specific change. Previous versions will continue to have the same problem.