Skip to content

Conversation

josesimoes
Copy link
Member

@josesimoes josesimoes commented Mar 14, 2025

Description

  • Update references.
  • Replace Netwon soft Json with System one.
  • Update code accordingly.

Motivation and Context

How Has This Been Tested?

Screenshots

Types of changes

  • Improvement (non-breaking change that improves a feature, code or algorithm)
  • Bug fix (non-breaking change which fixes an issue with code or algorithm)
  • New feature (non-breaking change which adds functionality to code)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Config and build (change in the configuration and build system, has no impact on code or features)
  • Dev Containers (changes related with Dev Containers, has no impact on code or features)
  • Dependencies/declarations (update dependencies or assembly declarations and changes associated, has no impact on code or features)
  • Documentation (changes or updates in the documentation, has no impact on code or features)

Checklist

  • My code follows the code style of this project (only if there are changes in source code).
  • My changes require an update to the documentation (there are changes that require the docs website to be updated).
  • I have updated the documentation accordingly (the changes require an update on the docs in this repo).
  • I have read the CONTRIBUTING document.
  • I have tested everything locally and all new and existing tests passed (only if there are changes in source code).

Summary by CodeRabbit

  • Refactor
    • Streamlined JSON handling to align with modern serialization standards.
  • Chores
    • Upgraded the project to .NET 8.0 along with necessary package and dependency updates.
  • Version Update
    • Bumped the release version from 1.0 to 1.1 for improved stability and readiness for future features.

- Update references.
- Replace Netwon soft Json with System one.
- Update code accordingly.
@josesimoes josesimoes added the Platform: Virtual Device & WIN32 Everything related specifically with WIN32 and .NET tool builds label Mar 14, 2025
@nfbot nfbot added Area: Config-and-Build Type: dependencies Pull requests that update a dependency file(s) or version labels Mar 14, 2025
Copy link
Contributor

coderabbitai bot commented Mar 14, 2025

Walkthrough

This update transitions the nanoFramework nanoCLR projects to a newer .NET version and modernizes JSON handling. In the CLI, JSON property attributes and deserialization methods have been updated from Newtonsoft.Json to System.Text.Json. Both CLI and Host projects now target .NET 8.0, with corresponding updates to project files, package references, and lock files. Versioning has been incremented, and various dependencies, including Nerdbank.GitVersioning and System.IO.Ports, have been upgraded or replaced to align with the framework and library updates.

Changes

File(s) Change Summary
targets/netcore/.../CloudsmithPackageInfo.cs
targets/netcore/.../ClrInstanceOperationsProcessor.cs
Replaced [JsonProperty] attributes with [JsonPropertyName] and updated from JsonConvert.DeserializeObject to JsonSerializer.Deserialize for JSON handling.
targets/netcore/.../nanoFramework.nanoCLR.CLI.csproj Upgraded target framework from net6.0 to net8.0; updated package references: changed Nerdbank.GitVersioning (3.5.119 → 3.7.115), removed Newtonsoft.Json, added System.Runtime.Serialization.Json, and revised package paths.
targets/netcore/.../packages.lock.json (CLI) Updated target framework and dependencies: upgraded System.IO.Ports (6.0.0 → 8.0.0), replaced Newtonsoft.Json with System.Runtime.Serialization.Json, updated Nerdbank.GitVersioning, and added new transitive packages (Microsoft.NETCore.Platforms, Microsoft.NETCore.Targets, etc.).
targets/netcore/.../version.json Incremented version from "1.0" to "1.1".
targets/netcore/.../nanoFramework.nanoCLR.Host.csproj
targets/netcore/.../packages.lock.json (Host)
Upgraded target framework from net6.0 to net8.0 and updated System.IO.Ports from 6.0.0 to 8.0.0 with corresponding dependency adjustments.

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6492d91 and 1ad702b.

📒 Files selected for processing (7)
  • targets/netcore/nanoFramework.nanoCLR.CLI/CloudsmithPackageInfo.cs (1 hunks)
  • targets/netcore/nanoFramework.nanoCLR.CLI/ClrInstanceOperationsProcessor.cs (2 hunks)
  • targets/netcore/nanoFramework.nanoCLR.CLI/nanoFramework.nanoCLR.CLI.csproj (3 hunks)
  • targets/netcore/nanoFramework.nanoCLR.CLI/packages.lock.json (2 hunks)
  • targets/netcore/nanoFramework.nanoCLR.CLI/version.json (2 hunks)
  • targets/netcore/nanoFramework.nanoCLR.Host/nanoFramework.nanoCLR.Host.csproj (2 hunks)
  • targets/netcore/nanoFramework.nanoCLR.Host/packages.lock.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: nf-interpreter (Check_Code_Style)
  • GitHub Check: nf-interpreter (Nightly build) (Check_Build_Options)
  • GitHub Check: nf-interpreter (Check_Build_Options)
🔇 Additional comments (15)
targets/netcore/nanoFramework.nanoCLR.CLI/version.json (1)

3-3: Version update to reflect .NET 8.0 migration

The minor version increment from 1.0 to 1.1 aligns with the overall project update to .NET 8.0 and the changes in JSON serialization libraries.

