Code Monkey home page Code Monkey logo

expressionist.js's Issues

Duplicate symbol `assert` causes SyntaxError in strict mode

Several files declare a function "assert", which becomes a duplicate symbol after importing rtts-assert.assert as "assert". Since AMD builds are always running in strict mode, this causes problems. Lets rename this function to something less-conflicty

Filter evaluation is broken

In trying to fix up some failing tests today, I came across a disabled test which chains multiple filters.

The test fails pretty badly, and it seems that filter evaluation is not really doing what it should be doing. That's OK, but we should fix this. Basically, the filter visitor is being passed change records, but subsequent chained filters are not receiving anything. So, when the filter is evaluated, the incorrect value is passed in, and subsequent chained filters receive no values at all. That's borked :(

The thing I'm not really understanding about the current implementation in JS, is why filter visitor which performs evaluation cares about the watch AST at all. Filters should be called in reaction to a change to their inputs or parameters (basically how a PureFunctionAST would work), and passed the current values of the change records (in my understanding).

The Dart code goes a bit further by evaluating the expressions for each argument, this may also be necessary, but to start with I think just passing the current values for the changed records should be enough.

I'll look into this next week

Remove WatchParser

The presence of the WatchParser makes it impossible to use Expressionist without also taking a dependency on Watchtower. That's not good. To fix this, we need to move the WatchParser somewhere else. It could live in Templating or in it's own library.

Support watching sub-expressions (JSON values) as is done for function parameters

Cross-referencing angular/angular.js#7663

Basically, we do this already for function paramters, it needs to happen for JSON values too.

In fact, if a JSON literal expression contains non-const expressions, then most likely we should exclusively be watching the subexpressions, and not the JSON object itself --- so that we don't end up replacing the whole object and creating garbage.

We already do this for PureFunctionAST (and I don't think this should be removed as cargo cult), so we ought to do it for JSON literal properties too. I can't recall if we're already doing that, but I don't believe we have tests for it. I'll check

Feature: support PropertyProxies

In templating, we want to intercept reads/writes to a node. However, adding getters/setters for all properties of node to a proxy object is too slow (we did jsperf tests for this). Solution: introduce PropertyProxies.

A PropertyProxy is an object with the following methods:

  • createProxyGet(propertyName): returns a function that gets no arguments and returns the current value
  • createProxySet(propertyName): returns a function that gets the new value and applies it.

Integrated into expressionist.js, at every places where a getter/setter is allowed a PropertyProxy should be usable as well.

See angular/watchtower.js#23

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.