angular / expressionist.js Goto Github PK
View Code? Open in Web Editor NEWExpression parser for Angular 2.0
License: Other
Expression parser for Angular 2.0
License: Other
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
See https://github.com/angular/angular.dart/blob/master/lib/core/parser/syntax.dart
Provide an isAssignable
property/function on the Expression
.
To be able to cache the AST of expressions the WatchParser should get the already parsed AST and not the expression string as input.
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
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.
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
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 valuecreateProxySet(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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.