Git Product home page Git Product logo

jsweet-quickstart's Introduction

JSweet quick start

A simple project to get started with JSweet. This project just contains a main method that shows 'Hello world' messages in two different ways. The program uses the J4TS candy to access java.util API, and the jQuery candy. Programmers can use it to set up a new JSweet project and try out some basic features.

Usage

> git clone https://github.com/cincheo/jsweet-quickstart.git
> cd jsweet-quickstart
> mvn generate-sources
> firefox webapp/index.html

Modify

At any time, you can modify the Java files (or add new files) and run mvn generate-sources to generate the corresponding JavaScript files. You can then use them in the index.html file (<script> tags).

You can modify the generation options by modifying the plugin section for jsweet-maven-plugin. When having a project with multiple source files, a good generation option to turn on is the bundle option, in order to generate all the JavaScript classes in a single file. Check the Maven plugin for the full option list.

If you want to use a JavaScript library (besides jQuery which is already enabled), you must add the Maven dependency in the <dependencies> section of the pom.xml. You can copy-paste the Maven dependency description from our Candy browser, or from our online Maven repository. When running mvn generate-sources with a new library, if available in the candy, the JavaScript library will be extracted to the location given by the candiesJsOut option (here in the webapp directory). JavaScript libraries are packaged in the Jar following the WebJars conventions. When not available, you will need to find and download the JavaScript library manually (or using a third-party tool such as Bower).

Prerequisites

jsweet-quickstart's People

Contributors

dasa avatar davidmoten avatar lgrignon avatar renaudpawlak avatar

Stargazers

 avatar

Watchers

 avatar  avatar  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.