Notes about ES6 Class Syntax
Document Meta
backend focus: This documentation is more relevant to Puter's backend than frontend, but is placed here because it could apply to other areas in the future.
Expressions as Methods
One important shortcoming in the ES6 class syntax to be aware of is that it discourages the use of expressions as methods.
For example:
class ExampleClass extends SomeBase {
intuitive_method_definition () {}
constructor () {
this.less_intuitive = some_expr();
}
}
Even if it is known that the return type of some_expr is a function,
it is still unclear whether it's being used as a callback or
as a method without other context in the code, since this is
how we typically assign instance members rather than methods.
We solve this in Puter's backend using a trait called
AssignableMethodsTrait
which allows a static member called METHODS to contain
method definitions.
Uses for Expressions as Methods
Method Composition
Method Composition is the act of composing methods from other constituents. For example, Sequence allows composing a method from smaller functions, allowing easier definition of "in-betwewen-each" behaviors and ways to track which values from the arguments are actually read during a particular call.
General
API
- Index (README.md)
- api drivers
- Group Endpoints
- Notification Endpoints
- Share Endpoints
- Type-Tagged Objects
Concepts
Types
For Contributors
- Comment Prefixes
- contributors vscode
- Local Email Testing
- Puter Extensions
- Repository Structure and Tooling
Extensions
Devmeta
Planning
- Micro Modules
- [planning alternatives_to_
](planning-alternatives_to_)
Self_hosters
- Configuring Domains for Self-Hosted Puter
- Configuring Puter
- First Run Issues
- self_hosters config_values
- self_hosters support
- Self-Hosting Puter
Src
Backend
A_and_A
For Contributors
- Backend Style
- Puter Backend - Directory Structure
- Puter Backend Boot Sequence
- Puter Kernel Moduels and Services
Features
- Batch and Symlinks
- Metered Services and Cost Management
- Protected Apps and Subdomains
- Service Scripts
Lists_of_things
Modules
Puterai
Notes
Services
Src
Modules
Puterai
- Index (README.md)
- Configuring AI Services
- PuterAI API Request Examples
- src backend src modules puterai config
####### For Contributors
Test_drivers
Gui
Phoenix
Tools
Api_tester
Uncategorized
This wiki is generated from the repository. Do not edit files the wiki.
You are reading documentation for Puter, an open-source high-level operating system.
Getting started with Puter on localhost is as simple as:
git clone https://github.com/HeyPuter/puter.git
npm install
npm run start