Jump to content

Stuart Silvester

Invision Community Team
  • Posts

    3,609
  • Joined

  • Last visited

  • Days Won

    25

Reputation Activity

  1. Like
    Stuart Silvester reacted to Matt for an entry, Introducing Invision Community 5's development tools   
    When planning Invision Community 5, we knew we had a unique opportunity to hit the reset button.
    It's hard to believe, but how we work with the framework has been the same since 2013. The priorities we held a decade ago no longer align with our current vision.
    The landscape of modern frameworks has evolved, and we have adapted accordingly.
    When we initially designed the Invision Community 4 framework all those years ago, our goal was to create an open development platform. We aimed to empower you with the ability to extend virtually every function we built, granting complete freedom to shape our UI, workflows, and functionality according to your needs.
    However, over the decade, we have realised that this freedom has inadvertently become a prison. While monkey patching allowed the overloading of any method we had written, it came at a significant cost. Even the slightest change to our original method signatures could break an entire community, forcing you to update your applications.
    Ironically, the more we strived to enhance our framework, the less stable your applications became.
    We dismissed requests for proper workflows like extensions, webhooks, and event listeners, urging you to rely solely on method overloading, often having to copy chunks of code just to add a few lines of your own.
    Invision Community 5 represents a much-needed reset. It is a moment to reassess everything we know about extending frameworks and construct definitive pathways and workflows that serve you better.
    Our aim is for you to continue crafting exceptional applications that bring fresh functionality to the Invision Community while protecting the integrity of our core functionality.
    Change can be intimidating, but let us embrace this opportunity to bid farewell to outdated and fragile tools and pave the way for a collaborative future with precision-designed resources instead.
    In the coming weeks, we will delve deeply into the new development tools offered by Invision Community 5, but today, I wanted to give you a brief overview of what's to come for code development. We will do a near-future entry on creating themes with Invision Community 5.
    Out with the old
    Monkey patching via code hooks was the primary way to add functionality to Invision Community. However, it meant that we could not update our code base without risking breaking many popular applications, a situation that will only get worse as PHP starts to lock down type hinting and casting.
    Furthermore, IDEs have a tough time working out relationships between classes requiring special tools to create alias files to allow full use of many advanced tools of PHPStorm and other editors. Finally, monkey patching relied on heavy use of eval() which is not a very efficient PHP method.
    Monkey patching has been removed in Invision Community 5.
    Your IDE with Invision Community 4.

    Your IDE with Invision Community 5.

     
    Template hooks, as you know them, have also been removed. I only mention this now as they often go hand-in-hand with code hooks to add items to menus, data-attributes to blocks and CSS classes to many areas. We will do a more thorough blog on theme editing soon, but we still retain a way to hook into key areas.
    In with the new
    We will write a series of developer blogs to look in more detail at the new systems, but here is a quick overview of the new tools and a brief description of what they are capable of.
    Content Menus
    We have removed much of the menu logic for content items and comments from templates and created a simple, extensible way to add links to commonly used menus, such as the item moderation menu and the per-post 'three dots' menu. You no longer need a template hook to perform such a basic task.

    UIExtension
    This framework provides you with an easy way to add CSS, data-attributes and even templated HTML into specific areas within nodes and content items/comments. A common reason to create template hooks was to tweak the CSS classes or add data-attributes for client-side scripting.

    In the same way that we've stripped menus out of templates, we've removed the content item badges (pinned, hidden, etc.) and into the UIExtension making it easy to add your own badges to this area without the need for template or code hooks.
    Finally, UIExtension can add form fields into Invision Community content forms.
    Event Listeners
    The easiest way to describe this is like MemberSync but for content (items and comments), members, Commerce invoices and Commerce packages.
    Do you need to run your code each time a forum post is made? Not a problem. Do you need to run your code when a topic is locked? Perhaps when an item is viewed? All this and more is possible via the new listeners.
    The advantage is that you don't need to copy chunks of our code when overloading a single method in a hook. You write your clean code in an object-specific listener.

    What else?
    We have also undertaken a long overdue code clean-up. Every single file has been updated to update return types and function signature types and to use aliases instead of fully qualified names (for example, new Url() instead of new \IPS\Http\Url()).
    Many methods have been removed from the Content classes and moved into traits. Likewise, many interfaces are now traits to reuse code properly, reducing the behemoth-sized classes.
    Elsewhere, all the search indexing logic that was entwined in content and node classes has now been moved to the extension system, further reducing the noise and volume of key classes.
    A Quick Recap
    Generic broad reaching tools such as monkey patching and template overloading have been removed. New precision tools with a specific use-case have been created. There are less opportunities to overwrite and change our UI and functionality but easier ways to extend and create new functionality. The future
    We have worked hard on these development tools to ensure that most of what you do now can be achieved in Invision Community 5. We have had input from various stakeholders, including those who regularly create modifications for Invision Community to ensure our new tools are fit for purpose.
    Through the alpha and beta testing phase, we want your feedback, and we will listen to your suggestions. We cannot promise that you can do everything with Invision Community 5 that you currently do, which is intentional, but we are confident that you can still hit all the major beats. We want to protect our UI and functionality a little more but encourage you to build amazing new functionality to work alongside Invision Community 5.
    Together, we will shape the next era of Invision Community.
  2. Like
    Stuart Silvester reacted to Matt for an entry, Development update for October 2022   
    Welcome to our October developer's update!
    After a frantic few months of working on the PHP8 transition, we made it across the line with our November release (4.7.4), which requires PHP8 as the minimum version.
    Reminder: Invision Community 4.7.4 will disable plugins and applications that are not compatible with PHP8, and the only way to re-enable them is to upload a new version. Hopefully, you've had time to get your apps updated and through our review system. Thank you again for your patience throughout this process. The next big change will be PHP8.2, which changes how DateTime is overloaded, but that's a headache for 2023.
    Make sure you use PHP8 with your local development environments and set your IDE to PHP8 if it has this feature.

    If you need a refresher on the new functionality that comes with PHP8, then I recommend this blog or this video.
    Impacting Code Changes
    We've been very careful to avoid adjusting any parameter signatures this month, and we will endeavour to get you plenty of notice if we need to change things on a central method.
    The main change to look out for this month is the change to IPS\<app>\extensions\core\ContentRouter
    /** * @brief    Can be shown in similar content */ public $similarContent = TRUE; We added a public method variable to note if this content type can be used in the similar content widget. This change fixes a bug where some content types, like Commerce packages, appeared in the widget but with incompatible metadata.
    Holiday Release Schedule
    It's that time of year when we start planning releases around the Thanksgiving and Christmas holidays. We try and avoid larger releases at this point in the year to reduce the stress levels on our support and development teams. No one wants a crisis during what should be a relaxing time with family and friends.
    The current schedule looks like this:
    2 November: November release (4.7.4) First week of December: Smaller bug-fixing release (4.7.5) Early January: Patches or a very focused bug-fixing release (4.7.5.1/4.7.6) February: Full monthly releases as usual. Deprecations
    This month, we removed the older guest page caching. Those looking for a better replacement are having success with a free plan from Cloudflare.
    We also removed the Facebook promotion tool as Facebook keeps raising the bar for approval, and we want to focus on a Zapier replacement coming soon. Finally, we also removed Vigilink, which no longer works.
    Other News
    The November release features commits from @HeadStand, who is working with us part-time to chew through the backlog and work on feature improvements. She is a coding machine and has filled my inbox with GitHub pull request notifications which I'm very happy to receive!
    That's all for this month, happy developing!
  3. Like
    Stuart Silvester reacted to Matt Finger for an entry, Development update for August 2022   
    Welcome to our August (and June and July) developer's Update!
    We've had a busy summer so far, with our team working on the final touches to 4.7 which introduced range of new Cloud specific features. In our August release we also added a way to schedule topics.
    @Jordan Miller announced the new solutions improvements here, this will be included in our September release (4.7.2)
    PHP8 Compatibility Scanner
    We are excited to announce that as a platform we (finally) are starting the process of migrating from PHP7 to PHP8 in order to keep the software secure, modern, and performant.
    Since PHP8 includes some breaking changes from PHP7, we've built a Method Scanner that will iterate through third party apps and plugins to find fatal issues, disabling any such customizations on upgrade. The apps and plugins disabled in this manner will not be able to be re-enabled until they are updated with the fixes. Developers, please make sure that your resources are fully tested with PHP 8+ and the method signatures match.
    For developers, the main issue the scanner looks for is instances in which a method's signature is altered when extending a class; this can cause fatal errors that make even the AdminCP inaccessible. Violating code can be found both in your hooks as well as other PHP classes your app/plugin uses. See the PHP8 Incompatible Apps and Plugins in the AdminCP Support Page to see exactly the issues identified and how to resolve:

     
    Pre-Upgrade Resource Checker
    We're also introducing a new AdminCP upgrade step to check installed resources for whether compatibility updates are available for version they're upgrading to.

     
    Here is the full changelog for our upcoming September release.
    Core - Added ACP Tool to scan all hooks to identify PHP8 fatal errors related to method overloading. - Added AdminCP new search terms to guide admins to the new areas. - Added a pre-upgrade Marketplace compatibility check. - Fixed an issue where a large number of profile field options can break the page layout on the member stats overview page. - Fixed an issue where members following an item may not be following the remaining item after a merge. - Fixed an issue where word filters could cause an item to be held for approval even if the author had more than the required number of posts to bypass. - Fixed an issue with hCaptcha where an incorrect language override could be requested. - Fixed an issue where it was possible to create an alert with forced reply from a moderator/admin account with a disabled messenger. - Fixed an issue where editing the ACP => System => Postings page with disabled registrations would throw an exception while the submission. - Fixed an issue where some alerts were not shown if they had an end date. - Fixed an issue where post to Twitter could potentially result in an uncaught exception - Fixed an issue where the oauth configuration page was missing the required css files. - Fixed an issue where a report title may appear in trending content (does not expose any sensitive data). - Fixed an issue where removing a manually added badge would not remove the badge - Fixed an issue where the rank progression chart may not work when non-default ranks are used. - Fixed an issue where the achievements rebuild may fail. - Fixed an issue where content tags from content created by the RSS Import feature could be associated with a guest account. - Fixed an issue where alerts could not be dismissed if they had long titles. - Fixed an issue where search options may break on profiles when status updates were disabled. Pages - Fixed an issue where orphaned categories could break syncing from topics. - Fixed an issue when using the REST API to fetch records where fields may not have the image lazyload removed. Forums - Added multiple improvements to "Mark as solution" including a re-engagement email, new UI to prompt authors to mark a reply as the solution and new stats. - Fixed an issue where the default forum views may not be used for guests. - Fixed an issue where soft deleted items may be archived and then subsequently deleted leaving orphaned reports. - Fixed an issue where a malformed findComment link caused a 404 error instead of loading the topic from the start. Commerce - Fixed a typo on the invoice settings page. - Fixed an issue on the credits page - Fixed an issue where deleting a subscription package would leave some orphaned data in the database. Changes affecting third-party developers and designers - Fixed an issue where plugin index.html files may get included as CSS causing a browser rendering issue.  
×
×
  • Create New...