8000 GitHub - drwl/rails6-cbra: Rails 6 app following Component-based rails application book (cbra.info)
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on May 5, 2023. It is now read-only.

drwl/rails6-cbra

Repository files navigation

Rails 6 practice application

This applications follows along Component-based Rails Applications book by Stephan Hagemann.

More information: https://cbra.info/

Notes

Chapter 3.7

Discusses another way to structure project files and code, following a keynote by Robert C. Martin (Uncle Bob) https://www.youtube.com/watch?v=WpkDN78P884.

I'm not totally sold on this approach, but will clarify with Stephan on his thoughts in 2020.

Chapter 3.6 / Page 90

On updating dependencies, Stephan says

If you are following my advice to lock down dependency versions in your gemspec for external dependencies and if the gem is being used in several (or even many) of the app’s components, this process is not quite as straightforward. Within all components, we will have to update the version and in all of them we have to update the bundle.

Right now, I don't know why a dependency needs to be updated for all components.

In this section, he also gives some tips on handling Rails upgrades.

Chapter 3.3 / Page 74

It goes into asset loading for components and tries to add ZURB to Sportsball. I'm skipping working through this section for now since it looks like it'll be another rabbit hole. A great overview of the differences in Rails 6: https://prathamesh.tech/2019/08/26/understanding-webpacker-in-rails-6/

  • Stephan notes to explicitly install frontend libraries instead of relying on the ruby gem version for various reasons (Page 77-78)

Page 50

At the start of Chapter 3, the book says to regenerate the project from a script. There's considerable differences between this project and what gets generated due to using Rails 5 versus Rails 6. Notably:

Page 39-40

Author makes argument for locking down dependencies with specific versions. This is done to ensure there's no drift between what's tested and what's in production.

Question: What happens if components have dependencies on the same gem, but of different versions. Does the component structure ensure there is no interference or namespace collision?.

Page 31

I had no issue running bin/rails db:drop db:create db:migrate from the main app.

Issues Encountered

Page 68

When running ./build.sh I ran into permission denied. This was because a node module has a test.sh file and the build script was trying to run it. To bypass this I've modified the build.sh file to ignore ./node_modules/ directory.

Page 50, 60-63

I had trouble getting engine route/url helpers working in request specs, where they seemed to work in controller specs. Refer to rspec/rspec-rails#2368 for more information.

Page 46-47

After creating the prediction code and referencing the path helpers, we need to add it to components/app_component/config/routes.rb. Otherwise I see undefined local variable or method new_prediction_path'when loadinglocalhost:3000`.

I've created an errata ticket for it.

Page 28

ArgumentError: Trying to register Bundler::GemfileError for status code 4 but Bundler::GemfileError is already registered

After generating game and team scaffolds, when trying to run bin/rails db:migrate in components/app_component, I ran into the above issue. This was an issue with rubygems, updating your rubygems to the latest should fix it.

gem update --system

Link to the Github issue on rubygems repo.

About

Rails 6 app following Component-based rails application book (cbra.info)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0