-
Notifications
You must be signed in to change notification settings - Fork 194
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
Componentisation proof of concept #9154
Closed
Closed
Commits on Jun 17, 2024
-
This will allow us to define packages and identify where packages have dependencies outside their domain, and manually specify dependencies where necessary https://github.com/Shopify/packwerk
Configuration menu - View commit details
-
Copy full SHA for d666a11 - Browse repository at this point
Copy the full SHA d666a11View commit details -
Load all Rails engines in
packages
on bootIn the next commit, we’ll add a Rails engine to the `packages` directory, which we will autoload on boot. Engines will also contain routes, which we will add to the routes configuration, so we can include routes in the main routes.rb file.
Configuration menu - View commit details
-
Copy full SHA for 2afa50b - Browse repository at this point
Copy the full SHA 2afa50bView commit details -
Include all tests and factories from packages
To improve visibility, tests will be included in their relevant pacakages, so we’ll need to ensure all test-related files are included during the test run
Configuration menu - View commit details
-
Copy full SHA for e3b3f91 - Browse repository at this point
Copy the full SHA e3b3f91View commit details -
Add an Emergency Banner package
This adds the engine code in `lib` to define the engine, and moves the code involved in the Emergency Banner (including the tests) to the package directory, shaped as a mini-Rails app. The routes for this package are defined in a routes file, and then loaded in the main routes file with the `draw` method. We also define a package in package.yml that tells Packwerk to enforce dependencies. Running `packwerk update-todo` adds a `package_todo.yml` file, which shows us where dependencies are being loaded in from other parts of the application.
Configuration menu - View commit details
-
Copy full SHA for 7f7d5c8 - Browse repository at this point
Copy the full SHA 7f7d5c8View commit details -
This can eventually contain all code that other packages depend on, including base controllers, models and some components that are used across the application. We can now define the base package and dependencies in our package and run `packwerk update-todo`, which removes the `package-todo` file in our exiting package. We also update our root application to enforce dependencies and add the base package as a dependency. This ensures that the root application doesn’t use any code in any of our packages, unless a dependency is defined.
Configuration menu - View commit details
-
Copy full SHA for 9ce1ff4 - Browse repository at this point
Copy the full SHA 9ce1ff4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 27f8239 - Browse repository at this point
Copy the full SHA 27f8239View commit details -
Add brackets to arguments in view
There is an open bug in Packwerk when shorthand hash syntax is used in views (Shopify/packwerk#278). Adding brackets seems to fix it
Configuration menu - View commit details
-
Copy full SHA for 0445b45 - Browse repository at this point
Copy the full SHA 0445b45View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3a02f0e - Browse repository at this point
Copy the full SHA 3a02f0eView commit details -
Configuration menu - View commit details
-
Copy full SHA for a09ec2c - Browse repository at this point
Copy the full SHA a09ec2cView commit details
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.