Merge commit 'c6684aa1e392f2dd86af4362b4259809549abaad' into glitch-soc/merge-upstream

Conflicts:
- `app/views/layouts/application.html.haml`:
  Upstream changed how the `inert.css` file is included.
  The conflict is caused by glitch-soc's theming system.
  Ported the upstream change.

Additional changes:
- `config/webpack/shared.js`: bypass glitch-soc's theming
  system for `inert` pack.
shrike
Claire 2024-01-15 19:30:07 +01:00
commit 60298af3c4
4 changed files with 15 additions and 3 deletions

View File

@ -0,0 +1,4 @@
/* Placeholder file to have `inert.scss` compiled by Webpack
This is used by the `wicg-inert` polyfill */
import '../styles/inert.scss';

View File

@ -1,3 +1,5 @@
/* This is needed for the wicg-inert polyfill */
[inert] { [inert] {
pointer-events: none; pointer-events: none;
cursor: default; cursor: default;

View File

@ -27,6 +27,10 @@
%title= html_title %title= html_title
= javascript_pack_tag 'common', crossorigin: 'anonymous' = javascript_pack_tag 'common', crossorigin: 'anonymous'
-# Needed for the wicg-inert polyfill. It needs to be on it's own <style> tag, with this `id`
= stylesheet_pack_tag 'inert', media: 'all', id: 'inert-style'
- if @theme - if @theme
- if @theme[:supported_locales].include? I18n.locale.to_s - if @theme[:supported_locales].include? I18n.locale.to_s
= preload_pack_asset "locales/#{@theme[:flavour]}/#{I18n.locale}-json.js" = preload_pack_asset "locales/#{@theme[:flavour]}/#{I18n.locale}-json.js"
@ -35,8 +39,6 @@
= csrf_meta_tags unless skip_csrf_meta_tags? = csrf_meta_tags unless skip_csrf_meta_tags?
%meta{ name: 'style-nonce', content: request.content_security_policy_nonce } %meta{ name: 'style-nonce', content: request.content_security_policy_nonce }
= stylesheet_link_tag '/inert.css', skip_pipeline: true, media: 'all', id: 'inert-style'
= yield :header_tags = yield :header_tags
-# These must come after :header_tags to ensure our initial state has been defined. -# These must come after :header_tags to ensure our initial state has been defined.

View File

@ -54,7 +54,11 @@ const entries = Object.assign(
module.exports = { module.exports = {
entry: entries, entry: {
...entries,
// this is cursed, but bypass glitch-soc's theming system for this one
inert: './app/javascript/packs/inert.js',
},
output: { output: {
filename: 'js/[name]-[chunkhash].js', filename: 'js/[name]-[chunkhash].js',