PyJS intro
Upcoming SlideShare
Loading in...5
×
 

PyJS intro

on

  • 3,175 views

PyJS is a CommonJS Based Javascript Framework runs on Browser

PyJS is a CommonJS Based Javascript Framework runs on Browser

Statistics

Views

Total Views
3,175
Views on SlideShare
2,951
Embed Views
224

Actions

Likes
3
Downloads
15
Comments
1

4 Embeds 224

http://www.cnblogs.com 216
http://www.haogongju.net 6
http://www.guan8.net 1
http://www.slashdocs.com 1

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

PyJS intro PyJS intro Presentation Transcript

  • PyJs demixcn@gmail.comMonday, September 19, 11
  • A CommonJS Based Javascript Framework runs on Browser https://github.com/demix/pyjsMonday, September 19, 11
  • CommonJSMonday, September 19, 11
  • Math.js increment.js program.js(main)Monday, September 19, 11
  • BenifitsMonday, September 19, 11
  • One code , runs everywhere No need to study and follow an ugly module pattern Automatic namespaceMonday, September 19, 11
  • Browser Server Desktop Command line tools ...Monday, September 19, 11
  • One code , runs everywhere No need to study and follow an ugly module pattern Automatic namespaceMonday, September 19, 11
  • Traditional Module Pattern CommonJS ModuleMonday, September 19, 11
  • One code , runs everywhere No need to study and follow an ugly module pattern Automatic namespaceMonday, September 19, 11
  • Monday, September 19, 11
  • Examples Server side Example: NodeJS Browser side Example: Firefox jetpack projectMonday, September 19, 11
  • ProblemMonday, September 19, 11
  • Run directly after ‘require’. No Callback.Monday, September 19, 11
  • Means in Browser, we can only use “Synchronous” request to get the script file.Monday, September 19, 11
  • What’s the fxxk...Monday, September 19, 11
  • SeaJSMonday, September 19, 11
  • Monday, September 19, 11
  • How it works User pre-defined template wrapper. Prefetch Js file which has been required.Monday, September 19, 11
  • Problems Still ugly template. Still can’t download all files in parallelMonday, September 19, 11
  • PyJSMonday, September 19, 11
  • GrammarMonday, September 19, 11
  • 99% same as CommonJS API No ugly user pre-defined template wrapperMonday, September 19, 11
  • what about the file loading problem? You haven’t mentioned it ..Monday, September 19, 11
  • There is two loading rules in PyJS. One in local debugging, the other in online building. All need Python environment.Monday, September 19, 11
  • Local debugging python pyjs.py runserver Fetch the JS file in synchronous XHR request. Server will parse the module file automaticlyMonday, September 19, 11
  • Server parseMonday, September 19, 11
  • Online building python pyjs.py Automaticly generate a ‘boot.js’ file, find all the dependences in modules and add the information to the end of boot.js file.Monday, September 19, 11
  • Then , if we had a combo service like:Monday, September 19, 11
  • We can download the file just in one request!Monday, September 19, 11
  • Finally , because of the require function used on page has a callback, it can runs after all the files is received and finish excuting.Monday, September 19, 11
  • That’s all.Monday, September 19, 11
  • More..Monday, September 19, 11
  • Because we use python... Local transmission Local plugins Deal with CSS files. ...Monday, September 19, 11
  • demix Front-end engineer @ Baidu co. email: demixcn@gmail.com weibo/twitter: @demix Homepage: http://demix.github.com/ blog: http://www.cnblogs.com/demixMonday, September 19, 11
  • Thank You.Monday, September 19, 11