Skip to content

Conversation

@cabidop
Copy link
Contributor

@cabidop cabidop commented Jan 23, 2025

This brings the necessary changes to ensure the plugin is compatible with the latest Discourse stable version (and its development environment), which currently is 3.3.0. There are no significant functional updates here, but I made sure anyway that both the automated and the usual manual tests were working fine (minus the latest change introduced for the ace-editor, see my note at the end). The list of changes is as follows:

  • Updated both the Github action and the Gemfile.lock to match the required dependencies for Discourse v3.3.0.
  • Applied the linters using the new dependencies, which:
    • Replaced all uses of unless, to_s and ||=.
    • Enforced the requires_plugin method to be called in every controller (although could not figure out a simple way of adding it to the LandingController, as it is not extending the usual ApplicationController).
    • Removed every usage of class_eval in favour of statically declaring the attr_accessors.
    • Replaced the load method with the require_relative method in the after_initialize section.
    • Renamed all .js.es6 files to just use the .js extension.
  • Fixed the JsonEditor component to still support the JSON syntax highlighting.
  • Fixed the automated tests to properly reflect the behaviour using the new dependencies.

@angusmcleod long time no push, so hope that you are still around for reviews! If possible, it would be nice to re-enable the branch protection again to ensure that every PR and commit to main successfully passes both the linter checks and the tests. Just realized that the action is being properly run, maybe was something wrong with my fork as it was not doing anything.

@merefield I saw that you added a small update for the ace-editor component to be compatible with the upcoming version of Discourse. Although it is not a fully-breaking change (it resets the editor cursor each time the text area is updated), it definitely complicates things if we want to add features or fixes for the latest stable (like this one). How do you see to create a new next/future/dev/etc. branch to keep this "future-but-breaking" changes, while we use main only for updates related to the stable versions?

@angusmcleod
Copy link
Member

@cabidop Looks fine to me 👍 Thanks.

@angusmcleod angusmcleod merged commit 8fee9ea into paviliondev:main Jan 24, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants