2011 05-jszurich

20
Ace: Browser based editor Julian Viereck @jviereck

Upload: julian-viereck

Post on 18-May-2015

562 views

Category:

Documents


0 download

DESCRIPTION

This talk is about Ace, a browser based editor, that powers Cloud9Ide.

TRANSCRIPT

Page 1: 2011 05-jszurich

Ace:Browser based editor

Julian Viereck@jviereck

Page 2: 2011 05-jszurich

Fabian Jakobsajax.org

@fjakobs

Kevin DangoorMozilla

@dangoor

Page 3: 2011 05-jszurich

Code Editors

Page 4: 2011 05-jszurich

Our life is in the cloud... and our dev env?

We use desktop apps to build web apps?

Can’t we do better?

Yes - we can!

Page 5: 2011 05-jszurich

13.7 billion years ago

1983

230 million years ago 230,000 years ago

1770

2008 2009

MozillaSkywriter

2010

Ajax.orgAce2010

Page 6: 2011 05-jszurich

Ajax.org Cloud9 Editor(Ace)

• Fully featured

• Extensible

• Scalable

• Cross Browser

Page 7: 2011 05-jszurich

No Compromise

• we don‘t strive for almost as good

• we strive to be at least as good

• it‘s time for the web to take over

Page 8: 2011 05-jszurich

Cloud9IDE Demo

Page 9: 2011 05-jszurich

Ace Building Blocks

Renderer(View)

Editor(Controller)

Edit Session(Model)

LanguageMode

Document

SelectionKeyboardHandler

KeyboardHandler

Page 10: 2011 05-jszurich

Tech Details

Page 11: 2011 05-jszurich

Renderer

•DOM is used for drawing only

•no state in the DOM

•never read the DOM

Page 12: 2011 05-jszurich

Virtual Viewport

• rendering a full document in the DOM doesn‘t scale

• only render visible rows

..

..

....

..

...

.... . . ...

.

..

.

.

..

..

.

..

.. ..

.

.. . ..

..

.... . . .

.

Page 13: 2011 05-jszurich

Performance• Document size shouldn‘t matter

• Everything in the main thread should scale with the viewport size

BUT

• not everything does!

• We need web workers

Page 14: 2011 05-jszurich

Worker

Web WorkersMain JS Thread

Document....

..

.

.. . ..

..

.... . . .

JS ParserEdit Session

Mirror....

..

.

.. . ..

..

.... . . .

Page 15: 2011 05-jszurich

Ace Demo

Page 16: 2011 05-jszurich

Present

Page 17: 2011 05-jszurich

Present

• 30+ Contributors

• 677 Watchers, 148 Forks on Github

• 234 Pull Requests

• 17 Language modes

Page 18: 2011 05-jszurich

Future

• Code completion

• Code Navigation

• Outline View

• Documentation

Page 19: 2011 05-jszurich

Happy Coding!

@cloud9_editorhttp://ace.ajax.org

https://github.com/ajaxorg/ace