Skip to content

Commit

Permalink
Remove more ActiveStorage stuff and get blueimp working without a gem
Browse files Browse the repository at this point in the history
  • Loading branch information
smellsblue committed Jun 25, 2024
1 parent 8c98866 commit c0513ea
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 33 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
ruby File.read(File.join(__dir__, ".ruby-version")).strip
source "https://rubygems.org"

#gem "blueimp-templates-rails"
gem "bootstrap-datepicker-rails"
gem "bootstrap-guardsjs-rails"
gem "chartkick"
Expand Down
1 change: 0 additions & 1 deletion app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,5 @@
//= require bootstrap-guards
//= require local_time
//= require select2-full
//= require tmpl
//= require twitter/bootstrap/rails/confirm
//= require_tree .
3 changes: 3 additions & 0 deletions app/javascript/packs/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@
//
// const images = require.context('../images', true)
// const imagePath = (name) => images(name, true)

require("blueimp-tmpl")
window.tmpl = tmpl;
1 change: 1 addition & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<title><%= Rails.application.config.site_name %><%= " - #{content_for(:title)}" if content_for(:title).present? %></title>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_pack_tag 'application', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
<%= render partial: "common/google_analytics" %>
Expand Down
1 change: 1 addition & 0 deletions app/views/layouts/blank_print.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<title><%= Rails.application.config.site_name %><%= " - #{content_for(:title)}" if content_for(:title).present? %></title>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_pack_tag 'application', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
<%= render partial: "common/google_analytics" %>
Expand Down
9 changes: 9 additions & 0 deletions config/webpack/environment.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
const { environment } = require('@rails/webpacker')
const coffee = require('./loaders/coffee')

const webpack = require('webpack')
environment.plugins.prepend('Provide',
new webpack.ProvidePlugin({
tmpl: 'blueimp-tmpl/js/tmpl'
})
)

environment.loaders.prepend('coffee', coffee)
module.exports = environment
6 changes: 6 additions & 0 deletions config/webpack/loaders/coffee.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
test: /\.coffee(\.erb)?$/,
use: [{
loader: 'coffee-loader'
}]
}
3 changes: 2 additions & 1 deletion config/webpacker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ default: &default
- .woff2

extensions:
- .coffee
- .mjs
- .js
- .sass
Expand Down Expand Up @@ -79,7 +80,7 @@ test:
# Compile test packs to a separate directory
public_output_path: packs-test

production:
production: &production
<<: *default

# Production depends on precompilation of packs prior to booting for performance.
Expand Down

This file was deleted.

This file was deleted.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"dependencies": {
"@rails/webpacker": "5.4.3",
"blueimp-tmpl": "^3.20.0",
"coffee-loader": "^1.0.1",
"coffeescript": "1.12.7",
"webpack": "^4.46.0",
"webpack-cli": "^3.3.12"
},
Expand Down
18 changes: 18 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1538,6 +1538,11 @@ bluebird@^3.5.5:
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f"
integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==

blueimp-tmpl@^3.20.0:
version "3.20.0"
resolved "https://registry.yarnpkg.com/blueimp-tmpl/-/blueimp-tmpl-3.20.0.tgz#bed897db362c70d3740e0ad1020ce84bfa15ceaa"
integrity sha512-g6ln9L+VX8ZA4WA8mgKMethYH+5teroJ2uOkCvcthy9Y9d9LrQ42OAMn+r3ECKu9CB+xe9GOChlIUJBSxwkI6g==

bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.9:
version "4.12.0"
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88"
Expand Down Expand Up @@ -1945,6 +1950,19 @@ coa@^2.0.2:
chalk "^2.4.1"
q "^1.1.2"

coffee-loader@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/coffee-loader/-/coffee-loader-1.0.1.tgz#f672c4b2ea358e039f702ad590148f7a1dda77f0"
integrity sha512-l3lcWeyNE11ZXNYEpkIkerrvBdSpT06/kcR7MyY+0ys38MOuqzhr+s+s7Tsvv2QH1+qEmhvG8mGuUWIO2zH7Bg==
dependencies:
loader-utils "^2.0.0"
schema-utils "^3.0.0"

coffeescript@1.12.7:
version "1.12.7"
resolved "https://registry.yarnpkg.com/coffeescript/-/coffeescript-1.12.7.tgz#e57ee4c4867cf7f606bfc4a0f2d550c0981ddd27"
integrity sha512-pLXHFxQMPklVoEekowk8b3erNynC+DVJzChxS/LCBBgR6/8AJkHivkm//zbowcfc7BTCAjryuhx6gPqPRfsFoA==

collection-visit@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0"
Expand Down

0 comments on commit c0513ea

Please sign in to comment.