livelykernel / livelykernel Goto Github PK
View Code? Open in Web Editor NEWThe Lively Web runtime and development environment
Home Page: http://lively-web.org/
License: MIT License
The Lively Web runtime and development environment
Home Page: http://lively-web.org/
License: MIT License
From Dan:
When opening a VersionDiffer in the SCB module list via context menu then not the right module url is used.
Copied (i.e. serialized) text morphs with syntax highlighting will keep highlighting the text on each keystroke instead of debouncing the algorithm.
The default implementation for syntax highlighting expects one parameter which is the wait time. If you call the method highlightSyntaxDebounced
explicitly, it works as expected. However, if the method is called by the textString
connection, then the first parameter is the updated property, in this case the string. This causes the string to be treated as wait time, so instead of waiting and debouncing, the highlighting takes place immediately with each update.
The following code produces a text morph with continous (i.e. not debounced) syntax highlighting:
var txt = new lively.morphic.Text(rect(0,0,99,99), "var");
txt.enableSyntaxHighlighting();
txt.copy().openInWorld();
Various tests with simulated mouse events are red when running lively.morphic.Tests in CLI test runner
Tests run: 243 -- Tests failed: 12 -- Failed tests:
lively.morphic.Tests.EventTests.test01DragMorph
-->Expecting a function in instanceof check, but got #
lively.morphic.Tests.EventTests.test02RelayMouseEventsToMorphBeneath
-->Expecting a function in instanceof check, but got <lively.morphic.Box#8A7C6...>
lively.morphic.Tests.MenuTests.testWrongSubMenuItems
-->Expecting a function in instanceof check, but got #
lively.morphic.Tests.ExternalShapesTests.test01AddADivShape
-->undefined is not a function
lively.morphic.Tests.LayoutTests.test01DropJournalLayoutOnMorph
-->undefined is not a function
lively.morphic.Tests.LayoutTests.test02ApplyHBoxLayout
-->undefined is not a function
lively.morphic.Tests.LayoutTests.test03GridLayoutDefaultSizes
-->undefined is not a function
...
This is always the case when a morph or an HTML node is passed to doMouseEvent in the parameter's 'target' property. It seems to expect a function instead.
From Dan:
Interface of array feels quite big, with a couple of very similar functions. We even have some aliases...
If you count the function definitions in lively.lang.Array you'll get ridiculously close to 50...
Also, the Enumerable object is created in lively.lang.Array and immediately mixed into the Array.prototype. I think that it's not used elsewhere - so we might skip this step as well in an effort to get a smaller Array interface...
Halo items are only opened for the topmost morph.
As reported by @JensLincke
Hi, all
anyone an idea? Is this maybe related with some CSS magic?
Best,
Jens
the diff and the mirror script need to be updated
.. on Windows and Unix machines, browser independent. It works fine in a Chrome on Mac.
From Dan:
In the style editor, if the object in view has not been named, the top pane shows ‘undefined’. This is not friendly to the non-expert user: what is undefined; should she try to fix it, etc?? Better would be to present the assigned name, as is done in the halo.
localconfig.js should allow Lively installations to set flags and customize the lively environment. Should not be part of Core, but linking Lively installations against the Core should also not overwrite/remove the installation's localconfig.
One repo for the scripts and server stuff.
Another containing just the Lively Kernel core code
Certain tests use parts. Parts are not part of core and should be tested seperately. In these tests, create objects programmatically.
first candidate is lively.morphic.tests.OriginTests
Clicking on any of the menu items on the left in the partsbin browser results in lots of scary error messages.
http://lively-kernel.org/repository/webwerkstatt/documentation/7funthings.xhtml
Chrome 14 on Ubuntu.
Error when trying to update AttributeConnection(<lively.morphic.Box#40777... - PartsBinBrowser>.categoryName --> <lively.morphic.Box#40777... - PartsBinBrowser>.loadPartsOfCategory) with value DatabaseDemo:
TypeError: Cannot read property 'DatabaseDemo' of undefined
TypeError: Cannot read property 'DatabaseDemo' of undefined
at Box.getURLForCategoryNamed (eval at (http://lively-kernel.org/repository/webwerkstatt/core/generated/combinedModules.js?0cc8991db02bce41243cf3bd1ab9f20b:14104:29))
at Box.getPartsSpaceForCategory (eval at (http://lively-kernel.org/repository/webwerkstatt/core/generated/combinedModules.js?0cc8991db02bce41243cf3bd1ab9f20b:14104:29))
at Box.addPartsOfCategory (eval at (http://lively-kernel.org/repository/webwerkstatt/core/generated/combinedModules.js?0cc8991db02bce41243cf3bd1ab9f20b:14104:29))
at Box.loadPartsOfCategory (eval at (http://lively-kernel.org/repository/webwerkstatt/core/generated/combinedModules.js?0cc8991db02bce41243cf3bd1ab9f20b:14104:29))
at http://lively-kernel.org/repository/webwerkstatt/core/generated/combinedModules.js?0cc8991db02bce41243cf3bd1ab9f20b:14352:19
at AttributeConnection.update (http://lively-kernel.org/repository/webwerkstatt/core/generated/combinedModules.js?0cc8991db02bce41243cf3bd1ab9f20b:14362:5)
at Box.categoryName (http://lively-kernel.org/repository/webwerkstatt/core/generated/combinedModules.js?0cc8991db02bce41243cf3bd1ab9f20b:14420:8)
at http://lively-kernel.org/repository/webwerkstatt/core/generated/combinedModules.js?0cc8991db02bce41243cf3bd1ab9f20b:14353:23
at AttributeConnection.update (http://lively-kernel.org/repository/webwerkstatt/core/generated/combinedModules.js?0cc8991db02bce41243cf3bd1ab9f20b:14362:5)
at List.selection (http://lively-kernel.org/repository/webwerkstatt/core/generated/combinedModules.js?0cc8991db02bce41243cf3bd1ab9f20b:14420:8)
P.S. The create issue page at http://lively-kernel.org/repository/webwerkstatt/issues/CreateIssuePage.xhtml asks me for a username and password, which I don't have nor particularly want, so I hope it's ok I report this problem here.
From Dan:
The Point, Rectangle, and Color classes are pretty basic in Lively, but I don't like to have lots of stuff in Base.js (still close to 2k LOC - these three class defs are 800 LOCs).
These classes don't belong into lively/lang/ because they don't extend JavaScript's standard library, but core classes that further can be in LK modules. How about a new subsystem that either holds general core or just graphics classes? Name? How about lively/graphic? Or has someone a better idea?
Also, these classes shouldn't be in the Global namespace. So, if it's possible to "relocate" them, it'd say:
lively.graphics.Point, lively.graphics.Rectangle, and lively.graphics.Color
Maybe it's reasonable to "link" Global.Point against lively.graphics.Point etc. - so that we don't break lots of Parts?!
From Dan:
There is still no way to get a world menu on a mac without a mouse, without knowing to try a double-tap. Actually all the mechanism is there, because a cmd-click does, in a consistent manner, bring up the halo [and in fact this is how it should work, and did work originally]. The problem is that, for this case, it seems that all the halo items appear piled up on one another so the only thing you can do is invoke the style editor.
So the use case is that we have a awesome framework with lots of cool features like a class system, data bindings, stuff and we want to make those things reusable without having to pull in the whole Lively package (even if it's just the core, the core is at least currently too big). Also our module system more or less is a problem for that since it would be required if you want to reuse, say, the class system. Plus, you would have to use XHR it's load mechanism which might not be usable in all environments (say, node). Of course we could adapt our modules to different environments (node.js require e.g.) but this is probably another project.
So, what JS people usually do is to provide compiled scripts that could just be included (remotely like including jquery from google or via script download & add it locally to your page).
Idea: Let's have a component interface based on our combinedModules. A request to http://lively-kernel.org/modules/lk-classes.js could for example package the necessary code that is needed just for the class system (we get the requirements via our module definitions) together and make it embedable via `<script src="http://lively-kernel.org/modules/lk-classes.js" /> and downloadable.
We could also automatically remove all module(...)
expressions to just deliver the plain code. So there is no need for "simulating" modules like we do it for the combinedModules load process in pur bootstrap (we need that there because there could be modules that are required in the code but are not part of the combinedModules).
@fbornhofen @lauritzthamsen @JensLincke please comment. Thx :-)
So I have been thinking quite a lot about how to get our little experiment well integrated into the Lively workflow.
For now just so much that I'm very excited about the github API, e.g. issues and repos.
How about creating a little entry in the world menu that says "report a bug" that will then automatically create a github issue? Maybe also when a red error message pops up. We can have this links/button in alerts that could automatically be used for the description...!
With trac this is a real pain but this seems to be much nicer... anyone volunteering?
We add non-instance methods to the Object itself through Object.extend(), which does not incorporate method categories. Further, it's not clearly shown as part of the class definition in source files and the SCB.
Would be in favor of having distinguished class-side methods similar to our instance-side methods through _ addClassMethods()_ and in subclass() definitions. With method categories.
I'm done for today with the diffing branch. Basically I put the logic in place to call svn update
and git pull
and to call the diff script afterwards.
Yet todo:
I can continue tomorrow, or if you wanna continue, continue ;-)
We are investigating an issue that causes travis-ci.org to build your mirror branch even though you have whitelisted only master. In the meantime, would it be possible to add
[ci skip]
anywhere in the mirror commit message? The mirror branch is going crazy over the last day or so with Node.js queue constantly being 150 builds long or so, almost all of which are LivelyKernel mirror pushes.
lk server
Check branch text_serialization_fix for test case.
A Text's textString only seems to be persisted when the Text is part of the scenegraph.
This breaks LosProfesores in Webwerkstatt.
Will try caching of text chunks.
Chrome:
aText.setSelectionRange(5,2);
aText.getSelectionRange(); --> [5,2];
Firefox:
aText.setSelectionRange(5,2);
aText.getSelectionRange(); --> [2,5];
Swap values if this is Firefox and Text was selected from right to left? Edge cases? People using DOM API?
some not very important aesthetics:
### show both directory pathes
###
### review and tests:
### webwerkstatt: st, diff
### webwerkstatt: run tests (test.xthml on localhost??)
###
### if okay:
### lively kernel: push && push tags
### webwerkstatt: svn ci
### if not okay:
### lively kernel: tag -d && reset --hard
bootstrap.js is quite big and feels complicated. There's also some duplication for different kind of worlds (standard, newWorld, headless). Should be refactored at some point.
On the side and just wondering: I'm not sure if the additional complexity of being able to run on canvas and stuff is worth it - because it's not only renderContext that makes stuff more complicated, but also clutters our bootstrap a bit.
When saving folder/file.ext, Lively (SCB, Pages, PartsBin?) PUTs folder/file.ext even if folder/ does not exist yet.
Instead, it should should send a MKCOL request:
MKCOL /LivelyKernel/SomeFolder/ HTTP/1.1
Host: localhost
Content-Type: text/xml
Content-Length: 0
Creating doit
links in text can either be done by pressing Ctrl+O or programmatically by setting a TextEmphasis
.
var txt = new lively.morphic.Text(rect(0,0,99,99), "foo");
txt.emphasize({doit: 'alert(1)'}, 2, 3);
txt.openInWorld();
The created link is green and underlined but, unfortunately, the alert code is not executed when clicking on the link.
When there are syntax errors in modules, CLI test runner fails with a timeout. It should be able to report syntax errors.
See https://github.com/rksm/LivelyKernel/commits/merge-with-ww
Remaining changes:
cschuster's lively.ast extensions (debugging + parser/interpreter improvements + syntax highlighting)
npm has curl http://npmjs.org/install.sh | sh
. We need the same!
Needs some filtering. So far:
Features:
Minor features:
Fixes:
Optimizations
Parts can now be loaded from a PartsBin folder in the root dir. This works for loadPartItem etc., but PartsBin Browser needs further decoupling.
Right now, I'm trying to make it work (not successfully, yet) this way:
Chrome 17 introduced a different SVG path clipping behavior. When control points are moved out of the path's bounds (shapeNode), the shapeNode does not grow and the part outside of it is clipped.
lk server
The default test run for this repository does not run all available test modules as several are red (partly because they rely on the Lively Wiki infrastructure / the Webwerkstatt deployment) or don't return at all. We should remove Wiki-dependent / Webwerkstatt tests from this repository and the default test run should incorporate all test modules.
Test runs fail / red
cop.tests.LayerInliningTests
cop.tests.TracingTests
lively.tests.ScriptingTests
lively.tests.BootstrapTests
lively.tests.CoreTest
lively.tests.NetworkTest
Tests don't run through / test timeout
lively.tests.LKWikiTests
Chrome:
aText.setSelectionRange(5,2);
aText.getSelectionRange(); --> [5,2];
Firefox:
aText.setSelectionRange(5,2);
aText.getSelectionRange(); --> [2,5];
Swap values if this is Firefox and Text was selected from right to left? Edge cases? People using DOM API?
After switching from XHTML to HTML5, the method appendRichText
inserts additional line breaks which disappear when the TextMorph is copied.
var txt = new lively.morphic.Text(rect(0,0,99,99), "");
txt.appendRichText("foo", {color:Color.green});
txt.appendRichText("bar", {color:Color.red});
txt.openInWorld();
We want Lively's Core to be stable and, therefore, run our tests continuously. Code coverage information would help to identify not well tested modules and, therefore, would help to get more of the Core into a test harness.
I think I will create two, three short screencasts.
lively.AST.Tests.JSToAstTest.test04GetParentFunction
-->funcAst.body.children[0].trueExpr is undefined
lively.AST.Tests.JSToAstTest.test05aEnumerateASTNodes
-->funcAst.body.children[0].condExpr is undefined
lively.AST.Tests.JSToAstTest.test05bEnumerateASTNodesButNotNestedFunctions
-->funcAst.body.children[1] is undefined
This is defect both in our repo and in webwerkstatt
Base.js currently implements our namespace- and module-system as well as our class-system, defines the Global namespace and contains stack print functions.
Our class- and our module-system seem to be reusable subsystems and should be in there own JavaScript files. The stack tracing logic should be moved as well.
Use the Markdown morph to interface github issues in Lively. Load title, label, and issue description from github, while Lively worlds provide an environment for the reproduction of defects or general examples.
OMeta (Lively) overrides the array printing to get something like this.
a = [1,2,3] // -> [1, 2, 3]
but the default behavior is:
a = [1,2,3] // -> 1, 2, 3
An this behavior is required during the creation of path objects in D3.
To test / debug / solve it for me now, I used a layer:
cop.create("NoPrettyArrayPrintingLayer").refineObject(Global, {
printOn: function(objOrArray, ws) {
if (Object.isArray(objOrArray)) {
for (var idx = 0; idx < objOrArray.length; idx++) {
if (idx > 0)
ws.nextPutAll(", ")
printOn(objOrArray[idx], ws);
}
} else {
return cop.proceed(objOrArray, ws)
}
}
})
and disabled this special behavior during the creation of the path.
// .. in the draw method
cop.withLayers([NoPrettyArrayPrintingLayer], function() {
var link = svg.selectAll(".link")
.data(links)
.enter()
.append("path")
.attr("class", "link")
.attr("d", diagonal);
})
But this is not nice, and it was hard to discover... Example:
path = this.renderContext().shapeNode.childNodes[6].childNodes[0].childNodes[0]
path.getAttribute("d") // M[0, 0]q[1.1021457184401395e-14, 180] [127.27922061357856,
this did not paint anything, but this did:
path.setAttribute("d", "M 0 0 q 1.1021457184401395e-14 180 127.27922061357856 -127.27922061357854 254.55844122715712 -254.5584412271571")
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.