Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Upcoming SlideShare
貓纜驚奇
Next
Download to read offline and view in fullscreen.

0

Share

Download to read offline

One code to rule them all - how to use the same codebase for Server and Cloud versions of your plugin

Download to read offline

AtlasCamp 2016 Developer Breakouts presentation by Paweł Murawski.
"Atlassian Connect plugins are sandboxed in a separate iframe - what if we could do that also for Server (P2) plugins? Moreover, we could use the same codebase in both places, effectively writing two plugins at once. It will add a marginal overhead but only in the build process, not in the code itself. Additionally, when your frontend code is completely separated, you can avoid MANY potential bugs. Sounds too good to be true? Then come and see how we've done it!"

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all
  • Be the first to like this

One code to rule them all - how to use the same codebase for Server and Cloud versions of your plugin

  1. 1. PAWEL MURAWSKI • TEAM LEADER • SPARTEZ • PAWEL.MURAWSKI@SPARTEZ.COM One Code To Rule Them All How to use the same codebase for JIRA Server and Cloud plugins
  2. 2. ARCHITECTURE HISTORY OUR ‘OWN’ CONNECT PROS & CONS Agenda
  3. 3. HISTORY
  4. 4. From the Server to the Cloud… and back again. JIRA Server plugin again Cards created in Java - PDF file. JIRA Cloud plugin Cards created using JS, HTML and CSS. JIRA Server plugin Reused code from JIRA Cloud plugin.
  5. 5. One little problem left.. Our photo scanning algorithm has been written in JAVA and is only available on JIRA Server. Let’s rewrite it in JavaScript!
  6. 6. “This is madness. It cannot work!” EVERYBODY, EXCEPT OUR TEAM
  7. 7. ARCHITECTURE
  8. 8. One Maven Project Frontend code Standard P2 plugin. JIRA Cloud plugin Java Spring application - Connect plugin. JIRA Server plugin Copied during build process as resource to Server and Cloud plugin modules.
  9. 9. JIRA Cloud plugin
  10. 10. JIRA Server plugin
  11. 11. OUR ‘OWN’ CONNECT
  12. 12. Outside iframe - showView() method Sets URL on iframe Inside passed DOM element. Resizes iframe Timer FTW! Creates iframe Parameters like ac-view, context path, locale, user name etc.
  13. 13. Inside iframe - wrapper for the AP library Current location Standard AJAX calls. Messages AJS from parent is used. JIRA requests window.parent.location.href
  14. 14. AC plugin servlet HTML template - showView() Iframe - different index.html for Server and Cloud App router - ac-view parameter Final app view Rendering the view in iframe on JIRA Server
  15. 15. Pros & Cons
  16. 16. Pros go to the left, cons to the right No interference with JIRA frontend code Which means less bugs Same codebase for JIRA Server and Cloud plugins Write once, run everywhere Build process is a little bit more complicated And you need file watchers Plugin has to be written in JS And sometimes you just want Java Some Connect functionalities have to be implemented for P2 plugin Also you need to keep your plugin inside an iframe Virtually no limits in choosing frontend technologies Any hipstery JS framework can be used
  17. 17. Thank you! PAWEL MURAWSKI • TEAM LEADER • SPARTEZ • PAWEL.MURAWSKI@SPARTEZ.COM

AtlasCamp 2016 Developer Breakouts presentation by Paweł Murawski. "Atlassian Connect plugins are sandboxed in a separate iframe - what if we could do that also for Server (P2) plugins? Moreover, we could use the same codebase in both places, effectively writing two plugins at once. It will add a marginal overhead but only in the build process, not in the code itself. Additionally, when your frontend code is completely separated, you can avoid MANY potential bugs. Sounds too good to be true? Then come and see how we've done it!"

Views

Total views

1,221

On Slideshare

0

From embeds

0

Number of embeds

984

Actions

Downloads

2

Shares

0

Comments

0

Likes

0

×