Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for new versions of Vue.js #6

Closed
slavap opened this issue Oct 17, 2017 · 4 comments
Closed

Support for new versions of Vue.js #6

slavap opened this issue Oct 17, 2017 · 4 comments
Assignees
Milestone

Comments

@slavap
Copy link
Contributor

slavap commented Oct 17, 2017

Current vue version is 2.5.2.
Is there any proper way how to configure vue-gwt to use newer version of vue, or it's supposed to be always hardcoded in vue-gwt? Then when to expect new release of vue-gwt based on 2.5.2 ? It would be nice to have vue dependency configurable, for example loaded manually in index.html

@adrienbaron
Copy link
Collaborator

adrienbaron commented Oct 17, 2017

We are working on beta-3 that will include the upgrade to 2.5.2 (the commit is actually already on develop)

For the fact that the version has to be hardcoded it's a little more complicated.
Vue GWT uses two parts of Vue.js, the template compiler and the runtime. Both are released at the same time as part of a new version of Vue.js.
The template compiler is used at GWT compiled time. It's loaded into Nashorn (the JS engine in the JVM) and used to compile the HTML templates of the components to a JS render function. So it can't be provided by the user of the library.
The runtime is used as it's name indicates at runtime and is injected by Vue GWT in your document when your app starts.

It's possible to provide your own runtime, in any version, if you wish to. For that you just get the vue.runtime.min.js from Vue.js repo. In your code you then call VueGWT.initWithoutVueLib(); instead of VueGWT.init(); to avoid injecting the runtime included in Vue GWT.
Depending on the change in the Vue template compiler, the runtime might not be compatible, and Vue doesn't intend to work with a difference of version between the template compiler and the runtime. But if the template compiler hasn't changed between versions then it will work. Sadly it changed a lot in 2.5, so I'm not convinced for that update, but you can try.

Lastly, some new features of Vue.js require new Java declaration to work, for example in 2.5 the new error handler will require a new interface to implement in Vue GWT.

@slavap
Copy link
Contributor Author

slavap commented Oct 17, 2017

Thank you for detail explanation. I’m absolutely ok with some reasonable waiting for update vue-gwt, just wanted to be sure that project will follow vue release cycle.

@adrienbaron adrienbaron self-assigned this Oct 17, 2017
@adrienbaron adrienbaron added this to the Beta 3 milestone Oct 17, 2017
@adrienbaron
Copy link
Collaborator

adrienbaron commented Oct 17, 2017

@slavap I just saw that backward compatibility with previous compilers is actually ensured in Vue.js 🎉!
If you look at this github issue, Evan You the creator of Vue.js ensure that template compiled in previous version should work in new ones.
So you should be able to swap the runtime for a more recent one if needed.

@adrienbaron
Copy link
Collaborator

Vue GWT has just been updated to Vue.js 2.5.5 on beta-3.

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

No branches or pull requests

2 participants