Skip to content
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

feat: add CoreComponents from fresh Phoenix 1.7 app #976

Merged
merged 17 commits into from
Jun 13, 2024

Conversation

meagharty
Copy link
Collaborator

@meagharty meagharty commented Jun 5, 2024

Summary of changes

Relates to https://app.asana.com/0/584764604969369/1207488912719156

  • Adds CoreComponent file from fresh Phoenix 1.7 app
  • Adds verified route functionality (optional in this upgrade guide) because CoreComponents uses it
    • Allows use of sigil paths ~p
  • Separates out css build from js build, uses Tailwind to build the css (existing app css and CoreComponents css)
    • Supports tree-shaking css used in heex files
    • Required adding lib to the Dockerfile before running mix assets.deploy

Tested with phoenix generators in #978

Reviewer Checklist

  • Meets ticket's acceptance criteria
  • Any new or changed functions have typespecs
  • Tests were added for any new functionality (don't just rely on Codecov)
  • This branch was deployed to the staging environment and is currently running with no unexpected increase in warnings, and no errors or crashes.

Copy link

github-actions bot commented Jun 5, 2024

Coverage of commit 91222d0

Summary coverage rate:
  lines......: 72.9% (666 of 914 lines)
  functions..: 58.0% (507 of 874 functions)
  branches...: no data found

Files changed coverage rate:
                                                                     |Lines       |Functions  |Branches    
  Filename                                                           |Rate     Num|Rate    Num|Rate     Num
  =========================================================================================================
  lib/arrow_web.ex                                                   | 0.0%      2| 0.0%     8|    -      0
  lib/arrow_web/components/core_components.ex                        | 0.0%    167| 0.0%    38|    -      0

Download coverage report

Copy link

github-actions bot commented Jun 5, 2024

Coverage of commit a7ee6f2

Summary coverage rate:
  lines......: 73.1% (668 of 914 lines)
  functions..: 58.4% (510 of 874 functions)
  branches...: no data found

Files changed coverage rate:
                                                                     |Lines       |Functions  |Branches    
  Filename                                                           |Rate     Num|Rate    Num|Rate     Num
  =========================================================================================================
  lib/arrow_web.ex                                                   | 100%      2|37.5%     8|    -      0
  lib/arrow_web/components/core_components.ex                        | 0.0%    167| 0.0%    38|    -      0
  lib/arrow_web/endpoint.ex                                          | 100%      2|44.4%    18|    -      0
  test/support/conn_case.ex                                          | 100%     11| 100%     4|    -      0

Download coverage report

@meagharty meagharty marked this pull request as ready for review June 5, 2024 18:14
lib/arrow_web.ex Outdated
@@ -18,6 +18,22 @@ defmodule ArrowWeb do
below. Instead, define any helper function in modules
and import those modules here.
"""
def static_paths, do: ~w(assets fonts images favicon.ico robots.txt)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated this file to match what a new app's lib/app_web.ex looks like.

Verified routes: adds static_paths, verified routes functions from new app
Organization: Moves up router, channel functions
CoreComponents: added with html_helpers function from new app

@@ -20,13 +20,15 @@ defmodule ArrowWeb.ConnCase do

using do
quote do
# The default endpoint for testing
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Re-ordered to matches new app's conn_case.ex

Copy link

github-actions bot commented Jun 5, 2024

Coverage of commit 3eb2ada

Summary coverage rate:
  lines......: 73.1% (668 of 914 lines)
  functions..: 58.4% (510 of 874 functions)
  branches...: no data found

Files changed coverage rate:
                                                                     |Lines       |Functions  |Branches    
  Filename                                                           |Rate     Num|Rate    Num|Rate     Num
  =========================================================================================================
  lib/arrow_web.ex                                                   | 100%      2|37.5%     8|    -      0
  lib/arrow_web/components/core_components.ex                        | 0.0%    167| 0.0%    38|    -      0
  lib/arrow_web/endpoint.ex                                          | 100%      2|44.4%    18|    -      0
  test/support/conn_case.ex                                          | 100%     11| 100%     4|    -      0

Download coverage report

@meagharty
Copy link
Collaborator Author

meagharty commented Jun 6, 2024

I deployed this to dev with #978 so that it could be previewed with a working page from the phx.gen.html generators (that were broken pre-1.7 upgrade but with 1.7 required tailwind configuration for working CSS).

@meagharty meagharty requested review from a team and bklebe and removed request for a team June 6, 2024 15:27
@meagharty meagharty mentioned this pull request Jun 6, 2024
4 tasks
Copy link

github-actions bot commented Jun 7, 2024

Coverage of commit 4823396

Summary coverage rate:
  lines......: 73.1% (668 of 914 lines)
  functions..: 58.4% (510 of 874 functions)
  branches...: no data found

Files changed coverage rate:
                                                                     |Lines       |Functions  |Branches    
  Filename                                                           |Rate     Num|Rate    Num|Rate     Num
  =========================================================================================================
  lib/arrow_web.ex                                                   | 100%      2|37.5%     8|    -      0
  lib/arrow_web/components/core_components.ex                        | 0.0%    167| 0.0%    38|    -      0
  lib/arrow_web/endpoint.ex                                          | 100%      2|44.4%    18|    -      0
  test/support/conn_case.ex                                          | 100%     11| 100%     4|    -      0

Download coverage report

@fsaid90 fsaid90 requested a review from nlwstein June 11, 2024 14:11
@meagharty meagharty force-pushed the meag/add-phx7-core-components branch from 4823396 to f9e89ca Compare June 12, 2024 15:41
Copy link

Coverage of commit f9e89ca

Summary coverage rate:
  lines......: 73.1% (668 of 914 lines)
  functions..: 58.4% (510 of 874 functions)
  branches...: no data found

Files changed coverage rate:
                                                                     |Lines       |Functions  |Branches    
  Filename                                                           |Rate     Num|Rate    Num|Rate     Num
  =========================================================================================================
  lib/arrow_web.ex                                                   | 100%      2|37.5%     8|    -      0
  lib/arrow_web/components/core_components.ex                        | 0.0%    167| 0.0%    38|    -      0
  lib/arrow_web/endpoint.ex                                          | 100%      2|44.4%    18|    -      0
  test/support/conn_case.ex                                          | 100%     11| 100%     4|    -      0

Download coverage report

Copy link
Contributor

@nlwstein nlwstein left a comment

Choose a reason for hiding this comment

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

🚢

@meagharty meagharty merged commit 7e2569e into master Jun 13, 2024
28 checks passed
@meagharty meagharty deleted the meag/add-phx7-core-components branch June 13, 2024 15:05
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.

2 participants