-
-
Notifications
You must be signed in to change notification settings - Fork 504
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
WIP: Enable and use import maps #3209
Changes from all commits
33d8492
e0e2e78
f09e678
fa0582e
cf854ca
13fe042
61fb082
aa197d9
e9acb69
5ca5af3
86f0b7e
16f681d
14ed05d
e1f458e
24c0cdc
d541c86
166dfd4
312abdc
fc0ba8d
d2b60a0
f594a06
e68559b
12db666
7f726bc
87a8abc
a43f355
28d2de5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
web: bundle exec rails s -p 3000 | ||
worker: bundle exec rails jobs:work | ||
webpack: bin/webpack-dev-server |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
//= link filterrific/filterrific-spinner.gif | ||
//= link_tree ../images | ||
//= link_directory ../javascripts .js | ||
//= link_directory ../stylesheets .css | ||
//= link_tree ../../javascript .js | ||
//= link_tree ../../../vendor/javascript .js |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,41 @@ | ||
/* eslint no-console:0 */ | ||
// This file is automatically compiled by Webpack, along with any other files | ||
// present in this directory. You're encouraged to place your actual application logic in | ||
// a relevant structure within app/javascript and only use these pack files to reference | ||
// that code so it'll be compiled. | ||
// | ||
// To reference this file, add <%= javascript_pack_tag 'application' %> to the appropriate | ||
// layout file, like app/views/layouts/application.html.erb | ||
// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails | ||
|
||
import { Turbo } from "@hotwired/turbo-rails" | ||
|
||
// Disable turbo by default to avoid issues with turbolinks | ||
Turbo.session.drive = false | ||
import jQuery from 'jquery' | ||
window.jQuery = jQuery | ||
window.$ = jQuery | ||
|
||
import "../controllers/index" | ||
import 'admin-lte' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @heyapricot i was able to make the sidenav work again by importing it here after pinning it. |
||
import "cocoon-js-vanilla"; | ||
import 'filterrific' | ||
import { Turbo } from "@hotwired/turbo-rails" | ||
import "trix" | ||
import "@rails/actiontext" | ||
import "stylesheets/application.scss" | ||
import $ from 'jquery'; | ||
|
||
import {DateTime} from "luxon"; | ||
import Litepicker from 'litepicker'; | ||
import 'litepicker'; | ||
import { Calendar } from '@fullcalendar/core'; | ||
import luxonPlugin from '@fullcalendar/luxon' | ||
import dayGridPlugin from '@fullcalendar/daygrid'; | ||
import listPlugin from '@fullcalendar/list'; | ||
import toastr from 'toastr'; | ||
import 'litepicker/dist/plugins/ranges'; | ||
import "@fortawesome/fontawesome-free/css/fontawesome.css"; | ||
import "@fortawesome/fontawesome-free/css/solid.css"; | ||
import "@fortawesome/fontawesome-free/css/regular.css"; | ||
import "@fortawesome/fontawesome-free/css/brands.css"; | ||
import "@fortawesome/fontawesome-free/css/v4-shims.css"; | ||
import "toastr/build/toastr.css" | ||
import 'litepicker/ranges'; | ||
|
||
import 'bootstrap' | ||
import 'controllers' | ||
|
||
import 'utils/adjustments' | ||
import 'utils/barcode_items' | ||
import 'utils/barcode_scan' | ||
import 'utils/deadline_day_pickers' | ||
import 'utils/distributions_and_transfers' | ||
import 'utils/donations' | ||
import 'utils/purchases' | ||
|
||
import Rails from "@rails/ujs" | ||
Rails.start() | ||
|
||
// Disable turbo by default to avoid issues with turbolinks | ||
Turbo.session.drive = false | ||
|
||
// Global toastr options | ||
window.toastr = toastr; | ||
|
@@ -47,7 +51,13 @@ function isShortHeightScreen() { | |
return $(window).height() < 768 && !isMobileResolution(); | ||
} | ||
|
||
|
||
// es-module-shims calls DOMContentLoaded twice for some reason | ||
document.addEventListener("DOMContentLoaded", function() { | ||
const hash = window.location.hash; | ||
if (hash) { | ||
$('ul.nav a[href="' + hash + '"]').tab('show'); | ||
} | ||
const isMobile = isMobileResolution(); | ||
const isShortHeight = isShortHeightScreen(); | ||
|
||
|
@@ -96,3 +106,5 @@ document.addEventListener("DOMContentLoaded", function() { | |
}); | ||
picker.setDateRange(startDate, endDate); | ||
}, false); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
// This file is auto-generated by ./bin/rails stimulus:manifest:update | ||
// Run that command whenever you add a new controller or create them with | ||
// ./bin/rails generate stimulus controllerName | ||
// Import and register all your controllers from the importmap under controllers/* | ||
|
||
import { application } from "./application" | ||
import { application } from "controllers/application" | ||
|
||
// Eager load all controllers defined in the import map under controllers/**/*_controller | ||
import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading" | ||
eagerLoadControllersFrom("controllers", application) | ||
|
||
// Lazy load controllers as they appear in the DOM (remember not to preload controllers in import map!) | ||
// import { lazyLoadControllersFrom } from "@hotwired/stimulus-loading" | ||
// lazyLoadControllersFrom("controllers", application) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to downgrade this due to rails/sprockets#749 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the system didn't like this downgrade very much :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In what way?