targets/netcore/nanoFramework.nanoCLR.CLI/ClrInstanceOperationsProcessor.cs (2)

10-10: Appropriate namespace import for JSON serialization

The import of System.Text.Json aligns with the PR's objective to replace Newtonsoft.Json with System.Text.Json.


150-150:

✅ Verification successful

Correct migration from Newtonsoft.Json to System.Text.Json

The deserialization method has been updated from JsonConvert.DeserializeObject to JsonSerializer.Deserialize, which is the appropriate equivalent in System.Text.Json.


🏁 Script executed:

#!/bin/bash
# Check if CloudsmithPackageInfo.cs was also updated to use JsonPropertyName attributes
rg -A 1 "JsonProperty|JsonPropertyName" --type cs

Length of output: 945


Migration correctly implemented: The switch from JsonConvert.DeserializeObject to JsonSerializer.Deserialize is correctly reflected, and the CloudsmithPackageInfo.cs file has been properly updated with [JsonPropertyName] attributes for all its properties. This change ensures that the migration from Newtonsoft.Json to System.Text.Json is accurately applied.

  • Verified that properties like Version, DownloadUrl, TargetName, and PackageDate are tagged with [JsonPropertyName] in CloudsmithPackageInfo.cs.
targets/netcore/nanoFramework.nanoCLR.Host/nanoFramework.nanoCLR.Host.csproj (2)

5-5: Updated target framework to .NET 8.0

The change from net6.0 to net8.0 aligns with the PR's objective to update the project to .NET 8.0.


14-14: Updated System.IO.Ports package to match .NET 8.0

The System.IO.Ports package has been updated from 6.0.0 to 8.0.0 to maintain compatibility with the new target framework.

targets/netcore/nanoFramework.nanoCLR.Host/packages.lock.json (3)

4-4: Updated target framework in lock file

The target framework has been properly updated to net8.0 in the packages.lock.json file.


7-11: Updated System.IO.Ports package references

The System.IO.Ports package version has been updated to 8.0.0, along with its content hash and dependency information.


16-49: Updated runtime dependencies to match .NET 8.0

All the runtime-specific dependencies for System.IO.Ports have been updated to version 8.0.0 with their corresponding content hashes.

targets/netcore/nanoFramework.nanoCLR.CLI/CloudsmithPackageInfo.cs (2)

7-7: Adopt JSON Attributes from System.Text.Json.
The new using System.Text.Json.Serialization; directive is correctly added so that the class now uses the modern JSON attributes.


14-24: Transition to System.Text.Json Serialization.
All property attributes have been updated from the obsolete [JsonProperty] to [JsonPropertyName] with the proper JSON key names (e.g. "version", "cdn_url", "name", and "uploaded_at"). This change is consistent with the migration away from Newtonsoft.Json.

targets/netcore/nanoFramework.nanoCLR.CLI/packages.lock.json (1)

1-827: Comprehensive Dependency Update for .NET 8.0.
The lock file now reflects the transition from .NET 6.0 to .NET 8.0. Key updates include:
• Upgrading Nerdbank.GitVersioning from 3.5.119 to 3.7.115.
• Removing Newtonsoft.Json and adding System.Runtime.Serialization.Json (version 4.3.0), which aligns with the code change in JSON serialization.
• Updating native dependencies like System.IO.Ports to version 8.0.0.

Please verify that all updated dependency versions and their hashes align with the intended framework and that no residual references to Newtonsoft.Json remain.

targets/netcore/nanoFramework.nanoCLR.CLI/nanoFramework.nanoCLR.CLI.csproj (4)

3-6: Updated Target Framework.
The <TargetFramework> element has been correctly updated to net8.0, ensuring that the project will build against the new .NET version.


37-39: Adjusted Package Asset Path.
The <PackagePath> for the bundled nanoFramework.nanoCLR.dll is updated to tools\net8.0\any\NanoCLR, which matches the new target framework and output configuration. Please confirm that the asset exists at the specified location during packaging.


65-68: Configured Package Folder for New TFM.
The <PackageTfmSubFolder> is now set to net8.0\, ensuring that the package contents are correctly organized for the new framework.


70-75: Revised Package References.
The package references have been updated as follows:
Nerdbank.GitVersioning has been upgraded to version 3.7.115.
• The removed Newtonsoft.Json dependency is no longer present, and a new reference to System.Runtime.Serialization.Json (version 4.3.0) has been added.
These changes support both the migration to System.Text.Json in the code and the overall upgrade to .NET 8.0.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@josesimoes josesimoes merged commit 3a96713 into nanoframework:main Mar 14, 2025
10 checks passed
@josesimoes josesimoes deleted the update-nanoclr branch March 14, 2025 14:32
josesimoes added a commit that referenced this pull request Mar 17, 2025
TerryFogg pushed a commit to TerryFogg/nf-interpreter that referenced this pull request Apr 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Config-and-Build Platform: Virtual Device & WIN32 Everything related specifically with WIN32 and .NET tool builds Type: dependencies Pull requests that update a dependency file(s) or version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants