GithubHelp home page GithubHelp logo

bladerunnerjs / brjs Goto Github PK

View Code? Open in Web Editor NEW
231.0 29.0 36.0 83.66 MB

BladeRunnerJS (BRJS) is an open source development toolkit and framework for modular construction of large single-page HTML5 apps. It consists of a set of conventions, supporting tools and micro-libraries that make it easy to develop, test, deploy and maintain complex JavaScript apps.

Home Page: http://bladerunnerjs.org/

License: GNU Lesser General Public License v3.0

Java 29.93% HTML 8.55% Shell 0.03% JavaScript 59.85% CSS 1.19% Groovy 0.42% Batchfile 0.02%

brjs's Introduction

BladeRunnerJS (BRJS)

Divide & conquer complex web apps

Build Status

Getting Started

The best way to get started depends on why you're here.

Documentation

The main documentation for BRJS can be found via http://bladerunnerjs.org/docs. The source code for the documentation can be found via https://github.com/BladeRunnerJS/brjs-site so if you find any error or have any suggestions please submit a pull request.

API reference guides are coming soon.

BRJS Core Toolkit Development

If you are interested in contributing to the BRJS core toolkit then the following information is of use.

How to build BRJS

Get the code

git clone [email protected]:BladeRunnerJS/brjs.git
cd brjs

Install JDK

BRJS is written and compiled using Java 8. Before running the build you will need to do the following:

  • Install Java 8 JDKs.
  • Configure JAVA_HOME to point to the Java 8 JDK home directory, as you prefer.
  • Configure the path environment variable to include $JAVA_HOME/bin.

If you install Java using the Windows installer than it places a 'java' executable in 'C:\windows\system32' that proxies to the most recently installed version of Java. You will either need to install your preferred implementation of Java last, or ensure that the path to the Java 'bin' directory appears before 'C:\windows\system32'.

Build a Distributable Zip

From the root brjs source directory:

$ ./gradlew brjs-sdk:distZip

The built zip file will be found in BRJS_ROOT/brjs-sdk/build/distributions/ in the format BladeRunner-VERSION.zip.

More information

See the BRJS Developer Setup Guide for more information. See how the BRJS team use Github and git.

brjs's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

brjs's Issues

Aspects should be optional

As per the title - Aspects should be optional.

This means that the contents usually found in an aspect should be able to reside within the root of an application.

From an upcoming blog/tutorial about BRJS and Angular:


Create the Todo App

Use the create-app command to scaffold a BRJS application.

$ ./brjs create-app brjstodo

For now, applications need to reside within an apps folder within the BladeRunnerJS directory. The above command will create an application called brjstodo within the apps directory. That directory will have the following contents:

apps/brjstodo
├── app.conf    # Application configuration
├── index.html  # Application entry point
├── src         # For app-level JavaScript
├── resources   # For other app resources
├── themes      # CSS and images
├── libs        # Other app libraries

Does this provide enough as an acceptance criteria?

BladeSets should be optional

BladeSets are a concept that have their uses, but aren't required to start of with.

Internally this may mean that there is a default BladeSet that doesn't reside within a bladeset- directory. But for the developer PoV there isn't a BladeSet.

Update create command plugin doc's

update with gradle build option, also review if a step is missing somewhere regarding the eclipse jar building


comment from @leggetter :
It's going to need a general overhaul since the CommandPlugin interface may get a new method (getUsageHelp) and the namespace has changed to org.bladerunnerjs.

It may break the doc flow to say "oh, you can do this with gradle too". So, may be worth considering another doc for gradle. I'll know more once I try it out.

Definitely worth having this issue to keep track.

comment from @thanhc :

Dom's made the changes now I believe, but on another note, I have followed the instructions but for some reason my command is not shown when running help, is there a step missing?

comment from @leggetter :
@thanhc I'll look at this when I get to this doc again. Probably late next week.

Allow separate JS files in tests to enable JS Code Coverage

Once BRJS can support generating individual .js files as an option, instead of bundling them all.

Currently code coverage cannot be generated as the js bundle cannot be instrumented. Once the individual file option is available, then the files can be instrumented. At that time we should enable the production of UT code coverage, and if possible AT code coverage.

