Announcing Atlassian Connect JS version 5-beta

451 views
Skip to first unread message

Michael Staas

unread,
Oct 24, 2016, 2:34:13 AM10/24/16
to Atlassian Connect Dev

We are commencing the rollout of a new major version (v5) of the JavaScript client-side library for Atlassian Connect. Initially for JIRA, with Confluence following later this year.  Prior to going into production, we will be enabling for all JIRA Cloud DEVELOPMENT environments early this week to give you the opportunity to test and verify behaviour with your add-ons. We have done extensive manual testing, however, if you discover any issues, please report them in the ACJS project with as much information as possible to assist with reproducing the issue. If no new major issues are discovered, we will begin rolling this out to customers in the following weeks.


The documentation for v5 can be found at https://developer.atlassian.com/static/connect/docs/beta/index.html. You shouldn't need to change anything in your add-ons immediately. You will see deprecation notices regarding certain features, and suggestions for alternative functionality.


To see which version is enabled you can check _AP.version in your console in JIRA or AP._version in your add-on.


Note: This will only be enabled for EXISTING developer environments; if you create a new Cloud development environment it will not have this beta enabled by default.


New Modules

Deprecations

  • AP.require and AP.define have been deprecated. Connect modules can now be accessed directly on AP, e.g. AP.request.
  • Dialog's static customData member has been deprecated and has been replaced with the getCustomData() method.
  • The Messages module has been deprecated and we recommend that you use the Flag module instead.
  • The onDialogMessage() method has been deprecated and we recommend that you use the AP.events module instead.
  • The Dialog.on() method has been deprecated and we recommend that you use the AP.events module instead.
  • The DialogButton.bind() method has been deprecated we recommend that you use the AP.events module instead.

Known Issues

Auto-resizing changes

Before reporting issues with add-ons displaying at the incorrect width / height or showing scrollbars. Please ensure you have the wrapping container element present (this element should have a class of "ac-content").

Mark Long

unread,
Oct 24, 2016, 9:37:23 AM10/24/16
to Atlassian Connect Dev
Hi Michael,

I'm interested in the new Navigator module, and wondering if there are plans to add a pushState like API - i.e. allowing the addon to update the host URL without forcing a reload. My use case is as follows:
  • My addon is an SPA with client-side routing
  • I have parameterized routes to render dynamic content pages
  • A couple of these routes are exposed as General Pages with addon-specific Context Parameters in my Connect manifest
  • I would like to give users the ability to bookmark these pages for future direct access
  • While accessing these pages directly via the General Page route works as expected, there is no easy way to bookmark the URL in the first place because navigating through the addon UI doesn't update the host URL - when they create the bookmark, the saved URL is always just the addon's entry route
  • An API to manually update the host url would alleviate this problem, as I could keep the host url in sync with the addon URL when the addon navigates to a route that is directly accessible via Connect (i.e. one of the General Pages)
Looking at Navigator.go(), it doesn't appear that addon-specific context parameters are supported in the target context. Also, I'm assuming that calling go() will force a full reload of the iframe even when, for example, navigating to the same target addonModule but with different context parameters?

Thanks for your consideration.

Cheers,
Mark

Michael Staas

unread,
Oct 24, 2016, 7:14:49 PM10/24/16
to Atlassian Connect Dev
Hi Mark,

The History API https://developer.atlassian.com/static/connect/docs/latest/javascript/module-history.html lets you store data in the URL fragment identifier. 
I need to double check whether getState() works as expected after refreshing the page.

Regards,

Mike

Caal Saal

unread,
Oct 25, 2016, 11:23:47 AM10/25/16
to Atlassian Connect Dev
Last time I tried getState not working properly. It return empty value if you go come from other page . 

Mark Long

unread,
Oct 25, 2016, 4:23:40 PM10/25/16
to Atlassian Connect Dev
Hi Michael,

Thanks for the quick response! 

I suppose History.pushState may indeed work for my use case, but it would be much more awkward to implement. I would need to call getState on every entry route and then conditionally re-route the user to the real URL (...or throw away my browser history based routing setup and use hash based routing instead). With the recent Connect additions that offer better support for clean URLs (e.g. passing through add-on specific context parameters from the host URL to the add-on URL), duplicating my app state in hashbangs seems like a step backward and probably not worth the hassle in this case. If History.pushState allowed updating the entire URL rather than just the location anchor, that would definitely do the trick :)

Cheers,
Mark

Salvatore Cammarata

