-
-
Notifications
You must be signed in to change notification settings - Fork 32
Add liveview folder locations to Projectionist #50
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e345d45
add liveview to projectionist
zolrath 2e2b957
consistent type/alternate location
zolrath b2fe239
Update lua/elixir/projectionist/init.lua
zolrath b8255df
Update lua/elixir/projectionist/init.lua
zolrath 1e687ab
add the new html view to projectionist
zolrath 76d604f
add component to projectionist
zolrath 1f9ae72
liveview test generators don't use async, import Phoenix.LiveViewTest
zolrath 55612b3
fix: use correct snakecase function and surround with quotes
mhanberg e012ce6
fix: drop _component from component projection
mhanberg 0dbee40
fix: html template
mhanberg ce14228
fix: path for component tests
mhanberg 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 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
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.
this i would for sure just name
lib/**/components/*.ex.I don't think anyone would be naming their components in a way that would be
<TableComponent.render {@foo}>...</TableComponent.render>(well, at least I wouldn't ever name a component like that).
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.
Hm, okay so you'd also change the module definition to
or would you scope it differently?
Looking through other open source repos
https://github.com/BeaconCMS/beacon/blob/main/lib/beacon_web/live/admin/media_library_live/upload_form_component.ex
Dockyard seems to use _component on BeaconCMS
https://github.com/adoptoposs/adoptoposs/blob/develop/lib/adoptoposs_web/live/project_component.ex
This one seems to too!
https://github.com/qhwa/bonfire/blob/master/lib/bonfire_web/live/reading_state_componnet.ex
Same here
https://github.com/fremantle-industries/slurpee/blob/main/lib/slurpee_web/components/block_number_component.ex
Also here!
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.
We use Surface at my job, which actually has module components, and we don't name them with a "component" suffix 🤷.
But, I'll note that excluding the last link (which was last modified two years ago), those are all examples of LiveComponents, not function components.
I can add a PR that allows to easily override these defaults if that is what you'd like to see.
Uh oh!
There was an error while loading. Please reload this page.
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.
That is true, I suppose what might make sense would be another set of projections that detect
_component.exin the live directory and make live component tests?Though at that point the tests are the same format as normal LiveViews I believe so hm, no action needed!
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.
Yeah I did realize that there wasn't one for live components.
nor the new _json convention.
a PR for either/both of those would great!