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

Migrate from rails/webpacker to shakapacker #200

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ gem 'rails', '~> 7.0.8'
# Use Sass to process CSS
gem 'sassc-rails', '~> 2.1.2'

gem 'shakapacker', '= 7.1'
gem 'slack-ruby-client', '~> 2.0.0'
gem 'webpacker', '~> 6.0.0.rc.6'

gem 'bootsnap', '>= 1.4.4', require: false
gem 'jwt', '>= 2.6.0'
Expand Down
12 changes: 6 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,11 @@ GEM
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
semantic_range (3.0.0)
shakapacker (7.1.0)
activesupport (>= 5.2)
rack-proxy (>= 0.6.1)
railties (>= 5.2)
semantic_range (>= 2.3.0)
shoulda-matchers (5.3.0)
activesupport (>= 5.2.0)
signet (0.17.0)
Expand Down Expand Up @@ -380,11 +385,6 @@ GEM
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (~> 4.0)
webpacker (6.0.0.rc.6)
activesupport (>= 5.2)
rack-proxy (>= 0.6.1)
railties (>= 5.2)
semantic_range (>= 2.3.0)
webrick (1.8.1)
websocket (1.2.9)
websocket-driver (0.7.6)
Expand Down Expand Up @@ -432,6 +432,7 @@ DEPENDENCIES
rubocop (~> 1.22)
sassc-rails (~> 2.1.2)
selenium-webdriver (~> 4.8.1)
shakapacker (= 7.1)
shoulda-matchers (~> 5.3.0)
slack-ruby-client (~> 2.0.0)
stimulus-rails (~> 1.2.1)
Expand All @@ -441,7 +442,6 @@ DEPENDENCIES
tzinfo-data
web-console (>= 4.1.0)
webdrivers (~> 5.2.0)
webpacker (~> 6.0.0.rc.6)

RUBY VERSION
ruby 3.2.1p31
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ start:
foreman start

start_client:
bin/webpack-dev-server
bin/shakapacker-dev-server

start_server:
rails server
2 changes: 1 addition & 1 deletion Procfile.dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
web: bundle exec rails s
webpacker: ./bin/webpack-dev-server
webpacker: ./bin/shakapacker-dev-server
js: yarn build --watch
css: yarn build:css --watch
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Alternatively, you may run the frontend and backend servers separately with thes

```
rails s
bin/webpack-dev-server
bin/shakapacker-dev-server
```

This may be helpful for debugging, but generally should not be necessary.
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/pages/Donate.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState, useMemo } from 'react';
import { Helmet } from 'react-helmet';
import { Helmet } from 'react-helmet-async';
import propTypes from 'prop-types';
import SharedLayout from 'components/layout/SharedLayout';
import Banner from 'components/Banner';
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/pages/Home.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Helmet } from 'react-helmet';
import { Helmet } from 'react-helmet-async';
import SharedLayout from 'components/layout/SharedLayout';
import SplashBackground from 'components/icons/SplashBackground';
import Button from 'components/Button';
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/pages/Jobs.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useMemo, useState } from 'react';
import { Helmet } from 'react-helmet';
import { Helmet } from 'react-helmet-async';
import propTypes from 'prop-types';
import { useCookies } from 'react-cookie';
import SharedLayout from 'components/layout/SharedLayout';
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/pages/JobsAuthenticate.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
import { Helmet } from 'react-helmet';
import { Helmet } from 'react-helmet-async';
import { useCookies } from 'react-cookie';
import SharedLayout from 'components/layout/SharedLayout';
import Logo from 'components/icons/Logo';
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/pages/JoinUs.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*global grecaptcha*/
/*eslint no-undef: "error"*/
import React from 'react';
import { Helmet } from 'react-helmet';
import { Helmet } from 'react-helmet-async';
import { Formik, Field, Form, ErrorMessage } from 'formik';
import * as Yup from 'yup';

Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/pages/Meetups.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react';
import { Helmet } from 'react-helmet';
import { Helmet } from 'react-helmet-async';
import { getPastMeetups } from '../../datasources';
import SharedLayout from 'components/layout/SharedLayout';
import LoadingSpinner from 'components/LoadingSpinner';
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/pages/PastMeetup.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react';
import { Helmet } from 'react-helmet';
import { Helmet } from 'react-helmet-async';
import PropTypes from 'prop-types';
import { getPastMeetup } from '../../datasources';
import SharedLayout from 'components/layout/SharedLayout';
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/pages/SponsorUs.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
import { Helmet } from 'react-helmet';
import { Helmet } from 'react-helmet-async';
import SharedLayout from 'components/layout/SharedLayout';
import SponsorCard from '../sponsor_us/SponsorCard';
import PageTitleWithContainer from 'components/PageTitleWithContainer';
Expand Down
1 change: 0 additions & 1 deletion app/javascript/packs/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import * as ActiveStorage from '@rails/activestorage';
import 'channels';