unread,
Nov 2, 2016, 5:48:13 AM11/2/16
to atlassian-...@googlegroups.com
Hi Michael,
On our developer environment (https://balsamiq-staging.atlassian.net)
we are still seeing the production version of the AC library
(i.e."3.2.8").

Any updates on the possibility to test the new major version of the AC
library (v5)?
> --
> You received this message because you are subscribed to the Google Groups
> "Atlassian Connect Dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to atlassian-connec...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Sax
-------------------
Salvatore (Sax) Cammarata
Plugin Lead, https://balsamiq.com
Support: http://support.balsamiq.com
Sales: sa...@balsamiq.com or +1 (415) 367-3531
We're good people, and we care.

Fernando Boucquez

unread,
Nov 2, 2016, 1:16:47 PM11/2/16
to atlassian-...@googlegroups.com
Same problem here, I get 3.2.8 version in my my dev instance https://fboucquez.atlassian.net 


> For more options, visit https://groups.google.com/d/optout.



--
Sax
-------------------
Salvatore (Sax) Cammarata
Plugin Lead, https://balsamiq.com
Support: http://support.balsamiq.com
Sales: sa...@balsamiq.com or +1 (415) 367-3531
We're good people, and we care.
--
You received this message because you are subscribed to the Google Groups "Atlassian Connect Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to atlassian-connect-dev+unsub...@googlegroups.com.

Fernando Boucquez

unread,
Nov 2, 2016, 1:38:12 PM11/2/16
to atlassian-...@googlegroups.com
Hi team, I have a question related navigator. Is it possible to reload just the iframe and not the entire parent page?

On Wed, Nov 2, 2016 at 2:16 PM, Fernando Boucquez <fbou...@gmail.com> wrote:
Same problem here, I get 3.2.8 version in my my dev instance https://fboucquez.atlassian.net 

> For more options, visit https://groups.google.com/d/optout.



--
Sax
-------------------
Salvatore (Sax) Cammarata
Plugin Lead, https://balsamiq.com
Support: http://support.balsamiq.com
Sales: sa...@balsamiq.com or +1 (415) 367-3531
We're good people, and we care.

--
You received this message because you are subscribed to the Google Groups "Atlassian Connect Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to atlassian-connect-dev+unsubscri...@googlegroups.com.

David Boyd

unread,
Nov 4, 2016, 2:11:09 AM11/4/16
to Atlassian Connect Dev
Hi,

Apologies for the unexpected delay. 
The beta version has now been enabled for existing JIRA Cloud DEVELOPMENT environments.

Regards,
David Boyd
Atlassian Connect

Fernando Boucquez

unread,
Nov 4, 2016, 7:21:13 AM11/4/16
to atlassian-...@googlegroups.com
Thank you David for rolling out the new version to dev hosts. 
My 2 cents, 

I've just found out that the old RA.request way of making request from UI to Host has been removed and the new way is 

I've probably missed a deprecation notice, but awesome that you have rolled out the new version to dev first! Thanks! We're patching an releasing a new version.

Cheers
Fernando


--
You received this message because you are subscribed to the Google Groups "Atlassian Connect Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to atlassian-connect-dev+unsub...@googlegroups.com.

Fernando Boucquez

unread,
Nov 4, 2016, 7:46:29 AM11/4/16
to atlassian-...@googlegroups.com
I'm testing history.getState in v5 and the method is still returning null on page load. Does anybody see the same problem?


To unsubscribe from this group and stop receiving emails from it, send an email to atlassian-connect-dev+unsubscri...@googlegroups.com.

Robert Massaioli

unread,
Nov 4, 2016, 11:04:39 PM11/4/16
to Atlassian Connect Dev
"I've probably missed a deprecation notice, but awesome that you have rolled out the new version to dev first!"

Thanks. We're pretty happy with this approach too and it is what the Cloud Development Environments enable. We are hoping to move closer and closer towards this kind of world, where we are able to release to you, our developers, first before releasing to our shared customers.

Michael Staas

unread,
Nov 7, 2016, 1:08:42 AM11/7/16
to Atlassian Connect Dev
Hi Caal,

getState was fixed in v5.

regards,

Mike

Michael Staas

unread,
Nov 7, 2016, 1:10:16 AM11/7/16
to Atlassian Connect Dev
Hi Mark,

Unfortunately we can't let add-ons set the entire URL state as some parts of out products implement Single Page Apps themselves and this would conflict.

Regards,

Mike

Michael Staas

unread,
Nov 7, 2016, 1:13:09 AM11/7/16
to Atlassian Connect Dev
Hi Sax,

Unfortunately it took much longer that anticipated for our admins to enable this feature. My apologies for the wait, v5 is now switched on for developer instances that were created longer than 2 weeks ago.

Regards,

Mike

Michael Staas

unread,
Nov 7, 2016, 1:16:16 AM11/7/16
to Atlassian Connect Dev
Hi Fernando,

You can use `location.reload` or `location.href = something` in your iframe, no need for an AP method.

Regards,

Mike

Michael Staas

unread,
Nov 7, 2016, 1:19:17 AM11/7/16
to Atlassian Connect Dev
Just a reminder everyone to check `AP._version.startsWith('5')` in your addon before reporting a problem with v5

:)

Mark Long

unread,
Nov 7, 2016, 10:19:41 AM11/7/16
to Atlassian Connect Dev
Hi Michael,

