Kyle summarizes the changes he made to the application and gives the audience some principles to take away from this example.
(mystic music)…- Some principles to take away here.…In any place where I found code that I wanted…to share it between the two places,…the best way to do that was to organize it into a module.…And I chose the UMD style…just because it doesn't require any other moving pieces.…It's just a file that can load in both places.…But you could easily author them…in whatever module format you like,…and use something like Browserify.…And I loaded my modules into my server,…using require, like we see, right here.…
I'm using the require to load it up.…Now, I didn't really talk about this,…I kind of glossed over it,…but you notice that I was just automatically…putting these shared modules in a location…where I knew I'd be able to load them in the browser,…and then I just went and got them…from the same location on the server.…That may or may not be the appropriate approach…for a real production app.…In fact, more likely, you're probably going to have some sort…of build process that's taking your files that you want…to share, and it's packaging them up…
Note: This course was created on 03/29/2016 by Frontend Masters. We are pleased to host this content in our library.
- Carousels, panes, and modules
- Middle-end architecture
- Secure phrase generator
- Routing functions
- Calling the API
- Rendering on the page
- Shared data validation
Skill Level Intermediate
2. Organizing Code
5. Adding a Shared Module
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.