Skip to content

Conversation

@CharlonTank
Copy link
Contributor

@CharlonTank CharlonTank commented Nov 5, 2025

Related PRs and Testing

Container implementation: lamdera/containers#1

This PR depends on the three new container types being added in lamdera/containers#1.

Test repository: https://github.com/CharlonTank/qwertytrewq

The test repo demonstrates that the codec generation now works correctly with MultiBiSeqDict (Id ChatId) (Id DocumentId) in BackendModel.

Before This PR

-- TOO MANY ARGS ------------------------------------------------- src/Types.elm

The `w3_decode_MultiBiSeqDict` value is not a function, but it was given 2 arguments.
The `w3_encode_MultiBiSeqDict` function expects 1 argument, but it got 3 instead.

After This PR

Success! Compiled 4 modules.

Testing Instructions

# Clone test repo
git clone https://github.com/CharlonTank/qwertytrewq
cd qwertytrewq

# Use override script
./override-dillon.sh /path/to/containers

# Compile (requires this compiler PR)
LDEBUG=1 EXPERIMENTAL=1 LOVR="$(pwd)/overrides" lamdera make src/Backend.elm

Both PRs (containers#1 and compiler#69) are required for the new container types to work properly in Lamdera apps.

This adds Wire3 codec generation support for three new container types
from lamdera/containers:
- BiSeqDict: Bidirectional many-to-one dictionary
- MultiSeqDict: One-to-many dictionary
- MultiBiSeqDict: Many-to-many bidirectional dictionary

Changes:
- Add DiffableType constructors for the three new types
- Add Wire3 encoder/decoder patterns following SeqDict pattern
- Add TypeHash support for type hashing and migrations
- Add Evergreen migration helpers for all three types

Related PR: lamdera/containers#1
Test repo: https://github.com/supermario/qwertytrewq

All three types use the same 2-parameter (key, value) structure as SeqDict
and work with opaque types that aren't comparable.
CharlonTank added a commit to CharlonTank/qwertytrewq that referenced this pull request Nov 5, 2025
- Add Id.elm with proper opaque ID types (ChatId, DocumentId)
- Update Backend.elm to use Id types instead of Never constructors
- Update Types.elm to use Id ChatId and Id DocumentId
- Update README with links to both PRs and test results
- Add COMPILER_CHANGES_NEEDED.md documentation
- Install UUID package dependency

Test now compiles successfully with modified compiler!

Related PRs:
- lamdera/containers#1
- lamdera/compiler#69
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.

1 participant