bullet_train 1.0.51 → 1.0.52
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/layouts/docs.html.erb +6 -0
- data/docs/getting-started.md +1 -1
- data/docs/index.md +1 -0
- data/docs/indirection.md +1 -1
- data/docs/javascript.md +18 -0
- data/docs/permissions.md +1 -1
- data/lib/bullet_train/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1684991a84caecbd6443e86aee17ac146ff70e71bec64607205e3266642c7af5
|
4
|
+
data.tar.gz: 9e00e826c90b30ac09e5daf147b0d10e29e036ff29b039f321a6c9de04441936
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44d566105ccc88677771b87a23e0fd11b9ac8548bff4d6a26bed538a5ac94fdb57bfde0c0f8222fded9afbcf7c3d6de5e2bf04f8b7603eb9c92507ebd529bb36
|
7
|
+
data.tar.gz: b72dfdb3f0369bf6829ba8e47bddf50781bd33e39ac21f877923b389cb2fb690572f479107eaa83e120fd88dcfdd240e7cd18ad7ed18f42b98f87d5a79e46ced
|
@@ -104,6 +104,12 @@
|
|
104
104
|
<i class="fal fa-bolt ti ti-bolt"></i>
|
105
105
|
<% end %>
|
106
106
|
<% end %>
|
107
|
+
|
108
|
+
<%= render 'account/shared/menu/item', url: '/docs/javascript', label: 'JavaScript' do |p| %>
|
109
|
+
<% p.content_for :icon do %>
|
110
|
+
<i class="fa-brands fa-js ti ti-pulse"></i>
|
111
|
+
<% end %>
|
112
|
+
<% end %>
|
107
113
|
<% end %>
|
108
114
|
|
109
115
|
<%= render 'account/shared/menu/section', title: 'Developer Tools' do %>
|
data/docs/getting-started.md
CHANGED
@@ -51,5 +51,5 @@ If you're using Bullet Train for the first time, begin by learning these five im
|
|
51
51
|
And then paste any input, e.g.:
|
52
52
|
|
53
53
|
```
|
54
|
-
<!-- BEGIN /Users/andrewculver/.rbenv/versions/3.1.
|
54
|
+
<!-- BEGIN /Users/andrewculver/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bullet_train-themes-light-1.0.10/app/views/themes/light/commentary/_box.html.erb -->
|
55
55
|
```
|
data/docs/index.md
CHANGED
@@ -12,6 +12,7 @@
|
|
12
12
|
- [Dealing with Indirection](/docs/indirection.md)
|
13
13
|
- [Overriding the Framework](/docs/overriding.md)
|
14
14
|
- [Setting up a Tunnel](/docs/tunneling.md)
|
15
|
+
- [JavaScript](/docs/javascript.md)
|
15
16
|
|
16
17
|
## Developer Tools
|
17
18
|
- [Super Scaffolding](/docs/super-scaffolding.md)
|
data/docs/indirection.md
CHANGED
@@ -35,7 +35,7 @@ bin/resolve shared/box
|
|
35
35
|
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 enables `config.action_view.annotate_rendered_view_with_filenames` 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:
|
36
36
|
|
37
37
|
```
|
38
|
-
<!-- BEGIN /Users/andrewculver/.rbenv/versions/3.1.
|
38
|
+
<!-- BEGIN /Users/andrewculver/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bullet_train-themes-light-1.0.10/app/views/themes/light/workflow/_box.html.erb -->
|
39
39
|
```
|
40
40
|
|
41
41
|
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 Framework Defaults](/docs/overriding.md).
|
data/docs/javascript.md
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# JavaScript
|
2
|
+
Bullet Train leans into the use of [Stimulus](https://stimulus.hotwired.dev) for custom JavaScript. If you haven't read it already, we consider [the original introductory blog post for Stimulus](https://medium.com/signal-v-noise/stimulus-1-0-a-modest-javascript-framework-for-the-html-you-already-have-f04307009130) to be a seminal work in the Rails ecosystem and consider it required reading for understanding the philosophy of JavaScript in Bullet Train.
|
3
|
+
|
4
|
+
## Writing Custom JavaScript
|
5
|
+
The happy path for writing new custom JavaScript is to [write it as a Stimulus controller](https://stimulus.hotwired.dev/handbook/building-something-real) in `app/javascript/controllers` and invoke it by augmenting the HTML in your views. If you name the file `*_controller.js`, it will be automatically picked up and compiled as part of your application's JavaScript bundle.
|
6
|
+
|
7
|
+
## npm Packages
|
8
|
+
npm packages are managed by [Yarn](https://yarnpkg.com) and any required importing can be done in `app/javascript/application.js`.
|
9
|
+
|
10
|
+
## Compilation
|
11
|
+
Bullet Train uses [esbuild](https://esbuild.github.io) to compile all local JavaScript and npm package dependencies. If you haven't used esbuild before, it's blazing fast compared to older options like Webpack. Honestly, it makes JavaScript development and deployment in complex applications a joy again, in a way it hasn't been for years.
|
12
|
+
|
13
|
+
In development, the esbuild process that compiles JavaScript is defined as `yarn build` in `package.json`. This script also has an entry in `Procfile.dev`, so it runs automatically when you start your application with `bin/dev`, and when run in this context, it watches the filesystem and automatically recompiles anytime JavaScript files change on disk.
|
14
|
+
|
15
|
+
The resulting JavaScript bundle is output to the `app/assets/builds` directory where it is picked up by the traditional Rails asset pipeline. This directory is listed in `.gitignore`, so the compiled bundles are never committed to the repository.
|
16
|
+
|
17
|
+
## React, Vue.js, etc.
|
18
|
+
We're not against the use of front-end JavaScript frameworks in the specific contexts where they're the best tool for the job, but we solidly subscribe to the "heavy machinery" philosophy put forward in [the original Stimulus blog post](https://medium.com/signal-v-noise/stimulus-1-0-a-modest-javascript-framework-for-the-html-you-already-have-f04307009130), and have no interest in actually supporting them.
|
data/docs/permissions.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
Bullet Train leans heavily on [CanCanCan](https://github.com/CanCanCommunity/cancancan) for implementing authorization and permissions. (We’re also proud sponsors of its ongoing maintenance.) The original CanCan library by Ryan Bates was, in our opinion, a masterpiece and a software engineering marvel that has stood the test of time. It's truly a diamond among Ruby Gems. If you're not already familiar with CanCanCan, you should [read its documentation](https://github.com/CanCanCommunity/cancancan) to get familiar with its features and DSL.
|
5
5
|
|
6
6
|
## Bullet Train Roles
|
7
|
-
Over many years of successfully implementing applications with CanCanCan, it became apparent to us that a supplemental level of abstraction could help streamline and simplify the definition of many common permissions, especially in large applications. We've since extracted this functionality into [a standalone Ruby Gem](https://github.com/bullet-train-co/bullet_train-roles) and moved the documentation that used to be here into [the README for that project](https://github.com/bullet-train-co/bullet_train-roles
|
7
|
+
Over many years of successfully implementing applications with CanCanCan, it became apparent to us that a supplemental level of abstraction could help streamline and simplify the definition of many common permissions, especially in large applications. We've since extracted this functionality into [a standalone Ruby Gem](https://github.com/bullet-train-co/bullet_train-roles) and moved the documentation that used to be here into [the README for that project](https://github.com/bullet-train-co/bullet_train-roles). Should you encounter situations where this abstraction doesn't meet your specific needs, you can always implement the permissions you need using standard CanCanCan directives in `app/models/ability.rb`.
|
8
8
|
|
9
9
|
## Additional Notes
|
10
10
|
|
data/lib/bullet_train/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bullet_train
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.52
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Culver
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-04-
|
11
|
+
date: 2022-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: standard
|
@@ -576,6 +576,7 @@ files:
|
|
576
576
|
- docs/i18n.md
|
577
577
|
- docs/index.md
|
578
578
|
- docs/indirection.md
|
579
|
+
- docs/javascript.md
|
579
580
|
- docs/modeling.md
|
580
581
|
- docs/namespacing.md
|
581
582
|
- docs/oauth.md
|