Simplified application directory structure

Let's use this space to keep track of the possible options - and final decision. Please add any additional ideas structure ideas here (after discussion, if required).

And use comments to discuss (or a meeting if required).

1. No Default Aspect directory & -blade directories

This is probably more aligned with current simple application structures. The Aspect content is shifted into the root of the app. Blades are in directories in the root of the app with the directories having a suffix of -blade (similar to the -aspect and -bladeset suffixes).

+- myapp
|   \- <bladename>-blade
|   \- <bladename>-blade
|   \- <bladename>-blade
|   \- libs
|   \- src (JS source for Default Aspect)
|   \- themes (themes for Default Aspect)
|   -- app.conf
|   -- index.html (Default Aspect seed file)

2. Default Aspect directory & -blade directories

+- myapp
|   \- <bladename>-blade
|   \- <bladename>-blade
|   \- <bladename>-blade
|   \- default-aspect
|   \- libs
|   -- app.conf

3. No Default Aspect directory & blades directory for all Blades

In this example the blades go underneath a blades directory. This is consistent with blades that reside within BladeSets.

+- myapp
|   \- blades
|       \- blade1
|       \- blade2
|       \- blade3
|   \- libs
|   \- resources (resources for Default Aspect)
|   \- src (JS source for Default Aspect)
|   \- themes (themes for Default Aspect)
|   -- app.conf
|   -- index.html (Default Aspect seed file)

4. Default Aspect directory & blades directory for all Blades

In this example the blades go underneath a blades directory. This is consistent with blades that reside within BladeSets.

We keep default-aspect.

+- myapp
|   \- blades
|       \- blade1
|       \- blade2
|       \- blade3
|   \- default-aspect
|   \- libs
|   -- app.conf

Blades Simplified Directory Structure

This is actually issue #80.

The main suggested change here is to .js files directly under the src directory to use the blade require prefix (remove the need to repeat the app directory structure).

+- myblade
|   \- resources
|       \- html
|       \- 18n
|       \- xml
|       -- aliases.xml
|   \- src
|       -- MyBlade.js
|       -- MyClass.js
|   \- tests
|   \- themes
|   \- workbench

Note: I've left out #880 (simplify tests directory structure) from this.

Support additional test runners via TestPlugin

As covered in the Model & Plugin Design and to facilitate #7 it would be great to support additional TestPlugin implementations.

  • - create the ability for TestPlugins
  • - change the current test command so it uses the plugins
  • - create a WebDriver test plugin - #87
  • - ensure the WebDriver plugin works with any browser and with absolute paths - #628
  • - create a JSTD test plugin - #85

Improve developer debug experience by allowing individual JS files to be served in an app

JavaScript (and other) files are always bundled. This makes debugging JavaScript very difficult:

  1. Very large files make finding code difficult
  2. The files are so large that browser debuggers can't find the source of exceptions and keep track of breakpoints

This also impacts #7.

Technical task:
Update js bundler servlet to serve files individually in dev by default, but with a configuration switch in app.conf to turn it back to the old way

comment from @andyberry88
'can we have a command line switch so this can be done easily as a one off? e.g. in CI i might want a bundle but in dev single files.'

see https://github.com/BladeRunnerJS/brjs-private/issues/170 for original issue

[EPIC] Improve unit test developer experience

At the moment it seems like the process is as follows:

  1. Start the test server using the CLI: ./bladerunner test-server
  2. Connect one or more browsers via http://localhost:4224/capture
  3. In another console/terminal tab run ./bladerunner test <test_location_to_scan>

In theory this doesn't seem to bad. However, based on my experience:

  • Working out why a test fails is very difficult if the error occurs in js.bundle
  • Running the tests sometimes gets stuck in a <browser_name>: reset slow cycle
  • Running the tests sometimes results in the tests executing but the process not exiting
  • Firefox sometimes hangs
  • The server seems to take a long time to detect a browser has disconnected (30 seconds?)
  • The debug experience is very difficult as the browser frequently doesn't actually know which line you are debugging (due to the size of js.bundle).
  • CLI lists a Java exception when the JavaScript tests fail, which is confusing. It should just list the JavaScript test results and exceptions.

