Skip to content

Doc updates for Plug & LiveView#45

Merged
vincentvanbush merged 1 commit intomainfrom
36-feature-documentation-improvements
Dec 23, 2025
Merged

Doc updates for Plug & LiveView#45
vincentvanbush merged 1 commit intomainfrom
36-feature-documentation-improvements

Conversation

@vincentvanbush
Copy link
Contributor

Pull Request

Description

Contains significant documentation improvements for clarity and completeness in both LiveView and controller authorization, as well as configuring action behaviour.

Also piggybacks a change in the way Permit.Phoenix.Plug is used from within Permit.Phoenix.Controller - it's now used directly as a plug module. Moreover, you can no longer use this plug directly from a controller and this is reflected in raising an error when it is attempted - and the moduledoc has been removed in favour of a better documentation in Permit.Phoenix.Controller.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring
  • Test improvements
  • CI/CD improvements

Related Issues

Fixes #36

Changes Made

  • Documentation updates
  • Permit.Phoenix.Plug used as plug module

Testing

Test suite passing without modification.

Test Environment

  • Elixir version: 1.19.3
  • OTP version: 28
  • Phoenix version: 1.8.1
  • LiveView version: 1.1.17
  • Database (if applicable): PostgreSQL 15

Test Cases

  • All existing tests pass
  • New tests added for new functionality at appropriate levels
  • Manual testing performed
  • Controller integration tests (if applicable)
  • LiveView integration tests (if applicable)
  • Router integration tests (if applicable)

Test Commands Run

# List the commands you ran to test
mix test
MIX_ENV=test mix credo
MIX_ENV=test mix dialyzer

Documentation

  • Updated README.md (if applicable)
  • Updated documentation comments (with examples for new features)
  • Updated CHANGELOG.md (if applicable)
  • Updated controller/LiveView usage examples (if applicable)

Code Quality

  • Code follows the existing style conventions
  • Self-review of the code has been performed
  • Code has been commented, particularly in hard-to-understand areas
  • No new linting warnings introduced
  • No new Dialyzer warnings introduced
  • Follows Phoenix and LiveView conventions

Phoenix/LiveView Specific

  • Controller changes properly handle conn state
  • LiveView changes properly handle socket state
  • Router integration works correctly
  • Error handling follows Phoenix patterns
  • Authorization flows work as expected

Backward Compatibility

  • This change is backward compatible
  • This change includes breaking changes (please describe below)
  • Migration guide provided for breaking changes

Breaking Changes

Performance Impact

  • No performance impact
  • Performance improvement
  • Potential performance regression (please describe)

Performance Notes

Security Considerations

  • No security impact
  • Security improvement
  • Potential security impact (please describe)

Additional Notes

Screenshots/Examples

Checklist

  • I have read the Contributing Guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Reviewer Notes


@vincentvanbush vincentvanbush linked an issue Dec 22, 2025 that may be closed by this pull request
6 tasks
@vincentvanbush vincentvanbush force-pushed the 36-feature-documentation-improvements branch from 8a4c848 to 13d22c6 Compare December 22, 2025 14:20
- `push_navigate(socket, to: socket.view.fallback_path(action, socket))` is done if the LiveView is in the mounting phase,
- `fallback_path` defaults to the current `_live_referer` path if available, otherwise it is `/`. This means that if using the [link](https://hexdocs.pm/phoenix_live_view/Phoenix.Component.html#link/1) component with `:navigate` option within the current session, we will still be able to navigate back to the currently displayed page, even though it will go through the mounting phase.
- Permit dependency bumped to 0.3.1 to fix curiosum-dev/permit#49.
- Major improvements to documentation and examples. It's now much easier to get started with the library in an existing project.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@vincentvanbush vincentvanbush merged commit 48c8905 into main Dec 23, 2025
73 checks passed
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.

[Feature]: Documentation improvements

2 participants