Skip to content
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

Conversation

NathanFlurry
Copy link
Member

Changes

Copy link

cloudflare-workers-and-pages bot commented Jan 22, 2025

Deploying rivet with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5350091
Status:🚫  Build failed.

View logs

Copy link
Member Author

NathanFlurry commented Jan 22, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add the label merge-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

cloudflare-workers-and-pages bot commented Jan 22, 2025

Deploying rivet-hub with  Cloudflare Pages  Cloudflare Pages

Latest commit: ddb42ad
Status:⚡️  Build in progress...

View logs

Copy link

@greptile-apps greptile-apps bot left a 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 with cbor-x in sdks/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 and deadline utilities in sdks/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";
Copy link

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

Comment on lines +23 to 30
interface LogRecord {
args: unknown[];
datetime: Date;
level: number;
levelName: string;
loggerName: string;
msg: string;
}
Copy link

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

Comment on lines +85 to +89
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");
Copy link

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

Comment on lines +91 to +93
if ((a.tags as ActorTags).access !== "public") {
throw new Error("unreachable: actor tags not public");
}
Copy link

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");
Copy link

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> {
Copy link

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

Comment on lines 7 to +8
"esModuleInterop": false,
"allowSyntheticDefaultImports": false,
"allowSyntheticDefaultImports": true,
Copy link

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.

Comment on lines 10 to +11
"moduleResolution": "bundler",
"types": ["deno"],
"types": ["node", "deno"],
Copy link

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.

Copy link
Contributor

graphite-app bot commented Jan 22, 2025

Merge activity

@NathanFlurry NathanFlurry mentioned this pull request Jan 22, 2025
@NathanFlurry NathanFlurry force-pushed the 01-22-chore_toolchain_update_default_templates_for_npm_compat branch from afef200 to dd4c4bb Compare January 22, 2025 16:19
@NathanFlurry NathanFlurry force-pushed the 01-22-chore_sdks_actor_remove_all_jsr_libraries branch from 5350091 to ddb42ad Compare January 22, 2025 16:20
NathanFlurry added a commit that referenced this pull request Jan 22, 2025
<!-- Please make sure there is an issue that this PR is correlated to. -->

## Changes

<!-- If there are frontend changes, please include screenshots. -->
@graphite-app graphite-app bot closed this Jan 22, 2025
@graphite-app graphite-app bot deleted the 01-22-chore_sdks_actor_remove_all_jsr_libraries branch January 22, 2025 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant