Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Conversation

@megothss
Copy link
Contributor

@megothss megothss commented Jun 30, 2025

This PR updates the ad plugin to support the Glimmer Post Stream and refactors ad rendering logic for improved compatibility and maintainability.

Key changes:

  • Introduce glimmer_post_stream_mode compatibility across all ad types and test suites.
  • Replace .widget-connector with .ad-connector for ad placement after posts.
  • Migrate initialize-ad-plugin.js to initialize-ad-plugin.gjs to leverage Glimmer and API improvements.
  • Use withSilencedDeprecations to handle widget overrides for post ads.
  • Update compatibility constraints in .discourse-compatibility.
  • Refactor and expand acceptance tests for AdSense, DFP, and House Ads to run with both Glimmer and legacy post stream modes.

Refactored ad plugin initialization to use API enhancements and split logic into smaller functions for better organization.

Updated compatibility to include a new version restriction.
import { withPluginApi } from "discourse/lib/plugin-api";
import Site from "discourse/models/site";
import { registerWidgetShim } from "discourse/widgets/render-glimmer";
import { withSilencedDeprecations } from "discourse/lib/deprecated";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like imports need an eslint autofix

megothss added 3 commits July 8, 2025 15:52
Reordered imports for clarity and removed outdated plugin API version constraints to streamline initialization logic.
Updated the compatibility hash for `3.5.0.beta8-dev` in the discourse-adplugin compatibility file.
Updated AdSense, DFP Ads, and House Ads tests to run for both "enabled" and "disabled" glimmer_post_stream_mode. Updated templates and widgets to replace `widget-connector` with `ad-connector` for improved consistency.
@megothss megothss merged commit 8a3263d into main Jul 8, 2025
6 checks passed
@megothss megothss deleted the dev/glimmer-post-stream branch July 8, 2025 19:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants