Skip to content

Update dependencies: Wrangler v4, Rust 2021, and modernize codebase#4

Draft
Copilot wants to merge 4 commits intomasterfrom
copilot/fix-4e6df470-a366-49da-8c9f-0252b06c9d6e
Draft

Update dependencies: Wrangler v4, Rust 2021, and modernize codebase#4
Copilot wants to merge 4 commits intomasterfrom
copilot/fix-4e6df470-a366-49da-8c9f-0252b06c9d6e

Conversation

Copy link

Copilot AI commented Jul 12, 2025

This PR modernizes the Salieri project by updating all major dependencies and fixing compatibility issues. The updates eliminate security vulnerabilities and ensure the project builds with current tooling.

Major Updates

Node.js Dependencies

  • Wrangler: v2.0.0v4.24.3
    • Eliminates all 15 npm security vulnerabilities
    • Updates from deprecated Wrangler v2 to current v4
    • Changes wrangler publishwrangler deploy command

Rust Dependencies

  • Edition: 20182021 (modern Rust edition)
  • worker: v0.0.11v0.6.0 (major version update)
  • cfg-if: v0.1.2v1.0
  • toml: v0.7.3v0.8
  • uuid: Added js feature for WASM compatibility
  • serde_json: Updated to latest v1.0

Configuration Updates

  • wrangler.toml: Updated compatibility_date from 2022-01-20 to 2024-11-01
  • Cargo.toml: Added package metadata (description, repository, license)
  • WASM build: Configured to work with new tooling

Code Fixes

The worker crate v0.6.0 introduced breaking API changes that required code updates:

// Before (v0.0.11)
let location = format!("{}", req.cf().colo());

// After (v0.6.0) - cf() now returns Option<&Cf>
let location = if let Some(cf) = req.cf() {
    format!("{}", cf.colo())
} else {
    "unknown".to_string()
};

Additional fixes:

  • Updated deprecated chrono methods (from_timestamp_optfrom_timestamp)
  • Fixed WASM compatibility issues with uuid crate
  • Maintained backward compatibility while upgrading APIs

Documentation Updates

  • Updated README with new Wrangler v4 commands
  • Added version requirements and build notes
  • Updated npm scripts to use wrangler deploy

Testing

  • ✅ All Rust code compiles successfully
  • ✅ WASM builds work correctly
  • ✅ No security vulnerabilities remain
  • ✅ All dependencies are at latest compatible versions

Before/After

Before:

  • 15 npm security vulnerabilities
  • Build failures due to deprecated dependencies
  • Using outdated Rust 2018 edition
  • Wrangler v2 (deprecated)

After:

  • 0 security vulnerabilities
  • All builds successful
  • Modern Rust 2021 edition
  • Current Wrangler v4

This modernization ensures the project remains maintainable and secure going forward.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • sparrow.cloudflare.com
    • Triggering command: /usr/local/bin/node --no-warnings --experimental-vm-modules /home/REDACTED/work/salieri/salieri/node_modules/wrangler/wrangler-dist/cli.js --version (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits July 12, 2025 07:52
Co-authored-by: tsunrise <22125551+tsunrise@users.noreply.github.com>
Co-authored-by: tsunrise <22125551+tsunrise@users.noreply.github.com>
Co-authored-by: tsunrise <22125551+tsunrise@users.noreply.github.com>
Copilot AI changed the title [WIP] Help bumping some dependencies of the code and update the codes accordingly. Also, update some documentations. Update dependencies: Wrangler v4, Rust 2021, and modernize codebase Jul 12, 2025
Copilot AI requested a review from tsunrise July 12, 2025 08:09
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.

2 participants