售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Meteor: Full-Stack Web Application Development
Table of Contents
Meteor: Full-Stack Web Application Development
Meteor: Full-Stack Web Application Development
Credits
Preface
What this learning path covers
What you need for this learning path
Who this learning path is for
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
I. Module 1
1. Getting Started with Meteor
The full-stack framework of Meteor
Meteor's requirements
Using Chrome's developer tools
Using Git and GitHub
Installing Meteor
Installing Git
Creating our first app
Creating a good folder structure
Preadd style files
Adding basic packages
Adding a core package
Adding a third-party package
Variable scopes
Meteor's folder conventions and loading order
Loading assets on the server
Meteor's command-line tool
Updating Meteor
Deploying Meteor
Summary
2. Building HTML Templates
Writing templates in Meteor
Building the basic templates
Adding templates and partials
Displaying data with template helpers
Setting the data context for a template
Using the {{#with}} block helper
"this" in template helpers and template callbacks
Adding events
Block helpers
Listing posts
Spacebars syntax
Accessing parent data contexts
Passing data to helpers
Summary
3. Storing Data and Handling Collections
Meteor and databases
Setting up a collection
Adding post examples
Querying a collection
Updating a collection
Database everywhere
Differences between client and server collections
Summary
4. Controlling the Data Flow
Syncing data – the current Web versus the new Web
Removing the autopublish package
Publishing data
Publishing only parts of data
Publishing specific fields
Lazy loading posts
Switching subscriptions
Some notes on data publishing
Summary
5. Making Our App Versatile with Routing
Adding the iron:router package
Setting up the router
Switching to a layout template
Adding another route
Moving the posts subscription to the Home route
Setting up the post route
Creating a single-post publication
Adding the post route
Linking the posts
Changing the website's title
Summary
6. Keeping States with Sessions
Meteor's session object
A better way for simple reactivity
Using sessions in template helpers
Session and hot code pushes
Rerunning functions reactively
Stopping reactive functions
Using autorun in a template
The reactive session object
Summary
7. Users and Permissions
Meteor's accounts packages
Adding the accounts packages
Adding admin functionality to our templates
Adding a link for new posts
Adding the link to edit posts
Adding the login form
Creating the template to edit posts
Creating the admin user
Adding permissions
A note on security
Creating routes for the admin
Preventing visitors from seeing the admin routes
Summary
8. Security with the Allow and Deny Rules
Adding a function to generate slugs
Creating a new post
Saving a post
Editing posts
Updating the current post
Restricting database updates
Removing the insecure package
Adding our first allow rules
Adding a deny rule
Adding posts using a method call
Method stubs and latency compensation
Changing the button
Adding the method
Calling the method
Summary
9. Advanced Reactivity
Reactive programming
The invalidating cycle
Building a simple reactive object
Rerunning functions
Creating an advanced timer object
Reactive computations
Stopping reactive functions
Preventing run at start
Advanced reactive objects
Summary
10. Deploying Our App
Deploying on meteor.com
Deploying on meteor.com using a domain name
Backup and restore databases hosted on meteor.com
Deploying on other servers
Bundling our app
Deploying using Demeteorizer
Deploying using Meteor Up
Setting up the server
Deploying with mup
Outlook
Summary
11. Building Our Own Package
The structure of a package
Creating our own package
Adding the package metadata
Adding the package
Releasing our package to the public
Publishing our package online
Updating our package
Summary
12. Testing in Meteor
Types of tests
Testing packages
Adding package tests
Running the package tests
Testing our meteor app
Testing using Jasmine
Adding unit tests to the server
Adding integration tests to the client
Adding a test for the visitors
Adding a test for the admin
Acceptance tests
Nightwatch
Laika
Summary
A. Appendix
List of Meteor's command-line tool commands
The iron:router hooks
II. Module 2
1. Optimizing Your Workflow
Introduction
Installing Meteor
Getting ready
How to do it...
How it works...
There's more...
Finding documentation for Meteor
How to do it…
How it works…
There's more…
Getting help with questions
How to do it…
How it works…
Stack Overflow
Meteor forums
The #meteor on IRC
There's more…
Setting up your project file structure
Getting ready
How to do it…
How it works…
client/server
main/lib
public/private
both
There's more…
See also
Setting up your development environment
Getting ready?
How to do it…
How it works…
There's more…
See also
Using the web console
Getting ready
Safari
Firefox
Chrome
How to do it…
How it works…
There's more…
Deploying a test app to Meteor
Getting ready
How to do it…
How it works…
There's more…
See also
Deploying to Meteor using a CNAME redirect
Getting ready
How to do it…
How it works…
See also
Deploying to a custom hosted environment
Getting ready
How to do it…
How it works…
There's more…
See also
Deploying with Meteor Up (MUP)
Getting ready
How to do it…
How it works…
See also
Using CoffeeScript
Getting ready
How to do it…
How it works…
See also
Using CSS compilers
Getting ready
How to do it…
Using Stylus
Using Less
Using SCSS / SASS
How it works…
See also
2. Customizing with Packages
Introduction
Adding Meteor packages
Getting ready
How to do it...
How it works...
There's more…
See also
Removing Meteor packages
Getting ready
How to do it…
How it works…
There's more…
Discovering new packages with Atmosphere
Getting ready
How to do it…
How it works…
There's more…
See also
Creating a multipage application with Iron Router
Getting ready
How to do it…
How it works…
There's more…
See also
Building a custom package
Getting ready
How to do it…
How it works…
There's more…
See also
Using npm modules
Getting ready
How to do it…
How it works…
There's more…
See also
Publishing custom packages to Atmosphere
Getting ready
How to do it…
How it works…
There's more…
See also
3. Building Great User Interfaces
Introduction
Inserting templates with Spacebars
Getting ready
How to do it...
How it works...
There's more…
Inserting raw HTML using triple braces
Getting ready
How to do it…
How it works…
See also
Creating dynamic lists
Getting ready
How to do it…
How it works…
There's more…
See also
Building a smooth interface with Bootstrap
Getting ready
How to do it…
How it works…
There's more…
See also
Creating customized global helpers
Getting ready
How to do it…
How it works…
There's more…
See also
Creating custom components
Getting ready
How to do it…
How it works…
There's more…
See also
Using reactivity with HTML attributes
Getting ready
How to do it…
How it works…
See also
Using dynamic templates
Getting ready
How to do it...
How it works…
There's more…
See also
Animating DOM elements
Getting ready
How to do it...
How it works…
There's more…
See also
4. Creating Models
Introduction
Implementing a simple collection
Getting ready
How to do it...
How it works...
See also
Using the Session object
Getting ready
How to do it…
How it works…
There's more…
See also
Sorting with MongoDB queries
Getting ready
How to do it…
How it works…
There's more…
See also
Filtering with MongoDB queries
Getting ready
How to do it…
How it works…
There's more…
See also
Creating upsert MongoDB queries
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing a partial collection
Getting ready
How to do it…
How it works…
There's more…
See also
5. Implementing DDP
Introduction
Reading the DDP stream
Getting ready
How to do it...
How it works...
There's more…
See also
Using client-only collections
Getting ready
How to do it…
How it works…
See also
Implementing multiserver DDP
Getting ready
How to do it…
How it works…
There's more…
See also
Integrating DDP with other technologies
Getting ready
How to do it…
How it works…
There's more…
See also
6. Mastering Reactivity
Introduction
Creating and consuming a reactive value
Getting ready
How to do it...
How it works...
There's more…
See also
Using Ajax query results in ReactiveVar
Getting ready
How to do it…
How it works…
See also
Making a custom library reactive
Getting ready
How to do it…
How it works…
See also
Updating Blaze templates without Mongo
Getting ready
How to do it…
How it works…
See also
Using inline data to modify UI elements reactively
Getting ready
How to do it...
How it works...
There's more…
See also
Integrating a jQuery UI
Getting ready
How to do it...
How it works...
There's more…
See also
7. Using Client Methods
Introduction
Creating dynamic graphs with SVG and Ajax
Getting ready
How to do it...
How it works...
See also
Using the HTML FileReader to upload images
Getting ready
How to do it…
How it works…
There's more…
See also
Creating a coloring book with the Canvas element
Getting ready
How to do it…
How it works…
There's more…
See also
8. Integrating Third-party Libraries
Introduction
Using npm packages directly
Getting ready
How to do it...
How it works...
There's more...
See also
Building graphs with D3.js
Getting ready
How to do it…
How it works…
There's more…
See also
Creating cutting-edge UIs with Polymer
Getting ready
Creating your app and folders
Creating your files
Configuring Bower and installing Polymer
Adding helper Meteor packages
Configuring Meteor
How to do it…
How it works…
There's more…
See also
9. Securing Your Application
Introduction
Basic safety – turning off autopublish
Getting ready
Project setup
Creating a basic template
Adding CSS styling
How to do it...
How it works...
See also
Basic safety – removing insecure
Getting ready
How to do it...
How it works...
See also
Securing data transactions with allow and deny
Getting ready
How to do it...
How it works...
There's more…
See also
Hiding data with façades
Getting ready
How to do it...
How it works...
See also
Protecting the client with browser-policy
Getting ready
Scaffolding setup
Add CDN-hosted bootstrap
Add inline and eval() scripts
How to do it...
How it works...
See also
10. Working with Accounts
Introduction
Implementing OAuth accounts packages
Getting ready
How to do it...
How it works...
There's more…
See also
Customizing the accounts login
Getting ready
How to do it...
How it works...
There's more…
See also
Performing two-factor authentication
Getting ready
Creating our baseline application
Signing up for the Twilio SMS service
Creating an SMS service on Twilio
Installing the twilio-node npm package
Creating and testing the sendTwilio() method
How to do it...
How it works...
There's more…
See also
11. Leveraging Advanced Features
Introduction
Building custom server methods
Getting ready
Project setup
Creating a simple app
How to do it...
How it works...
There's more…
See also
Creating custom EJSON objects
Getting ready
Declaring the Swatch object
Modifying Swatches.insert()
Changing Swatch colors
How to do it…
How it works…
There's more…
See also
Handling asynchronous events
Getting ready
Creating a baseline Meteor app
Obtaining your Twitter Access Tokens
Initializing twit
Creating the Tweets collection, and building a stream reader
Tracking and testing changes
How to do it…
How it works…
There's more…
See also
Using asynchronous functions
Getting ready
How to do it…
How it works…
There's more…
See also
12. Creating Useful Projects
Introduction
Creating RESTful web services
Getting ready
Creating the baseline application
Installing and configuring Postman
How to do it...
How it works...
There's more…
See also
Creating a complete app with Iron Router
Getting ready
How to do it…
How it works…
There's more…
See also
Deploying apps to mobile devices
Getting ready
How to do it…
How it works…
There's more…
See also
Adding social sharing
Getting ready
How to do it…
How it works…
There's more…
See also
III. Module 3
1. Getting Started with Meteor
CoffeeScript for Meteor
Objects and arrays
Logical statements and operators
Functions
Binding
Jade for Meteor
HTML tags
Templates and components
Helpers
Stylus for Meteor
CSS tags
Variables
Functions/mixins
Templates, helpers, and events
Templates
Creating helpers
Events
The event loop and the merge box
The event loop
The merge box
The beginning of our online shop
The must-have packages
File structure
Summary
2. Publish and Subscribe Patterns
Template-level subscriptions
Setting up products for the online shop
Building the publisher
Subscribing to the publisher
Database relationships
One to one
One to many
Many to many
Publishing with relations
Publishing products with images (one to one)
Publishing orders with details (one to many)
Publishing a tag with products (many to many)
Key, foreign key, options, and filter
Aggregation publishers
The aggregation framework
Publishing the results
External API publishers
The HTTP package
Summary
3. Front-end Patterns
Responsive design
General settings
Bootstrap
Jeet grid systems with Rupture
Super helpers
Defining a Blaze helper
Making a global dictionary
Variable types
Session variables
Persistent variables
File scope variables
The ReactiveVar variables
Forms
Meteor Methods
Autoform
Loading data
Designing the loading indicator
Implementing the loading indicator
Animations and transitions
Animating with CSS
Executing animations in Meteor
SEO
Prerender.io
Using Meta
Schema.org
Summary
4. Application Patterns
Filtering and paging collections
Router gotchas
Stateful pagination
Filtering
Security
Roles
Collection2
Deny rules
Custom deny rules
The Meteor methods – round 2
Managing the wait time
Browser policy
Framing
Content
External APIs
Synchronization
Webhooks
Summary
5. Testing Patterns
Behavior tests
Unit tests
Summary
6. Deployment
Setting up Modulus
Setting up Compose
Setting up Kadira
Setting up an SSL certificate
Summary
B. Bibliography
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