Skip to content

feat: refactor http/json support into fine-grained modules#55

Merged
evacchi merged 8 commits intomainfrom
refactor-modules-rebased
Jul 10, 2025
Merged

feat: refactor http/json support into fine-grained modules#55
evacchi merged 8 commits intomainfrom
refactor-modules-rebased

Conversation

@evacchi
Copy link
Copy Markdown
Contributor

@evacchi evacchi commented Jun 24, 2025

closes #40, supersedes #41

Refactors the Chicory SDK spinning out HTTP and JSON as optional components.

Notes

  • HTTP and the implied JSON support must now be explicitly configured
  • It will require users to update their dependency management when upgrading. The changes maintain backward compatibility at the API level but the module and some package names have changed

Key Changes

  1. Project Structure Reorganization:

    • Converted from a single module to a multi-module Maven project
    • Created a core module for essential functionality
    • Created separate HTTP-related modules for different implementations
  2. Module Breakdown:

    • core: Contains the core SDK functionality
    • http/api: Defines HTTP API interfaces
    • http/client-javanet: Implementation using Java's built-in HTTP client
    • http/client-urlconnection: Implementation using HttpURLConnection (for Android)
    • http/json-jackson: JSON implementation using Jackson
    • http/json-jakarta: JSON implementation using Jakarta JSON
    • http/config-generic: Pre-configured setup for standard Java environments
    • http/config-android: Pre-configured setup for Android environments
    • http/integration-tests: Tests for HTTP functionality
  3. Package Restructuring:

    • Moved core classes to org.extism.sdk.chicory.core
    • Moved HTTP-related classes to org.extism.sdk.chicory.http.*
    • Created specialized subpackages for different implementations
  4. HTTP Configuration Changes:

    • Made HTTP configuration optional rather than defaulting to a specific implementation
    • Improved error handling for missing HTTP configuration
    • Replaced the internal Lazy class with explicit configuration providers
  5. Exception Handling:

    • Created more specific exception types
    • Added ExtismConfigurationException for configuration issues
    • Separated HTTP and JSON exceptions from core exceptions

evacchi added 2 commits June 24, 2025 17:47
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
@evacchi
Copy link
Copy Markdown
Contributor Author

evacchi commented Jun 25, 2025

heads up @ehsavoie, @sap1ens this will be a breaking change

Comment thread core/src/main/java/org/extism/sdk/chicory/core/HostEnv.java Outdated
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
@evacchi
Copy link
Copy Markdown
Contributor Author

evacchi commented Jun 25, 2025

I wonder if I could just leave the toplevel as chicory-sdk and the package as org.extism.sdk.chicory 🤔 or maybe only rename chicory-sdk -> chicory-sdk-core 🤔

Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
@evacchi evacchi force-pushed the refactor-modules-rebased branch from fb314ab to 65a151e Compare June 25, 2025 14:51
evacchi added 4 commits June 25, 2025 16:55
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
@evacchi evacchi merged commit b15b25b into main Jul 10, 2025
2 checks passed
@evacchi evacchi deleted the refactor-modules-rebased branch July 10, 2025 10:13
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.

Refactor into a multi-module project

1 participant