Giter Site home page Giter Site logo

jasy's Introduction

Please note: This project is deprecated at Zynga and is no longer maintained.


Jasy - Web Tooling Framework

Jasy is a powerful Python3-based tooling framework. It makes it easy to manage heavy web projects. Its main goal is to offer an API which could be used by developers to write their custom build/deployment scripts.

Installation

For details have a look at the official documentation.

Documentation

Feedback

QuickStart

Related

  • Core: Core Library for JavaScript projects. Ideal JS counterpart to Jasy.
  • Api Browser: Web-based API Browser to render API data generated by Jasy.
  • Jasy Compat: Showing how to integrate other JavaScript libraries into Jasy workflow
  • Jasy Locale: Demonstrating locale and translation support in Jasy/Core.

Test Skeletons

Authors

Jasy was initially developed by Sebastian Werner and is now continued as an official Zynga OpenSource project.

License

Copyright (c) 2011-2012 Zynga Inc. http://zynga.com/

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

jasy's People

Contributors

dadicool avatar fastner avatar fschimmelpfennig avatar joshgarnett avatar saschagoebel avatar swernerx avatar timmjd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jasy's Issues

Optimization does not remove full unused var declaration

Using Optimization does not remove a full unused var declaration assigned to an Object literal.

Jasy version: 0.4.6

Source Example:

__render: function () {

    var dimensions = {
        width: 100,
        height: 100
    };

    // other code removed that never references local dimensions var.
},

Optimization result:

__render:function(){{width:100,height:100}};

Js error:
Uncaught SyntaxError: Unexpected Token :

jasyscript.py code:

optimization = Optimization("variables", "declarations", "blocks")
formatting = Formatting()

Unused object generates invalid JS code

Unused object which has a function in its properties generate invalid JS code.

The following code

core.Class("p.MyClass", {
    construct: function() {
        var obj = {
            method: function() {
                return "result";
            }
        };
   }
});

is compressed to the following code (beautified to make it readable).

core.Class("p.MyClass", {
    construct: function () {
        {
            method: function () {
                return "result"
            }
        }
    }
});

And this code causes an error saying "Uncaught SyntaxError: Unexpected token (".

I'm using the latest Jasy (f86953e), but it's reproducible on Jasy==0.4.6.

Note that the compressed output code is generated by storeCompressed function with the default optimazation options.

compressedCode = storeCompressed("build/app-%s.js" % permutation.getChecksum(), classes,
        permutation=permutation, bootCode="new p.MyClass();")

Implement alternative distribution for Mac OS: App Bundle/PkgInstaller

Detect custom namespaces/extensions for dependencies

These are figured out by the API system but not yet used for dependency tracking. Currently each class is attached to exactly one exported symbol which is problematic for this kind of deps where one feature like string.trim just adds a few methods to another class.

Hash changes on every reload

The current implementation generates a new hash for every file on every reload: Game.js?r=1346659290651
Perfectly would only generate a new hash for a new build.

Installing Jasy 0.7.2 with pip-3.2 is missing required dependencies

When I install jasy 0.7.2 from pip-3.2, it does not install any required dependencies. It will report errors if the following are not installed:

  • polib
  • Pygments
  • misaka

These should be automatically installed when I install jasy if I do not already have them installed. The build still works without polib but not without misaka and Pygments.

polib error:
"Polib is no installed. Polib is needed to extract translation text from PO files!"

Markdown error:
"Missing Markdown feature to convert comments to HTML."

Add support for linking to dependencies

Which means to shorten often used class names to local variables via the introduction of a new global closure. This could basically work for all final "require" classes which are loaded before each actual class.

urlPrefix of CDN-Url's wrong

If you run asset.exportBuild(urlPrefix="https://example.com") the resulting url of core.io.Asset.toUri("test/test.png") is https:/example.com/test/test.png. Note that there is only one slash after https:. This is due to calling os.path.normpath in core/Project.py inside toRelativeUrl method.

You can work around if you give an urlPrefix of "//example.com".

Add capability to re-scan assets at runtime.

If I have tasks that generate new assets, I cannot use those assets unless I restart jasy since it parses assets during initialization. It would be convenient to add a way of re-scanning the assets at runtime to allow us to collapse tasks into a single task if we want to.

Add flag to disable update of git repositories

When working without permanent internet connection it would be great to have a flag to disable git repository updates. This should also increase run time of jasy on big projects that have many external dependencies.

CamelCase not supported in jasy create

When I use the create command with a CamelCase project name, it fails.

>>> CREATING PROJECT TESTAPP
-------------------------------------------------------------------------------
Invalid project name: TestApp

RegExp literal in array causes "jasy.js.parse.Parser.SyntaxError: Syntax error: Missing operand. Found type: div"

Jasy(both 0.4.6 and 0.5 beta2) seems to treat RegExp literals in an array as syntax error.

The following code,

core.Class("p.helloworld.App", {
    construct: function(settings) {
        var arr = [/pattern/];
    }
});

will output this error.

% ./jasyscript.py build
Jasy 0.5-beta2
Initialized project core
Initialized project p.helloworld
Detecting dependencies...
Traceback (most recent call last):
   File "/Users/csakatoku/.virtualenvs/jasy/bin/jasy", line 110, in <module>
   # skip...
  File "/Users/csakatoku/.virtualenvs/jasy/lib/python3.2/site-packages/jasy/js/parse/Parser.py", line 1311, in MultiplyExpression
    node = UnaryExpression(tokenizer, staticContext)
  File "/Users/csakatoku/.virtualenvs/jasy/lib/python3.2/site-packages/jasy/js/parse/Parser.py", line 1338, in UnaryExpression
    node = MemberExpression(tokenizer, staticContext, True)
  File "/Users/csakatoku/.virtualenvs/jasy/lib/python3.2/site-packages/jasy/js/parse/Parser.py", line 1367, in MemberExpression
    node = PrimaryExpression(tokenizer, staticContext)
  File "/Users/csakatoku/.virtualenvs/jasy/lib/python3.2/site-packages/jasy/js/parse/Parser.py", line 1535, in PrimaryExpression
    raise SyntaxError("Missing operand. Found type: %s" % tokenType, tokenizer)
jasy.js.parse.Parser.SyntaxError: Syntax error: Missing operand. Found type: div
p.helloworld.App:3
Closing session...

FYI, my jascript.py is here.

Support for reusing immutable string instances

String instances are generally expensive - even so they are immutable. It helps to move them in a class-global closure and share them via local variables. This should be implemented in a way that only often used strings etc. are shared that way or only for specifically marked strings.

documentation insufficient for new users

wiki provides a high level overview of jasy functionality, while code documentation is almost non-existent. Most functions/classes lack even one line docstrings.

Could use a lower level of documentation, such as specific examples of why/where we would use certain features. A small example project would be greatly appreciated.

Root directory for the server

Current implementation uses the jasy root project also as root for the server.
Perfect would be something like "DocumentRoot" like it is used in Apache.

Add method to inline CSS when copying html pages to the build folder

Currently, Jasy has no way of dealing with CSS linked from the head of a HTML page. When the index.html is copied to the build folder, the static paths do not resolve anymore.

I'm proposing to add a method that copies the index.html and stores it in optimized form, i.e.:

storeOptimizedPage("source/index.html", "index.html", inlineCSS=True);

This command would copy the index.html page to its destination (like updateFile), but also parse all linked stylesheets in the file and automatically embed them into the HTML page. It's a win win: Jasy learns how to resolve those paths, and the user gets less requests as bonus.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.