IP Library Granted Patent US 10,331,781
Granted Patent B2
US 10,331,781 · App. 15/616,205 · Granted Jun 25, 2019

Template compilation using view transforms

Inventor: Ferhat Buyukkokten (Palo Alto, CA)
Assignee: Google LLC
G06F17/248G06F8/41G06F8/443G06F8/52G06F17/272
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,331,781
App. No.
15/616,205
Granted
Jun 25, 2019
Kind
B2
Abstract

Methods, systems, and apparatus include computer programs encoded on a computer-readable storage medium for template compilation. A method includes: identifying, within a portion of code, a code template; parsing the template to identify a defined transform and a DOM node to which the transform is to be applied; generating, based on the defined transform and the DOM node, a set of code that transforms the DOM node according to the defined transform; replacing the DOM node with the set of code; and transmitting, to a user device, the set of code to present the transformed DOM node at the user device.

Claims (46)

1. A method, comprising:

compiling a code template of source code, wherein compiling the code template of the source code comprises:

identifying, within a portion of the source code, a code template;

parsing the code template to identify, within the code template, a defined transform and a Document Object Model DOM node to which the transform is to be applied;

generating, based on the defined transform and the DOM node, a set of code that transforms the DOM node according to the defined transform; and

replacing, within the code template, the DOM node with the set of code that was generated based on the defined transform; and

transmitting, to a user device, the compiled code template including the set of code to present the transformed DOM node in a web page at the user device.

2. The method of claim 1 , wherein generating the set of code comprises:

creating a new controller instance for the defined transform; and

constructing one or more DOM nodes for the defined transform.

3. The method of claim 2 , wherein generating the set of code further comprises, after creating the one or more DOM nodes, creating bindings for attributes on the one or more DOM nodes.

4. The method of claim 3 , wherein generating the set of code further comprises calling a controller attach method.

5. The method of claim 4 , wherein generating the set of code further comprises calling a controller detach method.

6. The method of claim 1 , wherein the defined transform accepts a view and a Boolean value and returns the view when the Boolean value is true and returns an empty view when the Boolean value is false.

7. The method of claim 1 , wherein the defined transform accepts a value and a collection and returns a copy of the view for each item in the collection.

8. A system comprising:

one or more processors; and

one or more memory elements including instructions that when executed cause the one or more processors to:

compile a code template of source code, wherein compiling the code template of the source code comprises:

identifying, within a portion of the source code, a code template;

parsing the code template to identify, within the code template, a defined transform and a Document Object Model DOM node to which the transform is to be applied;

generating, based on the defined transform and the DOM node, a set of code that transforms the DOM node according to the defined transform; and

replacing, within the code template, the DOM node with the set of code that was generated based on the defined transform; and

transmit, to a user device, the compiled code template including the set of code to present the transformed DOM node in a web page at the user device.

9. The system of claim 8 , wherein generating the set of code comprises:

creating a new controller instance for the defined transform; and

constructing one or more DOM nodes for the defined transform.

10. The system of claim 9 , wherein generating the set of code further comprises, after creating the one or more DOM nodes, creating bindings for attributes on the one or more DOM nodes.

11. The system of claim 10 , wherein generating the set of code further comprises calling a controller attach method.

12. The system of claim 11 , wherein generating the set of code further comprises calling a controller detach method.

13. The system of claim 8 , wherein the defined transform accepts a view and a Boolean value and returns the view when the Boolean value is true and returns an empty view when the Boolean value is false.

14. The system of claim 8 , wherein the defined transform accepts a value and a collection and returns a copy of the view for each item in the collection.

15. A computer program product tangibly embodied in a computer-readable storage device and comprising instructions that, when executed by a processor, cause the processor to:

compile a code template of source code, wherein compiling the code template of the source code comprises:

identifying, within a portion of the source code, a code template;

parsing the code template to identify, within the code template, a defined transform and a Document Object Model DOM node to which the transform is to be applied;

generating, based on the defined transform and the DOM node, a set of code that transforms the DOM node according to the defined transform; and

replacing, within the code template, the DOM node with the set of code that was generated based on the defined transform; and

transmit, to a user device, the compiled code template including the set of code to present the transformed DOM node in a web page at the user device.

16. The product of claim 15 , wherein generating the set of code comprises:

creating a new controller instance for the defined transform; and

constructing one or more DOM nodes for the defined transform.

17. The product of claim 16 , wherein generating the set of code further comprises, after creating the one or more DOM nodes, creating bindings for attributes on the one or more DOM nodes.

18. The product of claim 17 , wherein generating the set of code further comprises calling a controller attach method.

19. The product of claim 18 , wherein generating the set of code further comprises calling a controller detach method.

20. The product of claim 15 , wherein the defined transform accepts a view and a Boolean value and returns the view when the Boolean value is true and returns an empty view when the Boolean value is false.

Assignments (2)
CHANGE OF NAME Recorded Oct 20, 2017
From: GOOGLE INC.
To: GOOGLE LLC
Reel/Frame 044567/0001 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 16, 2017
From: BUYUKKOKTEN, FERHAT
To: GOOGLE INC.
Reel/Frame 042734/0158 →
Continuity (2)
Provisional Application 62358364 · Jul 5, 2016
Related Publication 20180011832A1 · Jan 11, 2018