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

release: v0.6.0 #49

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

release: v0.6.0 #49

wants to merge 6 commits into from

Conversation

zoedsoupe
Copy link
Collaborator

Problem

The project currently uses an outdated version of Elixir, which may lack recent features and improvements introduced in newer releases. Upgrading to a more recent version can enhance performance, security, and maintainability.

Solution

This pull request updates the project's Elixir version to 1.18. This version introduces several enhancements, including:

  • Type System Improvements: Elixir 1.18 introduces type checking of function calls and gradual inference of patterns and return types, enhancing code reliability.

  • Language Server Enhancements: The new compiler lock and listener features improve development tooling by allowing multiple Elixir instances to share compilation results, reducing duplicate efforts.

  • Built-in JSON Support: A new JSON module provides functions to encode and decode JSON, streamlining data handling without external dependencies.

  • ExUnit Enhancements: Support for parameterized tests allows running the same test module multiple times under different parameters, improving test coverage and flexibility.

Rationale

Upgrading to Elixir 1.18 ensures the project benefits from the latest language features and performance improvements. The enhancements in type checking, development tooling, and testing capabilities contribute to a more robust and efficient codebase. Additionally, built-in JSON support reduces reliance on external libraries, simplifying maintenance.

For a comprehensive overview of the new features in Elixir 1.18, you might find the following video informative:

@zoedsoupe zoedsoupe requested a review from a team January 3, 2025 01:02
@zoedsoupe zoedsoupe changed the title Update elixir to v1.18 Update dev env elixir to v1.18 Jan 6, 2025
filipecabaco
filipecabaco previously approved these changes Jan 9, 2025
@zoedsoupe zoedsoupe changed the title Update dev env elixir to v1.18 release: v0.6.0 Jan 10, 2025
@zoedsoupe
Copy link
Collaborator Author

this branch/PR kinda turned into a feature/release branch, so i changed the title and edit mix.exs

## Problem
1. Limited Extensibility for HTTP Requests: The existing
Supabase.Fetcher lacked robust support for custom decoders, error
parsers, and HTTP client backends, leading to potential limitations when
integrating advanced use cases.
2. Missing Configurability for Supabase Services: Service-specific URLs
and configurations were not seamlessly integrated into the
Supabase.Fetcher.Request builder, potentially leading to inconsistent
setups for applications.
3. Inconsistent Error Handling: The lack of a centralized error
management system meant error messages could be fragmented and harder to
debug.
4. Absence of Detailed Test Coverage: Existing tests did not fully
validate the behavior of streaming, file uploads, and custom
configurations.

## Solution
1.	Enhanced HTTP Request Builder:
- Introduced a fully extensible request builder API in
Supabase.Fetcher.Request that allows chaining methods for custom
headers, body decoders, error parsers, and HTTP clients.
- Added support for service-specific URL handlers (with_<service>_url/2)
to standardize endpoint configurations for services like auth, storage,
and database.
2.	Improved Error Handling:
- Centralized error management via the Supabase.Error module, defining a
unified structure for error codes, messages, metadata, and
service-specific origins.
- Implemented error parsers in Supabase.ErrorParser for handling
transport and HTTP errors seamlessly.
3.	Streaming and File Upload Support:
- Added robust support for streaming large files and consuming streamed
responses using Finch.stream/5 in Supabase.Fetcher.Adapter.Finch.
- Introduced file upload utilities that handle file streams,
content-length headers, and MIME type detection automatically.
4.	Tests for Comprehensive Coverage:
- Enhanced test coverage with unit tests for request building,
service-specific configurations, custom decoders, and error parsers.
- Included tests for file upload, streaming, and error handling
scenarios, ensuring edge cases are well-tested.
5.	Documentation and Clarity:
- Updated module and function documentation to describe key features and
example use cases, making it easier for developers to adopt the changes.
- Added clear examples for implementing custom decoders and error
parsers, and using the enhanced request builder API.

## Rationale
1. Developer Productivity: The improved request builder and
service-specific configurations reduce boilerplate code and improve
consistency across integrations.
2. Error Debugging: Centralized error handling and detailed metadata in
error messages enhance troubleshooting and debugging workflows.
3. Future-Proof Design: By introducing behaviors and allowing custom
implementations for HTTP clients, body decoders, and error parsers, the
library becomes extensible for future needs.
4. Reliability: The expanded test coverage ensures that core features
like streaming, file uploads, and error management work as expected
across a variety of scenarios.
5. Alignment with Supabase Ecosystem: These changes make the library a
more powerful and idiomatic choice for Elixir developers integrating
with Supabase, aligning well with Supabase’s flexibility and
developer-first approach.
@zoedsoupe zoedsoupe force-pushed the feat/update-elixir branch 2 times, most recently from f7656bc to a77ff35 Compare January 12, 2025 23:56
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