-
-
Notifications
You must be signed in to change notification settings - Fork 270
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
🚨 refactor: better engine mounting #3533
Open
adrianthedev
wants to merge
26
commits into
main
Choose a base branch
from
refactor/better-engine-mounting
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
69e0f5a
refactor: better engine mounting
adrianthedev 80f4850
Merge branch 'main' into refactor/better-engine-mounting
Paul-Bob 9c17530
wip
Paul-Bob 7e3004c
lint
Paul-Bob c4a3288
rm
Paul-Bob 8e03308
logger
Paul-Bob 286496b
syntax
Paul-Bob d3d8144
avoid double boot
Paul-Bob 8f74693
rm boot from
Paul-Bob ed1bfa5
Merge branch 'main' into refactor/better-engine-mounting
Paul-Bob 59d2000
fix engine mounting point
Paul-Bob a3cf5ce
apply review requests
Paul-Bob 5bb3ae4
Merge branch 'main' into refactor/better-engine-mounting
Paul-Bob 775342c
mount_avo
Paul-Bob 6e3da26
reset plugin_manager on boot
Paul-Bob 47d9b7e
test
Paul-Bob edf398f
use gem name as plugin for `avo-dashboards`
Paul-Bob 2e7e47b
Merge branch 'main' into refactor/better-engine-mounting
Paul-Bob 2a98a3e
use gem name as plugin for `avo-menu`
Paul-Bob 8d4504a
use gem name as plugin for `avo-menu`
Paul-Bob f74c82c
Merge branch 'main' into refactor/better-engine-mounting
Paul-Bob 9cd2c04
lint
Paul-Bob bcc0820
revert anonymous kwargs
Paul-Bob 21c1ef6
ignore anonymous args
Paul-Bob 5733c74
ignore correct rule
Paul-Bob 64e8ea2
use gem name as plugin for `avo-pro`
Paul-Bob File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,8 @@ class Engine < ::Rails::Engine | |
# Ensure we reboot the app when something changes | ||
config.to_prepare do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't we still need this for reloading the code? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's run this only in development |
||
# Boot Avo | ||
::Avo.boot | ||
# TODO: I think we can remove this | ||
# ::Avo.boot | ||
end | ||
|
||
initializer "avo.autoload" do |app| | ||
|
@@ -59,6 +60,17 @@ class Engine < ::Rails::Engine | |
app.config.watchable_dirs[directory_path] = [:rb] | ||
end | ||
end | ||
|
||
# Add the mount_avo method to Rails | ||
ActionDispatch::Routing::Mapper.include(Module.new { | ||
def mount_avo(at: Avo.configuration.root_path, **options) | ||
Paul-Bob marked this conversation as resolved.
Show resolved
Hide resolved
|
||
mount Avo::Engine, at:, **options | ||
Paul-Bob marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Avo.plugin_manager.engines.each do |engine| | ||
mount engine[:klass], **engine[:options] | ||
end | ||
end | ||
}) | ||
end | ||
|
||
initializer "avo.reloader" do |app| | ||
|
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same. Raise and error with docs links.