-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(sdks/actor): remove all jsr libraries #1915
chore(sdks/actor): remove all jsr libraries #1915
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR focuses on removing JSR libraries and updating dependencies for NPM compatibility across the actor SDK.
- Changed platform from 'neutral' to 'node' in
sdks/actor/runtime/tsup.config.ts
, impacting build output compatibility - Replaced
@std/cbor
withcbor-x
insdks/actor/client/src/handle.ts
and related files for CBOR encoding/decoding - Implemented custom Logger class in
sdks/actor/common/src/log.ts
to replace@std/log
functionality - Added new
Lock
anddeadline
utilities insdks/actor/runtime/src/utils.ts
to replace@core/asyncutil
functionality - Significant version downgrade from 24.6.2-rc.1 to 0.0.3 in package.json files, potentially impacting dependent packages
20 file(s) reviewed, 8 comment(s)
Edit PR Review Bot Settings | Greptile
import type { ClientOptions } from "./client.ts"; | ||
import { InternalError } from "./errors.ts"; | ||
import type { ClientOptions } from "./client"; | ||
import { InternalError } from "./errors"; | ||
import { Client } from "./mod.ts"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: inconsistent extension usage - mod.ts
still has .ts
extension while other local imports had it removed
interface LogRecord { | ||
args: unknown[]; | ||
datetime: Date; | ||
level: number; | ||
levelName: string; | ||
loggerName: string; | ||
msg: string; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: LogRecord interface includes levelName which is redundant since level is already stored and can be mapped using LevelNameMap
if (!httpPort) throw new Error("missing http port"); | ||
const hostname = httpPort.hostname; | ||
assertExists(hostname); | ||
if (!hostname) throw new Error("missing hostname"); | ||
const port = httpPort.port; | ||
assertExists(port); | ||
if (!port) throw new Error("missing port"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Consider consolidating these three checks into a single error message since they're all related to port configuration
if ((a.tags as ActorTags).access !== "public") { | ||
throw new Error("unreachable: actor tags not public"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: The error message mentions this is 'unreachable', but the code path is clearly reachable since we're checking for it. Consider renaming the error message to better reflect that this is an invalid state rather than an unreachable one.
@@ -52,7 +51,7 @@ export class Connection<A extends AnyActor> { | |||
*/ | |||
public get state(): ExtractActorConnState<A> { | |||
this.#validateStateEnabled(); | |||
assertExists(this.#state, "state should exist"); | |||
if (!this.#state) throw new Error("state should exists"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax: typo in error message: 'exists' should be 'exist'
@@ -32,3 +32,44 @@ export const throttle = < | |||
} else lastArgs = args; | |||
}; | |||
}; | |||
|
|||
export function deadline<T>(promise: Promise<T>, timeout: number): Promise<T> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: timeout parameter should be validated to ensure it's a positive number
"esModuleInterop": false, | ||
"allowSyntheticDefaultImports": false, | ||
"allowSyntheticDefaultImports": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Having esModuleInterop: false
but allowSyntheticDefaultImports: true
is an unusual combination that may cause issues. These settings typically work together - consider enabling both or disabling both.
"moduleResolution": "bundler", | ||
"types": ["deno"], | ||
"types": ["node", "deno"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Using moduleResolution 'bundler' with both Node and Deno types may cause resolution conflicts. Consider using 'node' or 'nodenext' for better NPM compatibility.
Merge activity
|
afef200
to
dd4c4bb
Compare
5350091
to
ddb42ad
Compare
<!-- Please make sure there is an issue that this PR is correlated to. --> ## Changes <!-- If there are frontend changes, please include screenshots. -->
Changes