README.md 3.13 KB
Newer Older
Daniel Roth's avatar
Daniel Roth committed
1
2
# blazor-workshop
Blazor workshop
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19


Sessions

1. Intro
- Who are we?
- Machine setup
- Syllabus
- What is Blazor/WebAssembly?
- Roadmap explanation
1. Components + layout
- Clone repo with ready made backend
- Setup store branding
- Create layout and home page
- Fetch specials list from backend
- Display list of pizza names
- Pizza card component (no templates yet)
Ryan Nowak's avatar
Ryan Nowak committed
20
- Parameters: PizzaSpecial object
21
22
23
24

Lunch

1. Handling UI events & data binding
Ryan Nowak's avatar
Ryan Nowak committed
25
26
27
28
29
30
31
32
33
34
35
36
- Make special pizza cards clickable
- Clicking on a special brings up the new customize dialog
- Index needs to handle the hide/show of the dialog 
- Index needs to pass in the Pizza object as well as two 'command' delegates
- Using `bind` and `onclick` on the customize dialog to update prices in real time
- explain the difference between `bind` and `bind-value-oninput` on the slider
- cancel button should close the dialog
- confirm button should close the dialog and add to order
- now add the markup for sidebar which will display orders
- add a ConfiguredPizzaItem component
- hook up the order button to do an HTTP POST and clear the order
- (no way to see existing orders yet)
Ryan Nowak's avatar
Ryan Nowak committed
37
38
39
40
41
42
43
44
45
46
1. Build the order status screen
- Add a new page MyOrders with `@page orders`
- Add a new NavLink to the layout that links to this URL
- At this point you can appreciate how this page will share layout because that's specified in imports
- MyOrders should retrieve list of orders and show the past orders
- Add a new page OrderDetails to show the status of an individual order
- It should be possible to click from MyOrders->OrderDetails
- The OrderDetails should poll for updates to the order fromthe backend
- Go back to the index and make placing an order navigate you to the MyOrders page
1. DI and the AppState pattern
Ryan Nowak's avatar
Ryan Nowak committed
47
48
49
50
51
52
53
- Notice that we lose track of any pizzas when you switch between MyOrders and Index, we can fix this by storing the state at a higher level
- Create the OrderState class
- Add to DI in Startup (Scoped)
- Move most of our properties / methods in Index and ConfigurePizza to the OrderState
- Add a StateChanged event to OrderState
- Subscribe to StateChanged from Index in OnInit
- Add an implementation of IDisposable to unsubscribe
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
1. JS interop
- Add order status
- Real status (map location, time to delivery) via polling
- JS interop for the map
- Add payment via browser payment API

End Day 1

1. Templated components
  - Refactor the specials page
  - Generic components
1. Authentication & authorization
- See status after leaving site
- Cascading parameters
- Use some form of thing-that-you-do auth
- Maybe talk to updated guidance for SPA token based auth?

Lunch

1. Publish & deployment
- Publish to Azure
1. Razor Components
- See if we can make flipping it to server-side reasonably trivial
1. Component libraries
- Make a Google Maps components so others can use it
- Consider using SignalR library?
1. Component internals
- Lifecycle events
- Render tree
- StateHasChanged
- Configuring the linker (i.e. how to turn it off, pointer to docs)
1. Q&A

Today we will build:

- Pizza store
  - Order status and map
  - Specials page
  - Ordering page
  - No cart, just one pizza per order
  - Use browser payment apis
  - Login