Giter Club home page Giter Club logo

mozaic's People

Contributors

andreip avatar arcade avatar bogdan-zaharia-hs avatar bogdanciobanu avatar bogdansss avatar cbarca avatar dianatatu avatar ovidiuch avatar teobaluta avatar topliceanu avatar valentinzberea 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

Watchers

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

mozaic's Issues

Automatic Bundling of Require.js Coffeescript App

Our SPA is using both require.js and Coffeescript. Right now, code is
fetched on-demand from the server as we need it, and is fetched
directly as Coffeescript. We want to change this in two ways:
- have a global switch which allows us to either a) fetch
Coffeescript or b) fetch JS. This global switch should somehow impact
the require.js Coffeescript loader, which should point to the default
loader when the global switch is enabled. Otherwise, it would compile
the Coffeescript code on the fly, as usual (in order to make it easy
for us to develop)
- have a packaging script which, based on a configuration file, takes
the existing Coffeescript files, compiles them into JS, minifies them,
bundles them together and archives them (into .jgz). Make sure that
the require.js behavior remains correct: whenever you request a file
from a given bundle B, the whole bundle should be fetched from the
server
You will be able to see the improvements by serving the TODO list app
with a web server with a single worker (such as Django's manage.py
runserver, or such as gunicorn with a single worker)

State management from core doesn't play well with blank states for lists

If we need to provide a blank state for a list of items, the default state management mechanism from widget.coffee doesn't play well with this: it calls changeState if old state differs from the new state or new state is available.

Therefore, when modifying an individual widget shown in the list, the whole list will be re-rendered instead of the individual item being re-rendered.

add expandPath utility method

Give an object:

        releases =
            browsers:
                Chrome:
                    2010: 2
                    2011: 5
                Firefox:
                    2010: 2
                    2011: 5

Utils.expandPath('browsers/*', releases) method should return:

[ 'browsers/Chrome', 'browsers/Firefox']

test channels_utils

add tests for channels_utils.coffee. Understand what the methods are doing and think of cases that could cause problems.

Add ModalWidget base class

Add a base class for widgets that only work in modal dialogs, so that we can easily reuse (and eventually fix) all hacks involved with the modal window.

add tests for raw_data

Try to figure out what the code does, and think of ways to test it.

add new tests for raw_data to check if its methods and behavior is OK.

Invalidate on fetch is not followed by any event in case of duplicates

We are triggering an invalidate each time before fetch.

https://github.com/uberVU/mozaic/blob/master/core/datasource/channel/read.coffee#L126-L131

            receiving_channel.url = Utils.render_url(conf.url, params, [], conf.fetch_through_POST)
            # Trigger a custom invalidate event before fetching the
            # collection from the server (invalidate gets triggered
            # every time a request is made to the server). The format
            # of the event is: model, collection
            receiving_channel.trigger('invalidate', null, receiving_channel)
            receiving_channel.fetch(fetch_params)

And this is good because we can tell when a widget enter the loading state:

            previousStates = _.clone(@loadingStates)
            for event, i in params
                if event.type == 'no_data'
                    @loadingStates[i] = 'empty'
                if event.type == 'invalidate'
                    @loadingStates[i] = 'loading'
                if event.type in ['sync', 'change', 'reset', 'add', 'destroy']
                    # Check to see if the data on this specific channel is empty
                    if @isChannelDataEmpty(event, @loading_channels[i])
                        @loadingStates[i] = 'empty'
                    else
                        # Data has arrived on loading channels, the state should
                        # be available
                        @loadingStates[i] = 'available'
            @transitionState(@loadingStates, previousStates, params)

But what happens when you try to add new items to a channel (paging scenario)? Before the fetch an invalidate is triggered followed by several add events (each one for the new items added to collection).

But when you receive only duplicates the add event is not triggered anymore and the state remains in loading indefinitely.

Add support for print=true fragment of URL that puts a top media-type-print class and includes print CSS bundle

Modifications needed:

  • in includes.js, AFTER we include the static bundles, check via jquery.url.js plugin (can't do it via Utils because it's not loaded yet) if the print=true parameter is present in hashtag. If it's true, also include the print CSS bundle and but a media-type-print class on body (note: we need the class method because media queries not properly supported by IE)
  • in static.js, include a new section for print CSS and make it empty by default

Move preloading of widget channels from widget_starter to widget

The idea is to encapsulated the waiting for channels to initialize (because of async requires of models and collections) inside the widget. It currently is in the widget starter.

This will also allow us to subscribe to newly created channels all inside a widget's initialize method. This is not currently possible.

This is a ballpark schema of the widget_starter > widget -> datasource flow
2013-01-24 11 57 36

test pubsub, extend existent tests

there are some existent tests in tests/pubsub_tests.coffee. Try to figure out what they do and add to the tests.

also, don't go into the "private" methods beginning with underscore, try to use the public and friendly ones.

replace setInterval with setTimeout in datasource.coffee

Right now the expired collections are collected every 10 seconds by checkForUnusedCollections method:

setInterval(@checkForUnusedCollections, @checkIntervalForUnusedCollections)

In order to make tests run faster I would like to be able to override checkIntervalForUnusedCollections property. This would be achieved by replacing setInterval with setTimeout and schedule another callback at the end of checkForUnusedCollections method.

@uberVU/mozaic-core-commiters

Keep CoffeeScript up to date

So far I updated it to 1.3.3 in order for the current code to work, but the current version is 1.4.0 and we should test it and update to it as soon as possible.

Refactoring in widget.renderLayout

pipe = loader.get_module('pubsub')
pipe.publish('/new_widget_rendered', @params['widget_id'], @params['name'], this)
@rendered_signal_sent = true

These lines are called in renderLayout. Extract a method that would be needed when implementing custom triggers to /new_widget_rendered event

Make index.html more agnostic

index.html shouldn't be changed by the average user ideally, so

  • We shouldn't keep a hardcoded <title>TodoVU</title> since they come from the urls.js configuration. And even if we want a fallback one, it should come from a config variable
  • Any global markup should be kept in page.hjs, outside .controller-container, and not in index.html. Especially stuff like <div class="ubervu-logo"></div> https://github.com/uberVU/mozaic/blob/master/index.html#L21-22

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.