bullet_train 1.0.38 → 1.0.39

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0dcb39f530a513954bbf81e5776d8dfa80bcb5337d06006c60ed785fe753938d
4
- data.tar.gz: 17a0381fe935017c676fcb300c6b7e77e2d13cb0db995732c8bf927a6010880c
3
+ metadata.gz: '009427e1dff7701f4deba63c9a694d09a6aad55d9f1318bf6112b9f966541656'
4
+ data.tar.gz: 8a7921519a530a8ff249f46df39aa5333f418aed37dd74a86805c3f00901ea39
5
5
  SHA512:
6
- metadata.gz: 33f012230c149f0db16994bc23e779d0650abfa210b0f986173e0c2adae19e4511cb0184b90b1963393becb7d48805a705d969b05c3a6aa34f6dbe5853d488d3
7
- data.tar.gz: 9c2c749b3ebc93c990961a46d666b5273774b12a53f6ee37f8e5cb080863d9b5a62714a9dac4955ead6347fb43b8654331373471614a2ed3e5c7aec206cf0bfc
6
+ metadata.gz: 362e18f33946b19ce2916703680130fece22a6febdf7c65e5d064419940caf1dc966d8e520ae1b5d83c1f47934db9613d3f7c3687c8df964740682fc4ce95f21
7
+ data.tar.gz: 809da6bb23bfb337a578af7aeb821b18e752f0a8b196e8808d4117121eae7cfb6f24d721ec504b36e01840ed6661fc0116b80b602ba0990e1afdc8d72aff1444
data/docs/indirection.md CHANGED
@@ -1,53 +1,3 @@
1
- # Dealing with Indirection
1
+ # Overriding Framework Defaults
2
2
 