My use of "entire URL" wasn't the best choice of words to convey what I intended. I agree it likely doesn't make sense to allow the addon to overwrite the entire URL for the reasons you mentioned, and certainly not in contexts where the addon is embedded in a JIRA view (e.g. Web Panel).

To clarify, it would be totally workable if the API only allowed manipulation of the portion of the URL relative to addon key. So for example, if the user entered my add-on via the following URL (a General Page):


Only the bold segment could be updated by the addon via my proposed API. In my use case, the user would navigate internally within the iframe to view a particular report, and I would update the addon-controlled URL segment to: /report/{id}/view?project.key=SOFTWARE&project.id=10101, allowing the user to bookmark the report for future direct access.

In any case, I'll leave it at this - thanks again for taking the time to consider and respond.

Cheers,
Mark

char...@thinktilt.com

unread,
Nov 13, 2016, 8:29:12 PM11/13/16
to Atlassian Connect Dev

Michael Staas wrote:
Just a reminder everyone to check `AP._version.startsWith('5')` in your addon before reporting a problem with v5

Be careful implementing that code, because `AP._version` does not exist in the older version of Atlassian Connect JS currently in production (v3). So if you add that code to your JavaScript it can break your add-on, preventing your scripts from running in production now. 

So you also have to check if _version exists before checking its value, eg `if (AP._version && AP._version.startsWith("5."))`

Jan Revis

unread,
Dec 1, 2016, 3:05:43 PM12/1/16
to Atlassian Connect Dev
Will v5-beta will be available for Confluence cloud on newer dev instances soon?

Regards,
Jan

Seb Ruiz

unread,
Dec 1, 2016, 5:29:26 PM12/1/16
to atlassian-...@googlegroups.com
Yes, we are rolling out over the next week - we will update the list when it is done

--
You received this message because you are subscribed to the Google Groups "Atlassian Connect Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to atlassian-connect-dev+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Seb Ruiz
Atlassian

Richard Simko

unread,
Dec 20, 2016, 4:27:20 AM12/20/16
to Atlassian Connect Dev
A question about automatic resizing. Is it supposed to resize continuously if I  have an element with the class "ac-content" as the outermost element or do I need to manually call AP.resize() every time the size of my content changes?

Regards,
Richard

Einar Pehrson

unread,
Dec 20, 2016, 8:18:13 AM12/20/16
to atlassian-...@googlegroups.com
Hi Richard,

if auto-resizing has been enabled, by including an element with the class ac-content, you should never need to call AP.resize(). As you say, it should resize continuously.

Cheers!
Einar

To unsubscribe from this group and stop receiving emails from it, send an email to atlassian-connect-dev+unsubscri...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Seb Ruiz
Atlassian

Richard Simko

unread,
Dec 20, 2016, 8:52:58 AM12/20/16
to atlassian-...@googlegroups.com
Interesting. I'll have to do some testing with a more basic DOM then because it doesn't seem to be working. Does the ac-content element have to be rendered as part of the initial DOM or is it OK to render it on the client, potentially replacing the element?


Best Regards,
Richard Simko
Cloud Tech Lead


You received this message because you are subscribed to a topic in the Google Groups "Atlassian Connect Dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/atlassian-connect-dev/I5tYHAh-4-g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to atlassian-connec...@googlegroups.com.

Einar Pehrson

unread,
Dec 20, 2016, 8:56:15 AM12/20/16
to atlassian-...@googlegroups.com
Hi Richard,

the element must be rendered as part of the initial DOM. If it's not, you need to use AP.resize() instead.

Cheers!
Einar

You received this message because you are subscribed to a topic in the Google Groups "Atlassian Connect Dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/atlassian-connect-dev/I5tYHAh-4-g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to atlassian-connect-dev+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

rahul....@gliffy.com

unread,
Jan 3, 2017, 4:44:48 PM1/3/17
to Atlassian Connect Dev
Seb,
I tried creating a new dev instance but still see version 3.2.11. Is v5-beta already rolled out?

Michael Staas

unread,
Jan 3, 2017, 7:07:58 PM1/3/17
to Atlassian Connect Dev
The v5 Confluence roll-out was delayed at Christmas due to unforeseen circumstances. We will recommence the roll-out as soon as possible and will post an update in this group. As noted in the original post, v5 is being enabled for existing instances and not automatically for new instances at this stage.

Regards,

Mike

Margus Nael

unread,
Jan 20, 2017, 3:30:21 AM1/20/17
to Atlassian Connect Dev
Hi!

Any news about this rollout?
We would like to do some final testing for our addon in larger scale, but only 1 instance has v5, thus its a bit of an impediment.

cheers,
Margus

Jon Bevan

unread,
Mar 2, 2017, 4:29:42 AM3/2/17
to Atlassian Connect Dev
Reply all
Reply to author
Forward
0 new messages