Venndr customisations to Solid - #2
Draft
nikcorg wants to merge 4 commits into
Draft
Conversation
nikcorg
force-pushed
the
customisations
branch
10 times, most recently
from
June 12, 2024 10:24
5ac74bc to
4b92225
Compare
nikcorg
force-pushed
the
customisations
branch
3 times, most recently
from
July 12, 2024 09:22
d4080c2 to
feb4aa0
Compare
commit 3188526 Author: Niklas Lindgren <niklas@musicglue.com> Date: Tue Jun 11 15:24:24 2024 +0300 docs(readme): adds new section on including Solid in your project This documents the altered approach to including Solid a project, the changes to importing the default matchers and how to bring your own matchers for types with bundled matchers. commit ddcb0fd Author: Niklas Lindgren <niklas@musicglue.com> Date: Tue Jun 11 15:24:05 2024 +0300 test(test helpers): add `use Solid` to test helpers commit 67c60c7 Author: Niklas Lindgren <niklas@musicglue.com> Date: Tue Jun 11 15:21:59 2024 +0300 feat: export a `use Solid` macro for default config usage This is a convenience method, that makes including Solid in your project using the default config easier. This will be the simplest and likeliest upgrade path for most Solid users. commit 2dcd980 Author: Niklas Lindgren <niklas@musicglue.com> Date: Tue Jun 11 15:20:28 2024 +0300 test(matchers): add cases for built-in matchers commit ac54b6b Author: Niklas Lindgren <niklas@musicglue.com> Date: Tue Jun 11 14:57:33 2024 +0300 feat!(matchers): exclude bundled matchers by default Packages the bundled matchers in a new module `Solid.Matcher.Builtins`, adding a `__using__` macro for including them in your own project. This is a breaking change, but the only way for supporting custom implementations in place of the bundled matchers. commit 0a86872 Author: Matt Sutkowski <msutkowski@gmail.com> Date: Mon Apr 29 21:14:23 2024 -0700 chore: update docs around render/3 and README
…filter dispatch (#5) * feat(matcher): pass render options through to matchers Change the Solid.Matcher protocol from match/2 to match/3: the third argument is the options keyword given to Solid.render/3, threaded down through Context.get_in/4 and every tag's argument resolution (including for-loop enumerables and render-tag bindings). This lets custom matchers reach request-scoped data (e.g. the full rendering context) via render options instead of out-of-band lookups like ETS tables keyed by request id. Breaking: all Solid.Matcher implementations and custom matcher_module modules must take the extra opts argument. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * perf(context): short-circuit scope lookup on first non-nil match lookup_key/4 evaluated every scope's matcher for every variable lookup and reduced the results afterwards. With expensive custom matchers on the outer scope this tripled matcher work: a loop variable hit in iteration_vars still walked vars and counter_vars. Iterate scopes in priority order with reduce_while instead, halting on the first non-nil match. Semantics are preserved: an {:ok, nil} match is kept as fallback but can be overridden by a later scope's non-nil value. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * perf(filter): dispatch filters via function_exported? instead of rescue Filter.apply/3 resolved every filter by calling Kernel.apply and rescuing UndefinedFunctionError, so each built-in filter call raised and rescued up to two exceptions while probing the custom module. Check function_exported?/3 first (with a Code.ensure_loaded?/1 fallback only on miss, so the hot path stays cheap and unloaded custom modules still resolve). The rescue stays as a safety net so filters that themselves raise ArgumentError/UndefinedFunctionError keep falling through to the next candidate instead of crashing the render. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Don't merge this PR!
Use this branch for adding customisations on top of upstream/main.
Keeping up with upstream
When upstream releases a new version, rebase this branch onto the most recent release tag.
Tag the new customisations head with the most recent Solid tag with a
-mgsuffix.E.g. the current version at the time of writing is v0.18.0, making the local version v0.18.0-mg.
Adding further customisations
git tag -f v0.15.2-mggit push -f --tags