websIDE
  • webside
    • Overview
  • API
    • General
      • Dialect
      • Version
      • Colors
      • Logo
      • Stats
      • Themes
      • Icons
      • Save Image
    • Changes
      • Retrieve changes
      • Apply a change
    • Changesets
      • Convert chunks to JSON changes
      • Convert JSON changes to chunks
    • Code
      • Autocompletions
        • Retrieve autocompletions
      • Categories
        • Retrieve categories
        • Retrieve usual categories
      • Classes
        • Retrieve classes
        • Retrieve a class
        • Retrieve categories
        • Retrieve variables
        • Retrieve class variables
        • Retrieve instance variables
        • Retrieve selectors
        • Retrieve methods
        • Retrieve method
        • Retrieve method history
        • Retrieve subclasses
        • Retrieve superclasses
        • Retrieve used categories
      • Methods
        • Retrieve methods
      • Packages
        • Retrieve packages
        • Retrieve a package
        • Retrieve package classes
        • Retrieve package methods
      • Search
      • Selectors
        • Find selector in source code
      • Templates
        • Retrieve class template
        • Retrieve method template
    • Debuggers
      • Retrieve active debuggers
      • Create a debugger
      • Delete debugger
      • Retrieve debugger frames
      • Retrieve debugger frame
      • Retrieve frame bindings
      • Restart debugger
      • Resume debugger
      • Step into debugger
      • Step over debugger
      • Step through debugger
      • Terminate debugger
    • Evaluations
      • Retrieve evaluations
      • Evaluate an expression
      • Cancel evaluation
      • Retrieve evaluation
      • Pause evaluation
      • Resume evaluation
    • Extensions
      • Retrieve extensions
      • Changes extensions
      • Export extensions
      • Search extensions
    • Commands
      • Retrieve command definitions
      • Invoke commands
    • Objects
      • Retrieve pinned objects
      • Pin object
      • Retrieve pinned object
      • Retrieve pinned object slots
        • Custom views
      • Unpin an object
      • Unpin all objects
    • Processes
      • Retrieve active processes
    • Profilers
      • Retrieve active profilers
      • Create a new profiler
      • Delete a profiler
      • Retrieve a profiler
      • Retrieve profiler ranking results
      • Retrieve profiler tree results
    • Testing
      • Run tests
      • Retrieve test run status
      • Retrieve test run results
    • Workspaces
      • Retrieve active workspaces
      • Create a new workspace
      • Delete a workspace
      • Retrieve a workspace
      • Update a workspace
      • Retrieve workspace bindings
Powered by GitBook
On this page
  • Table of Contents
  • About the project
  • A bit of history
  • Key aspects
  • IDE
  1. webside

Overview

PreviouswebsideNextAPI

Last updated 5 months ago

Table of Contents

About the project

Webside is both the specification of an API to interact with an Smalltalk system as a backend and a web IDE built on top of such API as the frontend.

  • Static: used to browse and change code.

  • Dynamic: used to evaluate expressions, both synchronously and asynchronously, and retrieve the resulting objects, as well as to debug and profile such expressions.

A bit of history

This project started as a personal training with the aim of learning React in particular, and improving my JavaScript skills in general. As a passionate smalltalker and having implemented several web APIs in Smalltalk for different purposes and domains, I decided to expose Smalltalk itself thru a web API and see how far I could go implementing the classical Smalltalk IDE tools using React.

*Not finished at the moment of writing this document.

Key aspects

At some point in time, I realized that I should invest all the effort in keeping the API simple in order to:

  • Enable its implementation in any Smalltalk dialect without a major effort,

  • Make any improvement, change, or even a complete revamping of the IDE, easier.

As an extra lesson derived from the latter, I found that:

  • Far from being a downside, having an Smalltalk IDE implemented in JavaScript enables contributions from the JavaScript community to either enhance, change or extend Webside in any direction.

  • Not only this IDE could be used to work among different Smalltalk dialects but also it could allow for several developers to work on the same image at the same time, making Webside a collaborative environment.

Building blocks

Webside is built using these frameworks and components (plus a set of packages not listed here):

IDE

The global layout of Webside is the following:

  • A title bar, including a system search box (not implemented yet)

  • A left side bar with options to access the transcript, the system changes browse and other

  • A right side menu (plus button) to open tools

  • A central container where the different tools are placed in the form of tabs

  • An emergent area (at the bottom) containing the transcript

IDE tools

As a starting point I decided to recreate traditional Smalltalk IDE tools. That is, a class (refactoring) browser, a method browser to browse senders/implementors/references, a workspace to evaluate expressions and the corresponding counterpart, an inspector to dig into the resulting objects, and finally a debugger.

Additionally, I included a transcript where the user can be notified*, a package browser to manage some sort of packages, current changes browser, a simple chat, a test runner and a profiler.

In terms of internal design, every tool is implemented by a React component, with common parts such as the code editor or the method list shared by them.

