Git Product home page Git Product logo

livelykernel's Introduction

Lively Web Build Status

Lively Web is browser-based runtime and development environment that makes creation of (Web) applications much more immediate and direct. All development happens "live", i.e. you change your application and the system while it is running. This is not only more fun than tedious compile/test/reload workflows but also much faster.

Installation

To use Lively you do not have to install anything. The Lively Web environment is an online wiki and development platform that can be used by everyone who wants to experiment and develop with Lively.

If you want to run your own Lively Web server or contribute to the core development follow the steps below.

Windows

  1. Download the windows-2015-04-03 release zip.
  2. Unzip it.
  3. Double click / start start-lively-server.cmd.

Lively should now be running at localhost:9001.

Mac OS and Linux

  1. Make sure you have node.js installed.
  2. Checkout this repository: $ git clone https://github.com/LivelyKernel/LivelyKernel.
  3. Start the server: $ cd LivelyKernel; npm start

Lively should now be running at localhost:9001.

Docker

Alternatively to the install instructions above you can run Lively via docker. See LivelyKernel/lively-docker for setup instructions.

Running the tests

Start the server then run $ npm test.

Contributing

All code is published under the MIT license.

livelykernel's People

Contributors

alexialou avatar aranlunzer avatar athomschke avatar bastiansteinert avatar bgnk avatar calmez avatar codefrau avatar daniel-wer avatar daningalls avatar fbornhofen avatar fmateoc avatar jenslincke avatar johnnyt avatar lauritzthamsen avatar levjj avatar lwassermann avatar m-hemmings avatar merryman avatar mroeder avatar naicovs avatar philippotto avatar rickmcgeer avatar rksm avatar rpanjwani avatar tedkaehler avatar timfel avatar yoshikiohshima 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

livelykernel's Issues

How to get specific "components" reusable outside of LK

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 :-)

[tests] Code coverage

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.

[DAV] use MKCOL to create folders that do not exist yet

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

Setting Do-It links programmatically creates broken links

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.

link script issues

Lauritz' comments:

some not very important aesthetics:

  • script needs absolute folders, tried relative ones first, error
  • got an error (could be related to my environment): /Users/i829780/.bash_profile: line 1: .bashrc: No such file or directory
  • Describe what has changed.... maybe could include a link to a diff view
  • Pushing changes from LivelyKernel to webwerksatt: type -> webwerkStatt
  • indention was wrong and more than 80 chars on some lines:
  • very helpful information at the end of the automatic part of the linking. here a proposal for the order of information bits:
### 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

[Class system] Static / class-side methods through subclass and addMethods

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.

Extract module and class system from Base.js

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.

SCB VersionDiffer broken

When opening a VersionDiffer in the SCB module list via context menu then not the right module url is used.

OMeta's Array printing breaks D3 path rendering

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")

[tests] fix JSToAstTests in Firefox

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

[text] Text loses its textString when not in DOM

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.

Halos for worlds not working

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.

split LivelyKernel repo

One repo for the scripts and server stuff.

Another containing just the Lively Kernel core code

Style editor is unfriendly

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.

Syntax Highlighting Debouncing Broken

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();

errors on load

Just cloned and ran and got both errors:

Color Parser lib failed to load because of:
SyntaxError: Unexpected token '.'

CSS Parser lib failed to load because of:
ReferenceError: Can't find variable: CSSParser

What does it mean for someone trying to work with LK?
Screen Shot 2013-03-06 at 8 00 30 AM
Screen Shot 2013-03-06 at 8 00 13 AM

Base.js contains the following classes: Point, Rectangle, and Color

@rksm @fbornhofen

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?!

localconfig.js is not Core

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.

Text.appendRichText inserts additional line breaks.

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();

snapshot1

Too many extensions to Array and Enumerable isn't used elsewhere

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...

Update 2.1.4 changelog

Needs some filtering. So far:

Features:

  • lk install (yet to fix)

Minor features:

  • added assertRaises to TestCase
  • added test spies
  • adding date format lib to standard extensions
  • extending #setClipMode: Paramter can either be a string or an object. String: "visible", "hidden", "auto", "scroll" Object: should have x and/or y field with a string og the choices above.
  • lively.morphic.createN as a way to optimize the creation of multiple similar morphs. using it for the grid layout
  • better support for serialization debuging: serializer.findIdReferencePathFromToId now prints a proper JS accessor path
  • upload images with dragn-dop + alt pressed
  • native context menu with ctrl + alt + click
  • morph diffing...?
  • text shadows
  • Text interface extensions...?
    • text morph now supports setFontWeight, setFontStyle, setTextDecoration as getters/setters & in applyStyle
    • insert methods...?
  • lively.Config improvements, per-user config support, config-url override
    • reading pre-bootstrap config
    • usage tracking
  • lively.whenLoaded callback
  • support for creating string tables
  • password input morph
  • SystemConsole for displaying log and error messages in Lively
  • Improved Inspector
  • new morph: lively.morphic.Tree

Fixes:

  • optimize grid layout
  • correct mouse pos when world is offseted
  • restore text selection on focus
  • traits applied to objects get serialized
  • fix pasting of richt text
  • DOM selection fixes or FF and Chrome
  • tabindex fix
  • suppress scrollbar click
  • PUT and other methods were sometimes "cached" in Chrome

Optimizations

  • array method optimizations

Bootstrap: bootstrap vs. bootstrapNewMorphicWorld

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.

Show wrong browser warning

From Dan:

  • little header that would tell people to use a different browser if necessary, so we wouldn't have to do that everywhere that we present a link

[parts] decouple PartsBinInfrastructure from webwerkstatt

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:

  • PartsBinBrowser: this.url = 'http://localhost/LivelyKernel/PartsBin/' (otherwise assumes path in codeBase)
  • PartsBin.js, PartsBin>>
    partsSpaceWithURL: function(url) {
    var rootPath = new URL(Config.rootPath),
    name = url.isIn(rootPath) ? url.relativePathFrom(rootPath) : url
    return this.partsSpaceNamed(name);
    },
  • ???

[WW integration] Diff view

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:

  • really do calls
  • do and process full diff
  • somehow make it callable from outside
  • make a page that prettifies diff output.

I can continue tomorrow, or if you wanna continue, continue ;-)

[morphic] path shape clipping in Chrome

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.

7funthings partsbin browser problem

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.

Please make your mirror branch use [ci skip]

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.

[DISCUSSION] Github Lively integration

@fbornhofen @lauritzthamsen

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?

[tests] remove tests' dependencies on parts

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

Red/broken test cases excluded from default test runs

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

[tests] mouse event simulator: type of 'target' prop in doMouseEvent

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.

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.