Skip to content
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

Merged
merged 27 commits into from
Feb 22, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
33d8492
WIP: Enable and use import maps
heyapricot Oct 25, 2022
e0e2e78
Fix issue sidenav with nested options not opening
edwinthinks Oct 27, 2022
f09e678
Fix issue in which line items UI supported by cocoon was not working
edwinthinks Oct 28, 2022
fa0582e
Migrate turbo from webpack to importmaps
edwinthinks Oct 28, 2022
cf854ca
Fix dropdown not working
edwinthinks Oct 29, 2022
13fe042
Enabled Stimulus controllers via importmaps
heyapricot Oct 30, 2022
61fb082
Merge branch 'main' into implement-import-maps
edwinthinks Nov 15, 2022
aa197d9
Remove all webpacker steps in favor of importmaps
edwinthinks Nov 15, 2022
e9acb69
Merge branch 'main' into implement-import-maps
edwinthinks Dec 18, 2022
5ca5af3
Remove adding controller that does not exist
edwinthinks Dec 18, 2022
86f0b7e
Update to load stimulus controllers
edwinthinks Dec 18, 2022
16f681d
Fixes for fontawesome, select2, litepicker
Dec 29, 2022
14ed05d
Fixes for modals etc.
Dec 29, 2022
e1f458e
Update other layouts
Dec 29, 2022
24c0cdc
Fix precompile / remove JS
Dec 29, 2022
d541c86
More fixes!
Dec 30, 2022
166dfd4
Fix barcodes!
Dec 30, 2022
312abdc
Add filterrific
Dec 30, 2022
fc0ba8d
Add tab navigation
Dec 30, 2022
d2b60a0
Fix lint
Dec 31, 2022
f594a06
Merge branch 'main' into implement-import-maps
Jan 23, 2023
e68559b
Merge remote-tracking branch 'origin/main' into implement-import-maps
awwaiid Feb 12, 2023
12db666
Fix Gemfile.lock
Feb 13, 2023
7f726bc
Merge branch 'main' into implement-import-maps
Feb 19, 2023
87a8abc
Fix spec
Feb 19, 2023
a43f355
Hack to fix the close button not working.
Feb 21, 2023
28d2de5
add comments
Feb 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -213,3 +213,5 @@ end

# Use Redis for Action Cable
gem "redis", "~> 5.0"

gem "importmap-rails", "~> 1.1"
6 changes: 5 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ GEM
image_processing (1.12.2)
mini_magick (>= 4.9.5, < 5)
ruby-vips (>= 2.0.17, < 3)
importmap-rails (1.1.5)
actionpack (>= 6.0.0)
railties (>= 6.0.0)
jbuilder (2.11.5)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
Expand Down Expand Up @@ -655,6 +658,7 @@ DEPENDENCIES
httparty
icalendar
image_processing
importmap-rails (~> 1.1)
jbuilder
jquery-rails
jquery-ui-rails
Expand Down Expand Up @@ -711,4 +715,4 @@ RUBY VERSION
ruby 3.1.2p20

BUNDLED WITH
2.3.22
2.3.24
2 changes: 2 additions & 0 deletions app/assets/config/manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
//= link_tree ../images
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css
//= link_tree ../../javascript .js
//= link_tree ../../../vendor/javascript .js
108 changes: 0 additions & 108 deletions app/assets/javascripts/application.js

This file was deleted.

9 changes: 9 additions & 0 deletions app/javascript/application.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails

/**
* Load all javascript needed to run the AdminLTE theme and
* all the interactions.
*/
import 'admin-lte'
Copy link
Collaborator

Choose a reason for hiding this comment

The 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.


console.log("Hello from importmap-rails!")
3 changes: 2 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
<%= javascript_include_tag 'application' %>
<%= stylesheet_link_tag 'application', media: 'all' %>
<%= raw fullstory_script(current_user: current_user) if Rails.env.production? %>
<%= javascript_pack_tag 'application' %>
<%# javascript_pack_tag 'application' %>
<%= javascript_importmap_tags %>
<%= stylesheet_pack_tag 'application' %>
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
Expand Down
4 changes: 4 additions & 0 deletions bin/importmap
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env ruby

require_relative "../config/application"
require "importmap/commands"
4 changes: 4 additions & 0 deletions config/importmap.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Pin npm packages by running ./bin/importmap

pin "application", preload: true
pin "admin-lte", to: "https://ga.jspm.io/npm:[email protected]/dist/js/adminlte.min.js"
Empty file added vendor/javascript/.keep
Empty file.