3
- ## The Problem with Indirection
4
-
5
- In software development, indirection is everywhere and takes many forms.
6
-
7
- For example, in vanilla Rails development, you introduce a type of indirection when you extract a button label out of a view file and use the `t` helper to render the string from a translation YAML file. In the future, when another developer goes to update the button label, they will first open the view, they'll see `t(".submit")` and then have to reason a little bit about which translation file they need to open up in order to update that label.
8
-
9
- Our goal in Bullet Train is to improve developer experience, not reduce it, so it was important that along with any instances of indirection we were introducing, we also included new tooling to ensure it was never a burden to developers. Thankfully, in practice we found that some of this new tooling improves even layers of indirection that have always been with us in Rails development.
10
-
11
- ## Solving Indirection in Views
12
-
13
- ### Resolving Partial Paths with `bin/resolve`
14
-
15
- Even in vanilla Rails development, when you're looking at a view file, the path you see passed to a `render` call isn't the actual file name of the partial that will be rendered. This is even more true in Bullet Train where certain partial paths are [magically served from theme gems](/docs/themes.md).
16
-
17
- `bin/resolve` makes it easy to figure out where where a partial is being served from:
18
-
19
- ```
20
- $ bin/resolve shared/box
21
- ```
22
-
23
- ### Exposing Rendered Views with Xray
24
-
25
- > TODO Is this still true in Rails 7? Does it not do something like this by default now?
26
-
27
- If you're looking at a rendered view in the browser, it can be hard to know which file to open in order to make a change. To help, Bullet Train includes [Xray](https://github.com/brentd/xray-rails) by default, so you can right click on any element you see, select "Inspect Element", and you'll see comments in the HTML source telling you which file is powering a particular portion of the view, like this:
28
-
29
- ```
30
- <!--XRAY START 90 /Users/andrewculver/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/bullet_train-themes-light-1.0.10/app/views/themes/light/workflow/_box.html.erb-->
31
- ```
32
-
33
- Note that in the example above, the view in question isn't actually coming from the application repository. Instead, it's being included from the `bullet_train-themes-light` package. For instructions on how to customize it, see [Overriding the Framework](/docs/override).
34
-
35
- ### Drilling Down on Translation Keys
36
-
37
- Even in vanilla Rails applications, extracting strings from view files into I18N translation YAML files introduces a layer of indirection. Bullet Train tries to improve the resulting DX with a couple tools that make it easier to figure out where a translation you see in your browser is coming from.
38
-
39
- #### Show Translation Keys in the Browser with `?show_locales=true`
40
-
41
- You can see the full translation key of any string on the page by adding `?show_locales=true` to the URL.
42
-
43
- #### Log Translation Keys to the Console with `?log_locales=true`
44
-
45
- You can also log all the translation key for anything being rendered to the console by adding `?log_locales=true` to the request URL. This can make it easier to copy and paste translation keys for strings that are rendered in non-selectable UI elements.
46
-
47
- #### Resolving Translation Keys with `bin/resolve`
48
-
49
- Once you have the full I18N translation key, you can use `bin/resolve` to figure out which package and file it's coming from. At that point, if you need to customize it, you can also use the `--eject` option to copy the the framework for customization in your local application:
50
-
51
- ```
52
- $ bin/resolve en.account.onboarding.user_details.edit.header --eject --open
53
- ```
3
+ > TODO This section needs to be written.
@@ -0,0 +1,53 @@
1
+ # Dealing with Indirection
2
+
3
+ ## The Problem with Indirection
4
+
5
+ In software development, indirection is everywhere and takes many forms.
6
+
7
+ For example, in vanilla Rails development, you introduce a type of indirection when you extract a button label out of a view file and use the `t` helper to render the string from a translation YAML file. In the future, when another developer goes to update the button label, they will first open the view, they'll see `t(".submit")` and then have to reason a little bit about which translation file they need to open up in order to update that label.
8
+
9
+ Our goal in Bullet Train is to improve developer experience, not reduce it, so it was important that along with any instances of indirection we were introducing, we also included new tooling to ensure it was never a burden to developers. Thankfully, in practice we found that some of this new tooling improves even layers of indirection that have always been with us in Rails development.
10
+
11
+ ## Solving Indirection in Views
12
+
13
+ ### Resolving Partial Paths with `bin/resolve`
14
+
15
+ Even in vanilla Rails development, when you're looking at a view file, the path you see passed to a `render` call isn't the actual file name of the partial that will be rendered. This is even more true in Bullet Train where certain partial paths are [magically served from theme gems](/docs/themes.md).
16
+
17
+ `bin/resolve` makes it easy to figure out where where a partial is being served from:
18
+
19
+ ```
20
+ $ bin/resolve shared/box
21
+ ```
22
+
23
+ ### Exposing Rendered Views with Xray
24
+
25
+ > TODO Is this still true in Rails 7? Does it not do something like this by default now?
26
+
27
+ If you're looking at a rendered view in the browser, it can be hard to know which file to open in order to make a change. To help, Bullet Train includes [Xray](https://github.com/brentd/xray-rails) by default, so you can right click on any element you see, select "Inspect Element", and you'll see comments in the HTML source telling you which file is powering a particular portion of the view, like this:
28
+
29
+ ```
30
+ <!--XRAY START 90 /Users/andrewculver/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/bullet_train-themes-light-1.0.10/app/views/themes/light/workflow/_box.html.erb-->
31
+ ```
32
+
33
+ Note that in the example above, the view in question isn't actually coming from the application repository. Instead, it's being included from the `bullet_train-themes-light` package. For instructions on how to customize it, see [Overriding the Framework](/docs/override).
34
+
35
+ ### Drilling Down on Translation Keys
36
+
37
+ Even in vanilla Rails applications, extracting strings from view files into I18N translation YAML files introduces a layer of indirection. Bullet Train tries to improve the resulting DX with a couple tools that make it easier to figure out where a translation you see in your browser is coming from.
38
+
39
+ #### Show Translation Keys in the Browser with `?show_locales=true`
40
+
41
+ You can see the full translation key of any string on the page by adding `?show_locales=true` to the URL.
42
+
43
+ #### Log Translation Keys to the Console with `?log_locales=true`
44
+
45
+ You can also log all the translation key for anything being rendered to the console by adding `?log_locales=true` to the request URL. This can make it easier to copy and paste translation keys for strings that are rendered in non-selectable UI elements.
46
+
47
+ #### Resolving Translation Keys with `bin/resolve`
48
+
49
+ Once you have the full I18N translation key, you can use `bin/resolve` to figure out which package and file it's coming from. At that point, if you need to customize it, you can also use the `--eject` option to copy the the framework for customization in your local application:
50
+
51
+ ```
52
+ $ bin/resolve en.account.onboarding.user_details.edit.header --eject --open
53
+ ```
@@ -1,3 +1,3 @@
1
1
  module BulletTrain
2
- VERSION = "1.0.38"
2
+ VERSION = "1.0.39"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.38
4
+ version: 1.0.39
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
@@ -552,6 +552,7 @@ files:
552
552
  - docs/namespacing.md
553
553
  - docs/oauth.md
554
554
  - docs/onboarding.md
555
+ - docs/overriding.md
555
556
  - docs/permissions.md
556
557
  - docs/seeds.md
557
558
  - docs/super-scaffolding.md