Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ngPreboot #71

Closed
PatrickJS opened this issue Aug 9, 2015 · 5 comments
Closed

ngPreboot #71

PatrickJS opened this issue Aug 9, 2015 · 5 comments

Comments

@PatrickJS
Copy link
Member

built on top of preboot.js, pre-compile a mini angular for server view to recreate actions where the code path doesn't hit a call to the server or 3rd party module. The goal is to allow features such as two-way data binding and simple functionality such as NgIf

stages (may need more research and/or exploratory programming)

  • parse a class
  • figure out it's methods
  • figure out which methods with code paths do not hit a server call or 3rd party module
  • compile the ngTemplate using Angular's ngCompiler
  • match methods
  • recreate methods using vanilla js
  • recreate simple logic such as two-way data binding using vanilla js
  • proof of concept
@PatrickJS
Copy link
Member Author

@incrediblesound is working on the prototype

@incrediblesound
Copy link

Currently working on a prototype that parses the JS into esprima and transforms the esprima tree into a more compact, easily traversable tree. This stage is almost done. After that the idea is to extract events from the templates and find their code paths in the syntax tree. Once we have the branches responsible for handling the events it's just a matter of turning them back into vanilla JS.

@incrediblesound
Copy link

I threw together a template parser to use in the interim while we don't have ngCompiler for parsing templates, I'm using this single element as input:

<input #newtodo (keyup)="enterTodo($event, newtodo)">

And it produces this output node:

{"data":     
    { "elementType": "input",
       "identifier":"newtodo",     
       "events":[
                {"eventName":"keyup",
                "functionName":"enterTodo",
                "params":["$event","newtodo"]}
                ]
     },
"children":[],    
"parent":null}

@PatrickJS
Copy link
Member Author

we're going to push this back for when we have more time to work on it. closing for now

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants