The document discusses EmbedJS, a JavaScript framework that allows for embedding JavaScript across different devices. It takes a library's code and reconstructs it as needed, without runtime code branching, to improve performance. Features are implemented separately and only the necessary implementations are included to reduce file size. The build system is highly flexible and only includes what is needed for a specific project. This makes the codebase highly maintainable with isolated, self-contained features that are easy to work with and extend. EmbedJS provides a small, optimized API that can be customized and includes implementations for many platforms.
8. 1) No code branching at runtime.
How?
Why?
? Features have different implementations.
?You wouldn¡®t want to ship a car w/ a fuel tank and a battery if
you only need one of them.
? Ship no useless code.
? Don¡®t waste computing power on runtime branching.
Feature: energyDepot
Implementations: fuelTank, battery
10. 2) Highly ?exible build system.
How?
Why?
? Features are as small as possible/reasonable.
? Dependencies are declared in a implementaion =>
feature way.
? Ship only what you need!!You don¡®t need a certain feature for
your project? Don¡®t ship it!
12. 3) Highly maintainable codebase.
How?
Why?
? Coder is forced to separate semantically different code.
? Errors in one implementation do not affect another impl.
? Small features make errors easy to isolate.
? Self-contained features make erros easier to ?x.
? Other coders can easily join in on a project.
? Features are as small as possible/reasonable.
? Features are semantically meaningful units.
? Features are as self-contained as possible.
14. ? A very selective API (a cherry-picked ~70
methods @ < 25k, unzipped).
? Implementations for every feature for
almost every possible platform. *)
? A simple-to-use but highly effectve build
tool (that you can use for your own
projects, too).
? The possibility to create a unique custom
build for your project - in seconds.
? The possibility for you to extend EmbedJS
with the features/platforms you want.
The tools: https://github.com/uxebu/embedjs-tools