import '../stylesheets/application.scss';
import '../stylesheets/page.scss';
import 'bootstrap-icons/font/bootstrap-icons.css';

// Rails.start();
Expand Down
7 changes: 6 additions & 1 deletion app/javascript/packs/donate.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import React from 'react';
import { createRoot } from 'react-dom/client';
import { HelmetProvider } from 'react-helmet-async';
import Donate from 'components/pages/Donate';

document.addEventListener('DOMContentLoaded', () => {
const container = document.getElementById('root');
const root = createRoot(container);

root.render(<Donate />);
root.render(
<HelmetProvider>
<Donate />
</HelmetProvider>,
);
});
7 changes: 6 additions & 1 deletion app/javascript/packs/home_page.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import React from 'react';
import { createRoot } from 'react-dom/client';
import { HelmetProvider } from 'react-helmet-async';
import Home from 'components/pages/Home';

document.addEventListener('DOMContentLoaded', () => {
const container = document.getElementById('root');
const root = createRoot(container);

root.render(<Home />);
root.render(
<HelmetProvider>
<Home />
</HelmetProvider>,
);
});
7 changes: 6 additions & 1 deletion app/javascript/packs/jobs.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import React from 'react';
import { createRoot } from 'react-dom/client';
import { HelmetProvider } from 'react-helmet-async';
import Jobs from 'components/pages/Jobs';

document.addEventListener('DOMContentLoaded', () => {
const container = document.getElementById('root');
const root = createRoot(container);

root.render(<Jobs />);
root.render(
<HelmetProvider>
<Jobs />
</HelmetProvider>,
);
});
7 changes: 6 additions & 1 deletion app/javascript/packs/jobs_authenticate.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import React from 'react';
import { createRoot } from 'react-dom/client';
import { HelmetProvider } from 'react-helmet-async';
import JobsAuthenticate from 'components/pages/JobsAuthenticate';

document.addEventListener('DOMContentLoaded', () => {
const container = document.getElementById('root');
const root = createRoot(container);

root.render(<JobsAuthenticate />);
root.render(
<HelmetProvider>
<JobsAuthenticate />
</HelmetProvider>,
);
});
7 changes: 6 additions & 1 deletion app/javascript/packs/join_us.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import React from 'react';
import { createRoot } from 'react-dom/client';
import { HelmetProvider } from 'react-helmet-async';
import JoinUs from 'components/pages/JoinUs';

document.addEventListener('DOMContentLoaded', () => {
const container = document.getElementById('root');
const root = createRoot(container);

root.render(<JoinUs />);
root.render(
<HelmetProvider>
<JoinUs />
</HelmetProvider>,
);
});
7 changes: 6 additions & 1 deletion app/javascript/packs/meetups.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import React from 'react';
import { createRoot } from 'react-dom/client';
import { HelmetProvider } from 'react-helmet-async';
import Meetups from 'components/pages/Meetups';

document.addEventListener('DOMContentLoaded', () => {
const container = document.getElementById('root');
const root = createRoot(container);

root.render(<Meetups />);
root.render(
<HelmetProvider>
<Meetups />
</HelmetProvider>,
);
});
7 changes: 6 additions & 1 deletion app/javascript/packs/past_meetup.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import React from 'react';
import { createRoot } from 'react-dom/client';
import { HelmetProvider } from 'react-helmet-async';
import PastMeetup from '../components/pages/PastMeetup';

