zynga / jasy Goto Github PK
View Code? Open in Web Editor NEW[DEPRECATED] A powerful Python3 based Web Tooling Framework.
License: MIT License
[DEPRECATED] A powerful Python3 based Web Tooling Framework.
License: MIT License
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:
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."
Error messages during parsing could be useful.
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.
Like in Glue:
https://github.com/jorgebastida/glue/
Like these esprima based tools:
https://github.com/coveraje/coveraje
https://github.com/itay/node-cover
This especially needs a solution of where to place the processed assets aka like the "script" folder for JavaScript classes.
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.
Maybe splitting into:
/**
You get the idea.
Especially useful for API data right now.
https://github.com/WebReflection/JSONH
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.
This might be a good candidate:
http://packages.python.org/tinycss/index.html
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.
Depends on tokenizer and parser. Maybe the tree does not yet contain all necessary information.
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()
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.
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.
Might be based on Python JS Beautify:
https://github.com/einars/js-beautify
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.
For some reason, the --version argument requires a different format than the --name and --origin arguments, making it confusing for users:
Doesn't work: --version refs/tags/0.0.4
Works: --version=refs/tags/0.0.4
Compare to --origin path/to/my/repo
Field 'theme' uses unknown detection class core.detect.Param while including apibrowser.
Using JSHint or custom implementation.
The new "requires" section as well as auto cloning etc. should be documented.
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".
Might require more CSS work in general.
https://github.com/GoalSmashers/clean-css
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.
This library feels like a good candidate:
http://liquibits.bitbucket.org
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();")
And maybe other inspiration from Glue:
https://github.com/jorgebastida/glue/
Described in detail here:
http://chriseppstein.github.com/blog/2012/08/23/sass-3-2-is-released/
e.g. via FSEvents on OS X:
http://pypi.python.org/pypi/MacFSEvents
Could be helpful for non-homebrew / non-XCode users. Could ship binary components like Misaka easily.
Class uses deep copy to copy a full tree fo a class before compressing it. Maybe we find a better/faster way copying nodes.
See also:
http://writeonly.wordpress.com/2009/05/07/deepcopy-is-a-pig-for-simple-data/
The widely used alternative to PO/Gettext. There is a Python implementation available:
http://pyicu.osafoundation.org
http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/
SourceMaps are remappings of generated code to source code.
The size of images exported from Photoshop 6.0 with "save as" will be identified with an incorrect size.
Save for Web and Devices works.
Correct size: 760x538
Jasy identifies: 160x113
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.
Based on a configuration of indents, etc. to use.
Took me about 20 minutes of googling to install pip-3.2 explicitly.
http://stackoverflow.com/questions/11268501/how-to-use-pip-with-python-3-x-besides-python-2-x
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.
Might be useful to have the possibility to force include classes into the kernel script.
Especially the CSS minifier port to Python might be useful.
https://github.com/trentrichardson/Clientside
Interesting offer:
http://www.kraken.io/developers
Like #require(some.namespace.*)
When I use the create command with a CamelCase project name, it fails.
>>> CREATING PROJECT TESTAPP
-------------------------------------------------------------------------------
Invalid project name: TestApp
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.