The @swim/core framework provides a lightweight, portable, dependency-free,
and strongly typed baseline on which to build higher level libraries.
@swim/core forms the foundation on which the
@swim/mesh
multiplexed streaming WARP framework, and the
@swim/ui
real-time user interface toolkits, are built. @swim/core is a part of the broader
@swim/system framework.
@swim/collections
(npm,
doc) –
immutable, structure sharing collections, including B-trees and S-trees
(sequence trees).
@swim/constraint
(npm,
doc) –
incremental solver for systems of linear constraint equations.
@swim/structure
(npm,
doc) –
generic structured data model, with support for selectors, expressions,
and lambda functions. Used as a common abstract syntax tree for Recon,
JSON, XML, and other data languages.
@swim/streamlet
(npm,
doc) –
stateful, streaming component model for application componets that
continuously consume input state from streaming inlets, and continuously
produce output state on streaming outlets.
@swim/dataflow
(npm,
doc) –
compiler from @swim/structure expressions to live-updated data models.
@swim/recon
(npm,
doc) –
object notation with attributes, like if JSON and XML had a baby.
@swim/uri
(npm,
doc) –
rich object model for working with Uniform Resource Identifiers and URI
subcomponents, including an efficient and safe codec for parsing and
writing compliant URI strings.
@swim/math
(npm,
doc) –
mathematical and geometric structures and operators.
@swim/geo
(npm,
doc) –
geospatial coordinate, projection, and geometry types.
@swim/time
(npm,
doc) –
date-time, time zone, and time interval data types,
with strptime/strftime-style parsers and formatters.
For an npm-managed project, npm install @swim/core to make it a dependency.
TypeScript sources will be installed into node_modules/@swim/core/main.
Transpiled JavaScript and TypeScript definition files install into
node_modules/@swim/core/lib/main. And a pre-built UMD script, which
bundles all @swim/core component libraries, can be found in
node_modules/@swim/core/dist/main/swim-core.js.
Browser applications can load swim-core.js directly from the SwimOS CDN.
<!-- Development --><scriptsrc="https://cdn.swimos.org/js/latest/swim-core.js"></script><!-- Production --><scriptsrc="https://cdn.swimos.org/js/latest/swim-core.min.js"></script>
Alternatively, the standalone swim-system.js script may be loaded
from the SwimOS CDN, which bundles @swim/core together with all other
@swim/system
frameworks.
<!-- Development --><scriptsrc="https://cdn.swimos.org/js/latest/swim-system.js"></script><!-- Production --><scriptsrc="https://cdn.swimos.org/js/latest/swim-system.min.js"></script>
@swim/core can be imported as an ES6 module from TypeScript and other
ES6-compatible environments. All component libraries are re-exported by
the umbrella @swim/core module.
When loaded by a web browser, the swim-core.js script adds all component
library exports to the global swim namespace.
The swim-system.js script also adds all @swim/core component library
exports to the global swim namespace, making it a drop-in replacement
for swim-core.js when additional @swim/system frameworks are needed.
@swim/core
The @swim/core framework provides a lightweight, portable, dependency-free, and strongly typed baseline on which to build higher level libraries. @swim/core forms the foundation on which the @swim/mesh multiplexed streaming WARP framework, and the @swim/ui real-time user interface toolkits, are built. @swim/core is a part of the broader @swim/system framework.
Framework
The @swim/core umbrella package depends on, and re-exports, the following component libraries:
strptime
/strftime
-style parsers and formatters.@swim/core has no external dependencies.
Installation
npm
For an npm-managed project,
npm install @swim/core
to make it a dependency. TypeScript sources will be installed intonode_modules/@swim/core/main
. Transpiled JavaScript and TypeScript definition files install intonode_modules/@swim/core/lib/main
. And a pre-built UMD script, which bundles all @swim/core component libraries, can be found innode_modules/@swim/core/dist/main/swim-core.js
.Browser
Browser applications can load
swim-core.js
directly from the SwimOS CDN.Alternatively, the standalone
swim-system.js
script may be loaded from the SwimOS CDN, which bundles @swim/core together with all other @swim/system frameworks.Usage
ES6/TypeScript
@swim/core can be imported as an ES6 module from TypeScript and other ES6-compatible environments. All component libraries are re-exported by the umbrella
@swim/core
module.CommonJS/Node.js
@swim/core can also be used as a CommonJS module in Node.js applications. All component libraries are re-exported by the umbrella
@swim/core
module.Browser
When loaded by a web browser, the
swim-core.js
script adds all component library exports to the globalswim
namespace.The
swim-system.js
script also adds all @swim/core component library exports to the globalswim
namespace, making it a drop-in replacement forswim-core.js
when additional @swim/system frameworks are needed.