CKCodeGenPipeline Flashcards

1
Q

What’s in Specs.h?

A

Contains props/state used by the component spec. Imported by the corresponding Specs.mm file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What’s in Specs.mm?

A

Imports SpecInternals.h, Specs.h
Defines a function annotated by CK_RENDER
Can contain CK_STATE_UPDATE annotated functions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do we perform state updates in CKCG?

A

Declare a function returning void, taking a single State & parameter, arbitrarily named, but annotated by CK_STATE_UPDATE.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What happens to functions annotated by CK_STATE_UPDATE

A

void (State &state) gets transformed into void invoke.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the signature of the updateState function

A

?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the point of the updateState function

A

?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

When are components redrawn?

A

On receiving a message, a new component tree is conceptually created; the diff with the old generation is taken, and only components that have changed are recreated. A functional concept – take props as input, and produce components as output.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do we run CKCG?

A

(1) Buck takes flags which make it find all paths ending in Spec.mm – it treats these specially as component specs.
(2) Clang is then invoked on the specs, with three (?) command line flags (compilation DB, header namespace, out path)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does clang initially do with the three command line args?

A
Extract flags (+mutuate them for some complex reason)
Send to parsing module (mainly clang implemented) produces cAST as output
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does the parsing module do?

A

Invoke libclang to produce a translation unit
Produce an AST from the translation unit
Send to Validation module

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does the Validation module do?

A

Find the CK_RENDER function.
Generate a Validation::Spec
Create a Generation::Spec (invoke generation module)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does the Generation module do?

A

Check if the component isStateless

Generate Component.h, Component.mm, SpecInternal.h

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Why is isStateless in the generation module poor nomenclature?

A

?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What’s in SpecInternal.h for a particular spec?

A

?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly