Git Product home page Git Product logo

nalu's People

Contributors

elnicko avatar frankhossfeld avatar gitter-badger avatar hpehl avatar masterdany88 avatar philipp-kohl avatar philkohl avatar raulpampliegamayoral avatar saschamuench avatar tdesjardins avatar

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

nalu's Issues

create AbstractContext class

Looking forward when Nalu will have modules, the context will be the only class that all sub modules must know. To avoid having a core module containing the context class, create an abstract context class containing a HashMap<String, Object> to store the data o f the context.

The simplest way to use it, will be extending AbstractContext.
In this case you need to cast the return every time you get data from the context.

A more likely method will be writing a getter method for each data expected inside the data store and cast the data inide the return statement.

Provide other ways to create controllers and components

Right now controllers, components, and composites have to have a public, zero-argument constructor. This works well with APT and code generation but limits the possible use cases.

For instance, I'd like to use Elemento templates as components. This is currently not possible since Elemento templates don't have a public, zero-argument constructor. Instead, they have to be created using a static factory method (which returns the generated template class).

As a workaround, I have two "views":

  1. the Nalu component which contains the bulk of the component code & logic and
  2. the Elemento HTML template as a dumb view which is created in the render method of the component.

I use this technique in one of my projects. See the code in package org.jboss.schlawiner.client.settings as an example.

If Nalu provided a way to customize the creation of the component, I could get rid of the extra "view" class.

Add component view cache feature

Use case:

  • A user is seeing the page 15 of a table of entities.
  • The user clicks on editing an element so Nalu routes to the editing component.
  • The user clicks the browsers backbutton and returns to the table but to the first page of the paged view not the 15ΒΊ.

The component was destroyed and created a new one so the last status is lost. We should have a way to conditionally avoid this behaviour.

Can be similar to this: https://github.com/gilberto-torrezan/gwt-views#caching

On Vue we can obtain a similar results using keep-alive feature: https://vuejs.org/v2/api/#keep-alive

Angular has too this feature: https://medium.com/@gerasimov.pk/how-to-reuse-rendered-component-in-angular-2-3-with-routereusestrategy-64628e1ca3eb

add support for controllers without route

At the moment Nalu does not support controllers that does not have a route. The only Nalu component are handlers, which have by definition no visible part.

Create a feature in Nalu, that a controller can be triggered by an event.

The controller of this new feature

  • have no corresponding route (no history support)
  • are not placed in a slot of a shell using the selector
  • will get the parameter within an event
  • and the component are automatically created bay Nalu in case an event is fired
  • are identified by a naming condition

This feature will make it quite easy to deal with popups using Nalu.

Provide utility methods to compare routes

In some cases it might be necessary to compare routes. Depending on the context of the route, parameters might be differently marked.

Provided methods that handle these different notations.

implement block feature

Blocks are visible components which does not depend on an event nor a route.

Blocks have a relative position to there parent element (must be coded by the dev)

implement filter policy

A filter policy describes when the filter will be used.

Default will be every time, so that in case of a routing the filter will be used.

The policy will tell Nalu, that the filter will be used only for some routes or depending on a condition.

Improve routing

A controller uses the variable name inside the name. A definition looks like that:

/application/:token/dashboard

To route to this controller a String like this is expected:

