Q&A

Common usage problems

App update settings
App updates through bright.App () method so that the incoming sourceMapping and update attribute control. When no incoming sourceMapping, the BrightJS is not going on Application of local cache processing. At this time if the server caching enabled, BrightJS will only from the cache access to resources make the application could not be updated. If the server opens the cache must be passed in sourceMapping made to realize the application source control to complete the update BrightJS. When after the introduction of sourceMapping and update for the build control prior to version update the full amount, in order to delete useless server build version (the client from the cache access to resources, the server must also ensure its existence). Server if you do not open the cache and did not pass into the sourceMapping, regardless of the value of BrightJS when update will always get new resources.
Template syntax
BrightJS built-in templates supports native javascript syntax, but javascript expression must be ";" End (native syntax to write from time to write), the assignment must be ";" End.
jQuery like
BrightJS built DOM processing API, and as a module BrightJS DOM processing, design of these API reference jquery, jquery but the way to achieve completely different, so when using these API Reference should handle BrightJS DOM API and not by reference jquery API, so as not to cause errors due to difference.
Local cache invalidation
BrightJS using browser local storage APIs for application resources corresponding cache, so it is necessary to ensure that the browser local storage API is available to cache, often browser's privacy mode is turned on or the user's browser settings cause the browser local storage API is not available, then the application will still work properly, but every time to get new resources.
Program release form
BrightJS includes a variety of programs released in the form of CMD AMD standard form as well as various forms of built-in data types, as well as various forms of hybrid forms, as the final release in the form of a specific need to see this program the functions, such as DOM associated with the release of Module form is the best.
Granularity of the modules
packet can accommodate multiple Module, that is to say a packet js file can define multiple Module or other features, but considering the late and build incremental update size problem, we recommend to ensure a minimum of js file size to ensure an incremental update particle size minimized, but can also ensure a clear program structure, of course, no matter what will not affect the normal execution of the program.
About Custom
While BrightJS defines some basic data types and development framework, but BrightJS not force users to use these pre-part, BrightJS itself provides a number of basic support for front-end development tools, including dom processing, resource management, and similar strong type object-oriented design language support, so users can rely on these tools and build an exclusive new development framework to meet the most individual needs.