Answers.Body: <p>Easiest way is to have separate branches for the Craft 3 and Craft 4 version of the plugin. Then also increment the major version number of the Craft 4 version, and tag each release separately.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-26T08:41:29.457Z
Answers.Text: Will craft "understand" which branch is for Craft 3 and 4 when installing plugin?
Answers.UserDisplayName: Piotr Pogorzelski
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-26T15:26:10.393Z
Answers.Text: Each branch will have a separate `composer.json` file with different version requirements, so yes. This is how I do it for all of my plugins. Look at the branches here, for example: https://github.com/nystudio107/craft-retour
Answers.UserDisplayName: andrew.welch
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-26T00:55:27.363Z
Answers.LastActivityDate: 2022-08-26T00:55:27.363Z
Answers.UserDisplayName: andrew.welch
Body: <p>I have a plugin that initially was created for version 3.x of Craft, but was updated to be compatible with Craft 4. How can I update the plugin with some new features for Craft 3?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-08-18T23:23:13.610Z
Comments.Text: Did you look at https://craftcms.com/docs/4.x/extend/updating-plugins.html#high-level-notes yet?
Comments.UserDisplayName: Mark Busnelli Jr
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-08-19T14:12:43.533Z
Comments.Text: Is this your own plugin? Or do you mean, that the plugin was made compatible for Craft 4 and new features are now added to the v4 compatible version but not being backported or provided in a separate v3 branch?
Comments.UserDisplayName: Matthias Redl-Mann
Tags: <plugin-development>
Title: How to update Craft 3 version of plugin when Craft 4 version is already released?
ThreadText: # How to update Craft 3 version of plugin when Craft 4 version is already released?
  
  (Asked by: username_0 on 2022-08-18)
  
  I have a plugin that initially was created for version 3.x of Craft, but was updated to be compatible with Craft 4. How can I update the plugin with some new features for Craft 3?
  
  **Tags:** plugin-development
  
  > **Comments:**
  > **username_1**: Did you look at https://craftcms.com/docs/4.x/extend/updating-plugins.html#high-level-notes yet?  
  > **username_2**: Is this your own plugin? Or do you mean, that the plugin was made compatible for Craft 4 and new features are now added to the v4 compatible version but not being backported or provided in a separate v3 branch?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2022-08-26. Score: 1 | Accepted answer
  
  Easiest way is to have separate branches for the Craft 3 and Craft 4 version of the plugin. Then also increment the major version number of the Craft 4 version, and tag each release separately.
  
  > **Comments:**
  > **username_0**: Will craft "understand" which branch is for Craft 3 and 4 when installing plugin?  
  > **username_3**: Each branch will have a separate `composer.json` file with different version requirements, so yes. This is how I do it for all of my plugins. Look at the branches here, for example: https://github.com/nystudio107/craft-retour  
  
  ---
  
  