/application/*/dashboard

This needs more coding in case the routes are gather inside another class, cause this required to entries for one routing.

Using the first string to route causes an error. Allow using the first String to route.

Loader functionality for shell

The Loader (AbstractApplicationLoader) enables the application to load data from server and wait for finishing the load process with finishLoadCommand.finishLoading();

A same idea can be used within the Controller (AbstractComponentController) in the bind-function with loader.continueLoading();

In my case I need to load data from the server during the change of the Shell (AbstractShell), so that the retrieved data can be added to the context and used in every Controller in this Shell.

The change of the bind-function seems to be a breaking change. Maybe a bindTillFinished-function would be a possibility to implement this without any breaks.

Add HandlerManger to controller

Add HandlerManager to the controller, so that event handler registrations can be added.

Once the controller stops, Nalu can remove all handler registrations from the event bus automatically. (as long they are registered at the HandlerManager)

Replace gwt-event source files with gwt-event from Maven Central

Nalu is moving forward for the first release and to be deployed on Maven Central with version 1.0.0.

Because of the dependency to "org.gwtproject.event:gwt-event", there are problems using Nalu because of the vertispan repo - where gwt-event is currently hosted. Some enterprises do not allow to use repo, that are not Maven Central or Maven Central SNAPSHOT.

To solve this problem, the gwt-event source files are (temporally) added to Nalu.

Once gwt-event is deployed on Maven Central, the source files of gwt-event will be removed and the dependency to gwt-event will be added (again).

Caching of composite doesn't work as expected

The new feature "caching composites" doesn't work as expected.

If you have two components A and B configured with a cached composite the following happens:

  1. Route to component A -> composite is visible
  2. Route to component B -> composite is also visible
  3. Route to component A again -> composite isn't visible (not expected)
  4. Route to component B again -> composite is visible

In both controllers of the components the same composite configuration is used:

@composite(name = "searchComposite", compositeController = SearchComposite.class, selector = "searchId")

Add a new method onLoaded to the Controller

Can you please add a method called onLoaded maybe, which is called AFTER the component was added to the DOM.

Background: I have to add a 3rd party app which is looking for DIV with a certain ID to render some stuff.

Thank you

Redirect to start url in case of missing hash

Nalu redirect to error page when there is no hash passed. It should instead redirect to starturl/home which is declared in Nalu Applicatio Configuration.
This is happening only when You start app with no hash url like https://host or https://host/index.html and then go to nalu subpage and then go back using back browser button url back android button.

improve error handling

at the moment the error gets represented by using the error route. This is limited.

Instead using the error route, fire an error event, which can be catched by a controller, PopUpController, Handler, etc. and handles the error.

Allow creation of "Items"

It would be grate, if Nalu allowed the creation of "Items" (Sorry, I do not have a better name).

It would be something like a Composite, so a sub-unit/item with context/eventbus (maybe without router). But I want to create multiple of these items with code, and not like a composite with an annotation.

Think about it like a "BasketComponent" which has several "BasketItems" with their one logic like changing the quantity, removing etc.

Make conditionals composite components

It would be nice if composite component could be conditional. For example, if you have one page with the same content and depending on who has been logged in, you can have one composite component or another

make the behavior in case of missing hash configurable

This issue extends the solution of #51 .

Add a new attribute to the Application annotation: stayOnSide. Default value is false. In this case Nalu will behave like a web application using the back button.

In case the value is true, Nalu will replace the url.

Add methods for activation state to controller

In some cases (caching controllers) there is a need to get control over activation state of contollers. For example if you route from one controller to another while caching is enabled. If the controller is already cached the method start would't be called. In this cases it would be useful to have methods activate() and deactivate() to do things when the component will be shown or hidden.

Add caching support for composites

Controllers can be cached for reusing.

router.storeInCache({controller instance});

It would be useful to also have this caching feature for composites.

Composite added to shell not removed

In case a composite is added to the shell, it will no be removed in case a routing occurs.

Solution:

  • the parent controller - which knows all of his composites has to call composite.remove()
  • the AbstractCompositeController should call the remove() of the CompositeComponent

Rename shell methods: attachShell and detachShell

Inside the controller and composites, the attach- and detach-methods are called onAttach and onDetach.

Inside a shell these methods are called attachShelland detachShell.
Rename this methods to onAttach and onDetach to be consistent with controller- and composites-classes.

remove plugin feature

once sub modules (#62) are implemented, there is no longer a need for the plugin feature.

Remove the plugin feature from Nalu.

Rest api like support for html routing

Please add support for rest api like routing. Currently we have to add parameters at the end of resource url. It will be great to have dynamic url like: app/users/23/adressess.
So we could add variables/ parameters inside the url. Not only at the end.

Implement a "RoutingEvent" after routing was done

Please add a "RoutingEvent" in Nalu, which I can listen for.

Background is: The "current menu" items is highlighted, but when the route changes, the old menu item is still highlighted. I want to change that.

Bug when routing in PopupController

In a Nalu PopupController I do a router.route("xxxxx") and I get an

Exception: com.google.gwt.core.client.JavaScriptException: (TypeError) : Cannot read property 'route_5_g$' of undefined
This seems to be a bug in Nalu,b ecause routing outside a PopupController works.

Improve error handling in Nalu

Nalu has an error route to communicate internal errors. Therefore the router has an internal Nalu Error Message class. This class can not be used, caused it is not accessable.

It would be nice to have the opportunity to add application error messages to the router, so that they can be requested inside an error controller.

Add bind method to controller

Add a bind method to the controller, that will be called before the component is created.
This method enables the controller todo some things before the start method is called. This is f.e.: useful in case working with composites.

The newly implemented bind method should be asynchron, so that it is possible to do a server call inside this method.

Composite added to shell not removed

In case a composite is added to the shell, it will no be removed in case a routing occurs.

Solution:

  • the parent controller - which knows all of his composites has to call composite.remove()
  • the AbstractCompositeController should call the remove() of the CompositeComponent

NaluProcessor generates duplicate code

The generation of the Composite registration is generated two times for every:

@Override
public void loadCompositeController() {
  // create Composite for: com.github.nalukit.nalu.processor.common.ui.controllerWithComposite03.composite.CompositeController03
  CompositeFactory.get().registerComposite("com.github.nalukit.nalu.processor.common.ui.controllerWithComposite03.composite.CompositeController03", new com.github.nalukit.nalu.processor.common.ui.controllerWithComposite03.composite.CompositeController03CreatorImpl(router, context, eventBus));
  // create Composite for: com.github.nalukit.nalu.processor.common.ui.controllerWithComposite03.composite.CompositeController03
  CompositeFactory.get().registerComposite("com.github.nalukit.nalu.processor.common.ui.controllerWithComposite03.composite.CompositeController03", new com.github.nalukit.nalu.processor.common.ui.controllerWithComposite03.composite.CompositeController03CreatorImpl(router, context, eventBus));
}

This does not create any issues, cause the factory uses a map and an existing key will be replaced!

Avoid the duplicate code generation.

Thanks David for reporting ...

Feature Request: Allow Nalu app to be embedded into existing webpage.

I am developing a little Nalu app. It will be an order form "living" in an existing webpage.
I think a div displayed as a popup or so.

This means I have no control over the URL which Nalu uses for routing. On the other side, I do not need to support deeplinking or "reload"ing the page and preserve states.

According to Frank, "the current version does not support it. But it should be easy to do. "

So I am asking for this feature to be implemented!

Thank you,
Bernhard

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.