This is a very important part of the development workflow, so we make some improvements here.

Support for Static File deployment

BRJS currently only supports deployments as WAR files. We need to support deployments in simple flat files for deployment to hosting such as GitHub pages or any CDN.

  • create an export command for flat-file export
  • create a filter so that the bundles can be referred to using their proper extension type, in preparation for flat file export
  • Remove WEB-INF (#90 and #91)

Related:

CLI to support packaged/namespaced commands e.g. app:create, app:delete

I like the Heroku toolbelt CLI usage.

heroku help

heroku help
Usage: heroku COMMAND [--app APP] [command-specific-options]

Primary help topics, type "heroku help TOPIC" for more details:

  addons    #  manage addon resources
  apps      #  manage apps (create, destroy)
  auth      #  authentication (login, logout)
  config    #  manage app config vars
  domains   #  manage custom domains
  logs      #  display logs for an app
  ps        #  manage dynos (dynos, workers)
  releases  #  manage app releases
  run       #  run one-off commands (console, rake)
  sharing   #  manage collaborators on an app

Additional topics:

  account      #  manage heroku account options
  certs        #  manage ssl endpoints for an app
  db           #  manage the database for an app
  drains       #  display syslog drains for an app
  fork         #  clone an existing app
  git          #  manage git for apps
  help         #  list commands and display help
  keys         #  manage authentication keys
  labs         #  manage optional features
  maintenance  #  manage maintenance mode for an app
  pg           #  manage heroku-postgresql databases
  pgbackups    #  manage backups of heroku postgresql databases
  plugins      #  manage plugins to the heroku gem
  regions      #  list available regions
  stack        #  manage the stack for an app
  status       #  check status of heroku platform
  update       #  update the heroku client
  version      #  display version

heroku help apps

heroku help apps
Usage: heroku apps

 list your apps

Example:

 $ heroku apps
 === My Apps
 example
 example2

 === Collaborated Apps
 theirapp   [email protected]

Additional commands, type "heroku help COMMAND" for more details:

  apps:create [NAME]   #  create a new app
  apps:destroy         #  permanently destroy an app
  apps:info            #  show detailed app information
  apps:open            #  open the app in a web browser
  apps:rename NEWNAME  #  rename the app

Node.js module-style code support

As we all know, this is a priority.

We want to be able to write code so that the auto-generated classes look as follows:

var br = require( 'br' );

var Property = require( 'br/presenter/Property');
var PresentationModel = require( 'br/presenter/PresentationModel' );

function ExampleClass() {
  this.message = new Property( "Hello World!" );
};
br.extend(ExampleClass, PresentationModel);

ExampleClass.prototype.buttonClicked = function() {
  console.log( 'button clicked' );
};

Relies on #227 and #230.

brjs command global install

Make brjs a globally installed command, where the apps and sdk live independently of each other.

To achieve this I'm assuming that the CLI commands may also need to be context-aware (#885) e.g. run brjs create-blade from within an application directory to create a Blade for an app

  • - context aware commands - #885 [deprioritised]
  • - change BRJS.initialize so it no longer scans upwards to find the BRJS dir - #95
  • - update the BRJS.initialize() method to take two directories instead of one in preparation for making BladeRunnerJS a global command - see #93
  • - Allow BRJS to be run from outside of the SDK directory by putting brjs on the PATH - #1130
  • - allow apps to live seperately from the sdk - #1154

Auto-generated class files should be named based on the Blade name

If you generate a blade called todo-input the auto-generated file should be TodoInput.js and the class definition should be something like:

var br = require( 'br' );

var Property = require( 'br/presenter/Property' );
var PresentationModel = require( 'br/presenter/PresentationModel' );

function TodoInput() {
  this.message = new Property( 'Hello World!' );
};
br.extend( TodoInput, PresentationModel );

TodoInput.prototype.buttonClicked = function() {
  console.log( 'button clicked' );
};

Make JSDocs available

It would also be awesome if the docs could point to their respective source files. This wasn't possible when we were close source - tis now! Woop!

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.