wuse
v1.0.0
Published
Wuse (Web Using Shadow Elements) is a Web Components library that encapsulates the usage of the Custom Elements Registry and the Shadow DOM features of ES6.
Downloads
64
Maintainers
Readme
WUSE
Wuse (Web Using Shadow Elements) is a Web Components library that encapsulates the usage of the Custom Elements Registry and the Shadow DOM features of ES6. Additionally, it offers an IoC event-driven lifecycle, a pure javascript approach to markup and styles generation, optional reactivity for fields, and much more.
This is a work in progress, with a lot of things in an experimental stage. More documentation, tests and examples to come.
MOTIVATION
"If you want more effective programmers, you will discover that they should not waste their time debugging, they should not introduce the bugs to starth with."
- Edger Dijkstra, The Humble Programmer, 1972
CHARACTERISTICS
- no external dependencies (none in runtime and only esbuild if you want to build from source)
- self-documenting api (descriptive "long" function names)
- full unit testing (630+ tests cases)
markdown documentation
(public api in minimallistic style, inspired by decades of repeating RTFM)extensive example library
(39 demos: 16 simple samples and 23 with third party libraries)
FEATURES
#NATURAL-WAY
Wuse exposes a more natural way of working with the browser instead of hiding the way it works:
- wraps the Custom Element Registry usage: just create your class extending from a Wuse HTML Element class, register it and then instantiate it as you need (class names are converted into valid custom elements, ex: 'My_Element' class is converted into 'my-element' tag)
- creates a functional structure over the Shadow DOM: a root element, a style element and a main element
- does not block nor interfere with direct DOM access (for example, this is good when dealing with legacy webs, allowing progressive migrations)
#FULL-CONTROL
Wuse gives you the power to control everything in your web development:
- allows all-in-one markup, styles and scripting definitions: you can define your custom element in a single ES6 class file
- allows to retain control on the Element lifecycle: you can hook up to 14 different events
- allows optional field reactivity with free control on the behaviour: you can structure the code the way you want
#NO-BUILDS
Wuse does not require any build step to be performed.
HiSTORY
- [1.0.0] 2023-jan-28
- version bump
- [0.9.9] 2023-jan-16
- added
hasCSSNestedRuleBySelectors
andreplaceCSSNestedRuleBySelectors
to theStructuredElement
class - added Javascript & Web Helpers API initial documentation
- added
Indeterminate_ProgressBar
demo
- added
- [0.9.8] 2023-jan-11
- renamed
BaseElement
toStructuredElement
- added Structured Element API initial documentation
- added
Spinner_Panel
demo
- renamed
- [0.9.7] 2023-jan-04
- added
getRawContent
to theBaseElement
class - moved testing related files into
tests
subdirectory insidesrc
directory
- added
- [0.9.6] 2022-dec-30
- improved SVG support
- added
SVG_ForeignObject
demo - added
test.unim
ubernim file to serve testing with enhanced capabilities (that means support for theSHUTDOWN
button in thetests.html
file)
- [0.9.5] 2022-dec-02
- added
hasRawContent
to theBaseElement
class - added
docs
directory with some initial documentation
- added
- [0.9.4] 2022-nov-23
- added recursive element definition support via the walrus operator
:=
- added
Animate_JsFunction_Sample
demo
- added recursive element definition support via the walrus operator
- [0.9.3] 2022-nov-19
- added
next
getter to theNodeManager
class - added
MetroUI_ShortcutButton_Sample
demo
- added
- [0.9.2] 2022-nov-15
- added
allowsRawContent
to theBaseElement
class - added
Concise_AlertBox_Sample
demo
- added
- [0.9.1] 2022-nov-13
- added
htmlToShorthand
to theCoreClass
class - now static
register
of theBaseElement
class is fluent - added
Mini_MenuDrawer_Sample
demo
- added
- [0.9.0] 2022-nov-11
- extracted
ChildrenHolder
class to an external file - extracted
RulesHolder
class to an external file - extracted
FieldsHolder
class to an external file - now
setAttributesAsKeys
flag is set on by default - removed incorporated rules in children
- extracted
- [0.8.9] 2022-nov-09
- added
isMainIdentified
andremoveFromParent
to theBaseElement
class - added
MDL_ContactChip_Sample
demo
- added
- [0.8.8] 2022-nov-08
- added
setMainEventHandler
anddropMainEventHandler
to theBaseElement
class - added
Materialize_FloatingButton_Sample
demo
- added
- [0.8.7] 2022-nov-07
- added main element events support in the
BaseElement
class - added
Wing_Grid960_Sample
demo
- added main element events support in the
- [0.8.6] 2022-nov-03
- added
defineReadOnlyMembers
to theJavascriptHelpers
class - added
changeDOMElementTag
to theWebHelpers
class - added
Turret_FormInputs_Sample
demo
- added
- [0.8.5] 2022-oct-31
- added
adoptCSSStyleSheet
to theBaseElement
class - added
Picnic_StackToggle_Sample
demo
- added
- [0.8.4] 2022-oct-28
- added
getChildElementsCount
,getCSSRulesCount
andgetInstanceFieldsCount
to theBaseElement
class - added
buildDOMElement
andbuildDOMFragment
to theWebHelpers
class - added
Primer_SideNavigation_Sample
demo
- added
- [0.8.3] 2022-oct-27
- added
selectChildElements
to theBaseElement
class - added
Progressive_List
demo
- added
- [0.8.2] 2022-oct-25
- added
isReactiveField
to theBaseElement
class - added
Tachyons_BasicBanner_Sample
demo
- added
- [0.8.1] 2022-oct-24
- added
removeMainAttribute
to theBaseElement
class - added
Development_Console
demo
- added
- [0.8.0] 2022-oct-22
- added
encloseRenderingEvents
to theBaseElement
class (this implies noon_prerender
andon_postrender
events by default) - now
restoreOnReconstruct
flag is set on by default (this means noon_reconstruct
event by default) - now
fireSpecificRedrawEvents
flags are not set by default (this means noon_reload
andon_repaint
events by default) - removed
instantiate
fromCoreClass
in favor ofcreate
usage and theBaseElement
owncreate
routine
- added
- [0.7.9] 2022-oct-21
- extracted
CoreClass
class to an external file - added
CoreClass
class unit test - added
transferCSSRuleBySelector
to theBaseElement
class - added
UIkit_Sortable_Group
demo
- extracted
- [0.7.8] 2022-oct-19
- added
isHTMLVoidTag
to theWebHelpers
class - added
transferChildElementById
to theBaseElement
class - added
Transfer_Child
demo
- added
- [0.7.7] 2022-oct-17
- added
fireSpecificRedrawEvents
to theBaseElement
class - added
Spectre_Timeline_Sample
demo
- added
- [0.7.6] 2022-oct-15
- renamed all the es6 modules to the .mjs file extension
- splitted demos at directory examples into simple-samples and third-party subdirectories
- added
Siimple_SignIn_Sample
example
- [0.7.5] 2022-oct-14
- added
snapshotInstanceFields
to theBaseElement
class - added
Canvas_Text_Wrapper
example
- added
- [0.7.4] 2022-oct-12
- added
restoreOnReconstruct
to theBaseElement
class (if you set this behaviour thenon_reconstruct
won't fire) - added
prepare
to thePartsHolder
class - added
isHTMLAttribute
to theWebHelpers
class - added
MISNAMED_FIELD
error to theRuntimeErrors
class - added
ChartJS_VerticalBars_Sample
example
- added
- [0.7.3] 2022-oct-10
- added
dropAllFields
,addMainClass
,removeMainClass
andtoggleMainClass
to theBaseElement
class - added
FomanticUI_Messages_Sample
example
- added
- [0.7.2] 2022-oct-08
- added
removeAllChildElements
andremoveAllCSSRules
to theBaseElement
class - added
clear
to thePartsHolder
class - added
element
setter to theNodeManager
class - now the instantiators methods accept an HTMLElement node as the targeted parent
- added
Foundation_Accordion_Sample
example
- added
- [0.7.1] 2022-oct-05
- added
on_content_verification
to theContentManager
class - added
wuse.dbg.js
to the build generation and distribution directory (comes unmified and with DEBUG and MEASURE flags turned on by default) - added
Milligram_Form_Sample
example
- added
- [0.7.0] 2022-oct-03
- added
create
to theWuse
class - added static
register
andcreate
to theBaseElement
class - added
createInstance
to theElementClasses
class - now you can pass parameters to manually instantiated elements
- added
areOf
to theJavascriptHelpers
class - added
getIndexOf
to thePartsHolder
class - removed freeze and defreeze from the reactive field actions
- added
Skeleton_Grid_Sample
example
- added
- [0.6.9] 2022-sep-30
- added
makeReadonlyField
to theBaseElement
class - added
Bulma_Breadcrumb_Sample
example
- added
- [0.6.8] 2022-sep-28
- added
isIntegerNumber
to theJavascriptHelpers
class - added
Regular_vs_Reactive
example
- added
- [0.6.7] 2022-sep-26
- added
on_snapshot_part
andon_recall_part
to thePartsHolder
class - added
TAKEN_ID
error to theRuntimeErrors
class
- added
- [0.6.6] 2022-sep-22
- added
dropField
to theBaseElement
class - extracted
ReactiveField
class to an external file - added
ReactiveField
class unit test
- added
- [0.6.5] 2022-sep-20
- added
nameFiliatedKey
,rememberFiliatedKey
andhasFiliatedKey
to theStateManager
class - added
deriveChildrenStoreKey
to theBaseElement
class - now children custom elements are assumed to be Wuse elements so automatically by default a filiated wusekey is added if not already present
- added
- [0.6.4] 2022-sep-18
- added
slotsInvalidator
to theWuseRenderingRoutines
class - added
PureCSS_DropdownMenu_Sample
example
- added
- [0.6.3] 2022-sep-15
- added
Bootstrap_Radiogroup_Sample
example - changed
ALREADY_REGISTERED
error to a warning
- added
- [0.6.2] 2022-sep-14
- added
BAD_TARGET
warning to theRuntimeErrors
class - added
jQueryUI_Datepicker_Sample
example
- added
- [0.6.1] 2022-sep-10
- extracted
StateManager
class to an external file - added
StateManager
class unit test - added
replaceCSSRuleBySelector
to theBaseElement
class
- extracted
- [0.6.0] 2022-sep-06
- improved state management
- adjusted instantiation process events nomenclature renaming them to
on_element_instantiated
andon_bad_target
- added
WUSEKEY_ATTRIBUTE
andWUSENODE_ATTRIBUTE
to theStringConstants
class
- [0.5.9] 2022-aug-31
- added
hasField
,hasCSSRuleBySelector
andremoveCSSRuleBySelector
to theBaseElement
class
- added
- [0.5.8] 2022-aug-30
- added
isHTMLTag
to theWebHelpers
class - added
UNKNOWN_TAG
warning to theRuntimeErrors
class - added
getMainAttribute
to theBaseElement
class - extracted
ElementEvents
class to an external file - added
ElementEvents
class unit test - added
Plain_Progress_Bar
example
- added
- [0.5.7] 2022-aug-26
- added
removeChildElementById
to theBaseElement
class - added
remove
to thePartsHolder
class
- added
- [0.5.6] 2022-aug-23
- added
ALREADY_REGISTERED
error to theRuntimeErrors
class - added
Command_Line
example - now version constant is been taken from the
package.json
file
- added
- [0.5.5] 2022-aug-22
- extracted
StringHashing
class to an external file - added
StringHashing
class unit test
- extracted
- [0.5.4] 2022-aug-20
- added
lockChildElements
,unlockChildElements
,lockCSSRules
,unlockCSSRules
,lockFields
andunlockFields
to theBaseElement
class - added
locked
andon_forbidden_change
to thePartsHolder
class - added
LOCKED_DEFINITION
error to theRuntimeErrors
class
- added
- [0.5.3] 2022-aug-19
- added
suspendRender
,resumeRender
andisRenderSuspended
to theBaseElement
class
- added
- [0.5.2] 2022-aug-16
- extracted
InitializationRoutines
class to an external file - added
Templates_And_Slots
example
- extracted
- [0.5.1] 2022-aug-13
- extracted
ElementModes
class to an external file - added
ElementModes
class unit test - added
Performing_100K_Updates
example
- extracted
- [0.5.0] 2022-aug-12
- added
removeFromElementsStore
to theBaseElement
class - removed
keepDataStored
to therestoreFromElementsStore
method of theBaseElement
class - added
makeState
to theElementParts
class - added
INVALID_STATE
error to theRuntimeErrors
class - added
Element_Events
example
- added
- [0.4.5] 2022-aug-10
- added
force
argument to theprocess
method of theContentManager
class - refactored
Wuse
class
- added
- [0.4.4] 2022-aug-08
- added
EMPTY_STRING
to theJavascriptHelpers
class - improved
BaseElement
class
- added
- [0.4.3] 2022-aug-05
- extracted
BaseElement
class to an external file
- extracted
- [0.4.2] 2022-aug-04
- added
ElementParts
class unit test - added
PartsHolder
class unit test
- added
- [0.4.1] 2022-aug-02
- added
cloneObject
andforEachOwnProperty
to theJavascriptHelpers
class - extracted
ElementParts
class to an external file - extracted
PartsHolder
class to an external file
- added
- [0.4.0] 2022-jul-31
- extracted
TextReplacements
class to an external file - added
TextReplacements
class unit test
- extracted
- [0.3.9] 2022-jul-28
- added
onElementInstantiated
andonBadTarget
events to the instantiation process - added
Simple_Button
example - extracted
RenderingRoutines
class to an external file - added
RenderingRoutines
class unit test
- added
- [0.3.8] 2022-jul-27
- extracted
TemplateImporter
class to an external file - added
TemplateImporter
class unit test - improved custom browser tester
- updated the
package.json
file
- extracted
- [0.3.7] 2022-jul-26
- extracted
ElementClasses
class to an external file - added
ElementClasses
class unit test - added
ensureFunction
,isAssignedObject
,isAssignedArray
,isNonEmptyArray
andnoop
to theJavascriptHelpers
class - added
UNREGISTRABLE_CLASS
error to theRuntimeErrors
class - improved custom browser tester
- added the
package.json
file - published on npm registry
- extracted
- [0.3.6] 2022-jul-22
- extracted
StringConstants
class to an external file - extracted
JavascriptHelpers
class to an external file - added
JavascriptHelpers
class unit test - extracted
PerformanceMeasurement
class to an external file - added
PerformanceMeasurement
class unit test - improved custom browser tester
- extracted
- [0.3.5] 2022-jul-20
- extracted
NodeManager
class to an external file - added
NodeManager
class unit test - extracted
ContentManager
class to an external file - added
ContentManager
class unit test - improved custom browser tester
- extracted
- [0.3.4] 2022-jul-18
- extracted
EqualityAnalyzer
class to an external file - added
EqualityAnalyzer
class unit test - extracted
SimpleStorage
class to an external file - added
SimpleStorage
class unit test
- extracted
- [0.3.3] 2022-jul-15
- added support for text nodes in the shorthand notation via
^text^
pseudo-node type (ex. '^text^=this is a text node'; note that this, of course, does not combine with named slots) - added support for html encoded text in the shorthand notation via the
&
content prefix (ex. 'label=&this tags will be read as plain text', note if you need start a content with '&' use double '&&') - added
removeChildren
andhtmlEncode
routines to theWebHelpers
class - added
INVALID_TEMPLATE
runtime error
- added support for text nodes in the shorthand notation via
- [0.3.2] 2022-jul-14
- extracted
WebHelpers
class to an external file - added
WebHelpers
class unit test - extracted
RuntimeErrors
class to an external file - added
RuntimeErrors
class unit test - added custom browser tester
- extracted
- [0.3.1] 2022-jul-13
- added
appendCSSNestedRule
andprependCSSNestedRule
to support flat nested css rules - now appended/prepended css rules are joined up to the last/first rule in the list respectively if the selector is the same
- added
getCSSVendorPrefix
to theWebHelpers
class - added
Marquee_Clone
to theexamples
directory
- added
- [0.3.0] 2022-jul-11
- initial release
- [0.2.0] 2022-jul-02
- more features
- [0.1.0] 2022-jun-22
- started coding