Skip to content
This repository has been archived by the owner on Apr 21, 2021. It is now read-only.

Liferay environment: how to get current senna version? #214

Closed
caneta opened this issue May 18, 2017 · 8 comments
Closed

Liferay environment: how to get current senna version? #214

caneta opened this issue May 18, 2017 · 8 comments

Comments

@caneta
Copy link

caneta commented May 18, 2017

Hello everyone!
I have a simple question: having a Liferay 7 environment up and run, is there a way to get the version of senna used by the portal?
Maybe with some function call in the JavaScript console of the browser, or looking inside the OSGi module that contains the library?
Thank you

@ssmith353
Copy link

hey @caneta ,
You should be able to access senna via the Liferay object.

In the javascript console try to access senna via:

Liferay.SPA.app

@caneta
Copy link
Author

caneta commented May 19, 2017

Ok, I know that, but I want to get senna version.
Something like jQuery, if possible:

> jQuery.fn.jquery
2.1.4

Otherwise tell me where to look inside the portal to get that string.

@jbalsas
Copy link
Contributor

jbalsas commented May 19, 2017

Hey @caneta, I don't think we have a runtime way to get it right now... the closest way is the frontend-js-spa-web/package.json where we specify the version of Senna.js that will get bundled.

It is semver-like, but we're always updating to the correct version and shrinkwrapping, so the one seen there should be the one in your portal installation.

@caneta
Copy link
Author

caneta commented May 19, 2017

Hi @jbalsas, my problem is that I have a Liferay 7 CE GA3 without sources.
So I'm going to my Liferay Workspace and then bundles/osgi/marketplace/, I decompress Liferay CE Foundation.lpkg, I get com.liferay.frontend.js.web-1.0.10.jar, decompress it too and the package.json included in it is the following:

{
	"name": "frontend-js-spa-web",
	"version": "1.0.10"
}

Probably this is not the correct place to look for...Have I to download sources of GA3 in order to get that information?

---- Edit ----

In the GA3 sources I get the same package.json as reported above.

@jbalsas
Copy link
Contributor

jbalsas commented May 19, 2017

Mmm... in GA3 that info might be in the build.gradle file, as a sennaVersion?

In any case, we can try to do something similar to what we did in liferay-loader-amd as well...

@caneta
Copy link
Author

caneta commented May 19, 2017

Yes, @jbalsas you're right: in sources of GA3, inside modules/apps/foundation/frontend-js/frontend-js-spa-web/build.gradle, we have String sennaVersion = "1.2.0".

A feature like the one for the AMD loader would be great!

In my opinion such a feature is fundamental for every frontend tool, not only for the AMD loader or senna.js but it could be very helpful for Lexicon and metal.js as well, for example.

This because I'm always struggling on different Liferay instances, CE and DXP, wondering wich tool I'm working with: knowing it in a simple manner like the one implemented for the Loader will be a great improvement to my daily work.

For example, uderstanding that a bug is due to an older version of a tool could lead me to patch the portal with the latest version until the next fixpack/CE release which includes it.

Thank you

@diegonvs
Copy link
Contributor

diegonvs commented Dec 4, 2017

Hey @caneta @jbalsas #232 :)

@diegonvs
Copy link
Contributor

diegonvs commented Mar 21, 2019

On Liferay 7.1, you can use Liferay.SPA.version. Any questions, reopen, please.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants