Giter Site home page Giter Site logo

cgb-gwt / gwt-vue Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dgloeckner/gwt-vue

0.0 0.0 0.0 3.43 MB

Shows how Vue.js components can be embedded into a GWT app. Features bi-directional communication between Vue and GWT ui components.

License: The Unlicense

Shell 1.78% JavaScript 3.82% Java 26.98% TypeScript 20.38% CSS 2.60% HTML 14.51% Vue 29.94%

gwt-vue's Introduction

GWT / Vue.js integration

Overview

The goal of this project is to show how Vue.js components can be embedded into a GWT app.

Imagine you have a large, dated GWT application and need to migrate it to a state-of-the-art UI framework ;)

So what do we need to be able to migrate our big, fat GWT app step by step?

  • Develop Vue.js components independently with a fast development cycle (e.g. hot code replacement).
  • Talk to Vue.js from GWT and the other way around.
  • Create and dispose Vue.js components from GWT without major headaches.

The main goal ist not to show how a "beautiful" Vue application could be built but focuses more on the aspect of clean integration between the 2 worlds.

Main contributions

  • web/src/main/java/dg/gwtvue/web/VueWidget.java is a GWT widget which enables seamless integration of Vue components with GWT apps.
  • vuecomponent/src/components/Parent.vue provides the top level class for Vue components.
  • vuecomponent/src/main.ts provides the middleware for integration.
  • Using npm run serve in vuecomponent-dev Vue components can be built and tested individually with hot code replace.
    • vuecomponent-dev/src/components/GwtMockEnvironment.vue provides a mock application framework in Vue similar to what the "toy GWT app" provides.

Running via Maven in GWT Dev Mode

In order to run the example via Maven in GWT Dev Mode, you need to do:

  1. Start the web application in Tomcat 7 via Maven
  2. Trigger integrated Vue.js build and GWT dev mode
  3. Run the application in your browser

To accomplish the first point, issue the following Maven command on a shell:

mvn clean install
mvn tomcat7:run-war-only

Your application is now deployed at http://127.0.0.1:8082/parent/.

To accomplish the second point, you need to build Vue.js components and start GWT Dev Mode. Open a second shell and execute:

build-vue-and-gwt.sh

On success, the GWT Dev Mode window opens. Click Launch Default Browser to open it in GWT Dev Mode.

What if GWT page does not update?

Try mvn clean install, start mvn tomcat7:run-war-only again and finally run build-vue-and-gwt.sh in a separate terminal.

gwt-vue's People

Contributors

dgloeckner avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.