As it is common to every Smalltalk IDE, every code space where the programmer can write expressions offers the options to evaluate (and/or showing/inspecting the resulting object), debug and profile expressions, plus a bunch of options to search classes and methods (senders, implementors, references, etc.)

Having these basic tools implemented, it is possible to try new presentation alternatives and designs.

Again, the key point here is to keep the required API as simple as possible to ease its porting to an specific Smalltalk system, and then innovate on the presentation layer a much as the imagination flies.

*This transcript is used to emit notifications from the frontend side, such as API errors, but it is not connected to the Transcript global in the backend. To do that, the server should send notifications to the client, but it is not implemented at the moment of writing this documentation.

Class browser

This is more or less the classical refactoring browser, including the hierarchy of classes, their variables (plus some access filters), categories and methods at the top, and a code editor at the bottom.

Method Browser

Another common Smalltalk IDE tool, this list of methods is use to show the result of searching senders, implementors, global references, etc.

Workspace

Again this is the typical pane where the programmer can evaluate expressions (with its own variable scope to hold workspace temporaries) and print or inspect their results. Inspections triggered with the play button are embedded in the same workspace tab, while those triggered with the "Inspect" menu option (or its shortcut) are opened in a different tab.

Inspector

Yet another standard Smallalk IDE tool, this inspector provides a tree view to navegate object internal structur, plus a code pane to evaluate expressions. The evaluation context in this case contains self bound to the (root) object being inspected.

Debugger

This is the basic stack debugger exposing the frame stack of the process being debugged (debuggee), the list of reachable bindings, the code and the current statement of each frame, plus the corresponding actions buttons to step into, step over, restart, resume and terminate the debuggee. As any Smalltalk debugger it allows to recompile the method of a given frame, restarting the process from that point with the new method in place.

A natural and expected functionality of web IDE is the chance to concurrently access and control to the very same pieces of information, being the debugger one of the most desired ones. As this tool relies on a living debugger, it is straigthforward to show the debugger state in more than one web browser, being all capable of interating with the very same debugger (i.e., different users might access and control the same debugger in the server). Of course, actions in one browser should be reflected in the rest. Several approaches can be used for this purpose. In this case, as there is already available a socket to deliver messages between sessions*, I opted to use that channel with a special type of message intended to update the debuggers view in front of changes made in other sessions. In the image below two browsers act over the same browser.

https://github.com/guillermoamaral/Webside/blob/main/docs/images/ConcurrentDebugging.mp4

(*)At the moment of writing this documentation, there is no user sessions kept, neither at Node server nor at the Smalltalk backend server. However, the Node server keeps track of users, by name, to provide a communication channel between users

Test runner

This tool resembles some existing test runners and is launched when a test suite is run (either by running a single test, a test class or a bunch of test classes). It essentially show the progress of tests execution and summarizes the results grouping them by class, and filtering them by their type (failure, error, etc.). This tool is the result of a first development iteration and even when it offers the basic functionality it could be extended and enhanced in many aspects.

Profiler

This tool summarizes the results of profiling an expression by using two visualization approaches: a flame graph and a ranking graph. Like other tools, this one is the result of a first development iteration at the moment of writing this documentation and its rather basic functionality could be extended.

The can be divided into two conceptually different subsets of endpoints:

Being the dialect I use for my daily duties, I started by Bee Smalltalk as the backend (porting the API to afterwards*). Naturally, the API evolved as I progressed at the frontend side, starting by the static part and then moving to the dynamic one.

: the main framework used to build Webside.

: a set of React useful components with handy interfaces and a coherent style.

: the component used to display and edit code.

The IDE used for JavaScript was .

The component implementing this tool is and it relies on and endpoints to browse and make changes to the code, and in and endpoints to evaluate expressions.

The component implementing this tool is and as the ClassBrowser component it relies on and endpoints to browse and make changes to the code, and in and endpoints to evaluate expressions.

The component implementing this tool is and it essentially relies on and endpoints.

The component implementing this tool is and it uses endpoints, specially the one to access object slots, .

The component implementing this tool is and it mainly relies on endpoints to interact with a living debugger at server side. It also consumes , and endpoints to manage code changes and enable evaluations in the context of the debugger.

The component implementing this tool is and it mainly relies on endpoints.

The component implementing this tool is and it mainly relies on endpoints.

API
Pharo
ReactJS
Material-UI
CodeMirror
Visual Studio Code
ClassBrowser
Code
Changes
Evaluations
Objects
MethodBrowser
Code
Changes
Evaluations
Objects
Workspace
Evaluations
Objects
Inspector
Objects
/objects/{id}/*
Debugger
Debugging
Code
Evaluations
Objects
TestRunner
Tests
Profiler
Profiling
Table of Contents
About the project
A bit of history
Key aspects
Building blocks
IDE
IDE tools
Class browser
Method Browser
Workspace
Inspector
Debugger
Test runner
Profiler
Class Browser
Method Browser
Workspace
Inspector
Debugger
TestRunner
Profiler Flame Graph
Profiler Ranking Graph