document.addEventListener('DOMContentLoaded', () => {
const container = document.getElementById('root');
const root = createRoot(container);

root.render(<PastMeetup />);
root.render(
<HelmetProvider>
<PastMeetup />
</HelmetProvider>,
);
});
7 changes: 6 additions & 1 deletion app/javascript/packs/sponsor_us.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import React from 'react';
import { createRoot } from 'react-dom/client';
import { HelmetProvider } from 'react-helmet-async';
import SponsorUs from 'components/pages/SponsorUs';

document.addEventListener('DOMContentLoaded', () => {
const container = document.getElementById('root');
const root = createRoot(container);

root.render(<SponsorUs />);
root.render(
<HelmetProvider>
<SponsorUs />
</HelmetProvider>,
);
});
25 changes: 25 additions & 0 deletions app/javascript/stylesheets/application.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
@import 'tailwindcss/base';
@import 'tailwindcss/components';
@import 'tailwindcss/utilities';


body {
@apply antialiased text-base;
text-rendering: optimizeLegibility;
font-feature-settings: 'pnum';
font-variant-numeric: proportional-nums;
padding: 0;
margin: 2.8rem 0 0;
height: 100%;
font-family: Rubik;
color: #4a4a4a;
font-size: 0.95rem;
display: flex;
flex-direction: column;
min-height: 100vh;

&.admin {
min-height: auto;
}
}

p a {
@apply underline;
}
23 changes: 0 additions & 23 deletions app/javascript/stylesheets/page.scss

This file was deleted.

4 changes: 2 additions & 2 deletions app/views/site/home.html.erb
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<%= javascript_pack_tag 'home_page' %>
<%= stylesheet_pack_tag "home_page" %>
<%= append_javascript_pack_tag 'home_page' %>
<%= append_stylesheet_pack_tag "home_page" %>
4 changes: 2 additions & 2 deletions app/views/site/jobs.html.erb
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<%= javascript_pack_tag 'jobs' %>
<%= stylesheet_pack_tag 'jobs' %>
<%= append_javascript_pack_tag 'jobs' %>
<%= append_stylesheet_pack_tag 'jobs' %>
4 changes: 2 additions & 2 deletions app/views/site/jobs_authenticate.html.erb
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<%= javascript_pack_tag 'jobs_authenticate' %>
<%= stylesheet_pack_tag 'jobs_authenticate' %>
<%= append_javascript_pack_tag 'jobs_authenticate' %>
<%= append_stylesheet_pack_tag 'jobs_authenticate' %>
4 changes: 2 additions & 2 deletions app/views/site/join_us.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= javascript_pack_tag 'join_us' %>
<%= stylesheet_pack_tag 'join_us' %>
<%= append_javascript_pack_tag 'join_us' %>
<%= append_stylesheet_pack_tag 'join_us' %>
<%- if ENV.fetch('RECAPTCHA_ENABLED', nil) == 'true' %>
<%= javascript_tag do %>
var gtoken= '<%=raw(ENV.fetch('RECAPTCHA_SITE_KEY', nil))%>'
Expand Down
4 changes: 2 additions & 2 deletions app/views/site/meetups.html.erb
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<%= javascript_pack_tag 'meetups' %>
<%= stylesheet_pack_tag "meetups" %>
<%= append_javascript_pack_tag 'meetups' %>
<%= append_stylesheet_pack_tag "meetups" %>
4 changes: 2 additions & 2 deletions app/views/site/past_meetup.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= javascript_pack_tag 'past_meetup' %>
<%= stylesheet_pack_tag "past_meetup" %>
<%= append_javascript_pack_tag 'past_meetup' %>
<%= append_stylesheet_pack_tag "past_meetup" %>
<%= javascript_tag do %>
var year = <%= raw(h(params[:year])) %>;
var month = <%= raw(h(params[:month])) %>;
Expand Down
4 changes: 2 additions & 2 deletions app/views/site/sponsor_us.html.erb
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<%= javascript_pack_tag 'sponsor_us' %>
<%= stylesheet_pack_tag "sponsor_us" %>
<%= append_javascript_pack_tag 'sponsor_us' %>
<%= append_stylesheet_pack_tag "sponsor_us" %>
Loading