Skip to content

Commit bbfd034

Browse files
authored
release: v0.6.0 (#49)
## 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:
1 parent b7bfe78 commit bbfd034

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2517
-817
lines changed

.dialyzerignore

Whitespace-only changes.

.envrc

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,3 @@ export ERL_AFLAGS="-kernel shell_history enabled"
99
export LANG=en_US.UTF-8
1010

1111
use flake
12-
13-
# Setup postgresql
14-
if test -d "/Applications/Postgres.app"; then
15-
export DATABASE_USER="$(whoami)"
16-
export DATABASE_PASSWORD=""
17-
else
18-
# postges related
19-
export DATABASE_USER="supabase_potion"
20-
export DATABASE_PASSWORD="supabase_potion"
21-
export PG_DATABASE="supabase_potion_dev"
22-
# keep all your db data in a folder inside the project
23-
export PGHOST="$PWD/.postgres"
24-
export PGDATA="$PGHOST/data"
25-
export PGLOG="$PGHOST/server.log"
26-
27-
if [[ ! -d "$PGDATA" ]]; then
28-
# initital set up of database server
29-
initdb --auth=trust --no-locale --encoding=UTF8 -U=$DATABASE_USER >/dev/null
30-
31-
# point to correct unix sockets
32-
echo "unix_socket_directories = '$PGHOST'" >> "$PGDATA/postgresql.conf"
33-
# creates loacl database user
34-
echo "CREATE USER $DATABASE_USER SUPERUSER;" | postgres --single -E postgres
35-
# creates local databse
36-
echo "CREATE DATABASE $PG_DATABASE;" | postgres --single -E postgres
37-
fi
38-
fi

.formatter.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Used by "mix format"
22
[
3-
inputs: ["{mix,.formatter}.exs", "{config,apps}/**/*.{ex,exs}"]
3+
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"]
44
]

.github/workflows/ci.yml

Lines changed: 152 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ jobs:
1212
lint:
1313
runs-on: ubuntu-latest
1414

15+
env:
16+
MIX_ENV: test
17+
1518
strategy:
1619
matrix:
17-
elixir: [1.17.0]
20+
elixir: [1.18.1]
1821
otp: [27.0]
1922

2023
steps:
@@ -27,8 +30,30 @@ jobs:
2730
elixir-version: ${{ matrix.elixir }}
2831
otp-version: ${{ matrix.otp }}
2932

30-
- name: Install dependencies
31-
run: mix deps.get
33+
- name: Cache Elixir deps
34+
uses: actions/cache@v1
35+
id: deps-cache
36+
with:
37+
path: deps
38+
key: ${{ runner.os }}-mix-${{ env.MIX_ENV }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
39+
40+
- name: Cache Elixir _build
41+
uses: actions/cache@v1
42+
id: build-cache
43+
with:
44+
path: _build
45+
key: ${{ runner.os }}-build-${{ env.MIX_ENV }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
46+
47+
- name: Install deps
48+
if: steps.deps-cache.outputs.cache-hit != 'true'
49+
run: |
50+
mix local.rebar --force
51+
mix local.hex --force
52+
mix deps.get --only ${{ env.MIX_ENV }}
53+
54+
- name: Compile deps
55+
if: steps.build-cache.outputs.cache-hit != 'true'
56+
run: mix deps.compile --warnings-as-errors
3257

3358
- name: Clean build
3459
run: mix clean
@@ -38,3 +63,127 @@ jobs:
3863

3964
- name: Run Credo
4065
run: mix credo --strict
66+
67+
static-analisys:
68+
runs-on: ubuntu-latest
69+
70+
env:
71+
MIX_ENV: test
72+
73+
strategy:
74+
matrix:
75+
elixir: [1.18.1]
76+
otp: [27.0]
77+
78+
steps:
79+
- name: Checkout code
80+
uses: actions/checkout@v3
81+
82+
- name: Set up Elixir
83+
uses: erlef/setup-beam@v1
84+
with:
85+
elixir-version: ${{ matrix.elixir }}
86+
otp-version: ${{ matrix.otp }}
87+
88+
- name: Cache Elixir deps
89+
uses: actions/cache@v1
90+
id: deps-cache
91+
with:
92+
path: deps
93+
key: ${{ runner.os }}-mix-${{ env.MIX_ENV }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
94+
95+
- name: Cache Elixir _build
96+
uses: actions/cache@v1
97+
id: build-cache
98+
with:
99+
path: _build
100+
key: ${{ runner.os }}-build-${{ env.MIX_ENV }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
101+
102+
- name: Install deps
103+
if: steps.deps-cache.outputs.cache-hit != 'true'
104+
run: |
105+
mix local.rebar --force
106+
mix local.hex --force
107+
mix deps.get --only ${{ env.MIX_ENV }}
108+
109+
- name: Compile deps
110+
if: steps.build-cache.outputs.cache-hit != 'true'
111+
run: mix deps.compile --warnings-as-errors
112+
113+
# Don't cache PLTs based on mix.lock hash, as Dialyzer can incrementally update even old ones
114+
# Cache key based on Elixir & Erlang version (also useful when running in matrix)
115+
- name: Restore PLT cache
116+
uses: actions/cache/restore@v3
117+
id: plt_cache
118+
with:
119+
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plt
120+
restore-keys: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plt
121+
path: priv/plts
122+
123+
# Create PLTs if no cache was found
124+
- name: Create PLTs
125+
if: steps.plt_cache.outputs.cache-hit != 'true'
126+
run: mix dialyzer --plt
127+
128+
- name: Save PLT cache
129+
uses: actions/cache/save@v3
130+
if: steps.plt_cache.outputs.cache-hit != 'true'
131+
id: plt_cache_save
132+
with:
133+
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plt
134+
path: priv/plts
135+
136+
- name: Run dialyzer
137+
run: mix dialyzer --format github
138+
139+
test:
140+
runs-on: ubuntu-latest
141+
142+
env:
143+
MIX_ENV: test
144+
145+
strategy:
146+
matrix:
147+
elixir: [1.18.1]
148+
otp: [27.0]
149+
150+
steps:
151+
- name: Checkout code
152+
uses: actions/checkout@v3
153+
154+
- name: Set up Elixir
155+
uses: erlef/setup-beam@v1
156+
with:
157+
elixir-version: ${{ matrix.elixir }}
158+
otp-version: ${{ matrix.otp }}
159+
160+
- name: Cache Elixir deps
161+
uses: actions/cache@v1
162+
id: deps-cache
163+
with:
164+
path: deps
165+
key: ${{ runner.os }}-mix-${{ env.MIX_ENV }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
166+
167+
- name: Cache Elixir _build
168+
uses: actions/cache@v1
169+
id: build-cache
170+
with:
171+
path: _build
172+
key: ${{ runner.os }}-build-${{ env.MIX_ENV }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
173+
174+
- name: Install deps
175+
if: steps.deps-cache.outputs.cache-hit != 'true'
176+
run: |
177+
mix local.rebar --force
178+
mix local.hex --force
179+
mix deps.get --only ${{ env.MIX_ENV }}
180+
181+
- name: Compile deps
182+
if: steps.build-cache.outputs.cache-hit != 'true'
183+
run: mix deps.compile --warnings-as-errors
184+
185+
- name: Clean build
186+
run: mix clean
187+
188+
- name: Run tests
189+
run: mix test

.github/workflows/release.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ result
3636
# Nix files
3737
result
3838

39+
# LSP files
3940
.elixir_ls/
4041
.elixir-tools/
4142
.lexical/
43+
44+
# Dialyzer
45+
/priv/plts/

CHANGELOG.md

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# Changelog
2+
3+
All notable changes to this project are documented in this file.
4+
5+
## [0.6.0] - 2025-01-10
6+
### Added
7+
- Enhanced HTTP handling with support for custom headers, streaming, and centralized error management.
8+
- Improved test coverage and added dependency `mox` for mocking.
9+
- CI/CD pipeline improvements with caching for faster builds.
10+
11+
### Fixed
12+
- Resolved header merging issues and inconsistencies in JSON error handling.
13+
14+
### Removed
15+
- Dropped `manage_clients` option; explicit OTP management required.
16+
17+
### Issues
18+
- Fixed "[Fetcher] Extract error parsing to its own module" [#23](https://github.com/supabase-community/supabase-ex/issues/23)
19+
- Fixed "Unable to pass `auth` key inside options to `init_client`" [#45](https://github.com/supabase-community/supabase-ex/issues/45)
20+
- Fixed "Proposal to refactor and simplify the `Supabase.Fetcher` module" [#51](https://github.com/supabase-community/supabase-ex/issues/51)
21+
- Fixed "Invalid Unicode error during file uploads (affets `storage-ex`)" [#52](https://github.com/supabase-community/supabase-ex/issues/52)
22+
23+
---
24+
25+
## [0.5.1] - 2024-09-21
26+
### Added
27+
- Improved error handling for HTTP fetch operations.
28+
- Added optional retry policies for idempotent requests.
29+
30+
### Fixed
31+
- Resolved race conditions in streaming functionality.
32+
33+
---
34+
35+
## [0.5.0] - 2024-09-21
36+
### Added
37+
- Support for direct file uploads to cloud storage.
38+
- Enhanced real-time subscription management.
39+
40+
### Fixed
41+
- Corrected WebSocket reconnection logic under high load.
42+
43+
---
44+
45+
## [0.4.1] - 2024-08-30
46+
### Changed
47+
- Performance optimizations in JSON encoding and decoding.
48+
- Improved logging for debugging.
49+
50+
### Fixed
51+
- Addressed memory leaks in connection pooling.
52+
53+
---
54+
55+
## [0.4.0] - 2024-08-30
56+
### Added
57+
- Introduced WebSocket monitoring tools.
58+
- Support for encrypted token storage.
59+
60+
---
61+
62+
## [0.3.7] - 2024-05-14
63+
### Added
64+
- Initial implementation of streaming API for large datasets.
65+
66+
### Fixed
67+
- Bug fixes in the pagination logic.
68+
69+
---
70+
71+
## [0.3.6] - 2024-04-28
72+
### Added
73+
- Experimental support for Ecto integration.
74+
75+
---
76+
77+
## [0.3.5] - 2024-04-21
78+
### Fixed
79+
- Addressed intermittent crashes when initializing connections.
80+
81+
---
82+
83+
## [0.3.4] - 2024-04-21
84+
### Changed
85+
- Optimized internal handling of database transactions.
86+
87+
---
88+
89+
## [0.3.3] - 2024-04-21
90+
### Added
91+
- Support for preflight HTTP requests.
92+
93+
---
94+
95+
## [0.3.2] - 2024-04-16
96+
### Fixed
97+
- Resolved issues with JSON payload validation.
98+
99+
---
100+
101+
## [0.3.1] - 2024-04-15
102+
### Fixed
103+
- Resolved inconsistent query results in edge cases.
104+
105+
---
106+
107+
## [0.3.0] - 2023-11-20
108+
### Added
109+
- Major refactor introducing modular architecture.
110+
- Support for real-time database change notifications.
111+
112+
---
113+
114+
## [0.2.3] - 2023-10-11
115+
### Fixed
116+
- Patched security vulnerabilities in session handling.
117+
118+
---
119+
120+
## [0.2.2] - 2023-10-10
121+
### Added
122+
- Middleware support for request customization.
123+
124+
---
125+
126+
## [0.2.1] - 2023-10-10
127+
### Fixed
128+
- Corrected behavior for long-lived connections.
129+
130+
---
131+
132+
## [0.2.0] - 2023-10-05
133+
### Added
134+
- Initial implementation of role-based access control.
135+
136+
---
137+
138+
## [0.1.0] - 2023-09-18
139+
### Added
140+
- Initial release with core features: database access, authentication, and storage support.

0 commit comments

Comments
 (0)