This repository has been archived by the owner on Jul 21, 2021. It is now read-only.
Releases: novacbn/svelte-commons
Releases · novacbn/svelte-commons
v0.1.2
CHANGELOG
- Added
event
toutil/shared/event
- Similar to
readable
/writable
, returns an object{dispatch: (value) => void, subscriber: (run, invalidate) => unsubscribe}
- Use this to create singleton event publishers, when not in context of the Browser's DOM. e.g. Application sub-systems
- Similar to
- Added
noop
toutil/shared/functional
for dummy function placeholders - Fixed
router
not working in hash mode (removed erroneousformat_url
call)
v0.1.1
CHANGELOG
- BREAKING CHANGES
- All sub-modules,
svelte-commons/lib/*
, are now exported as-is at entry point.- Due to Snowpack not supporting nested imports from external libraries that well.
- e.g. instead of
import {stores} from "svelte-commons"; const {immutable} = stores;
- it is
import {immutable} from "svelte-commons";
- All sub-modules,
- Added initial support for ECMAScript Modules (support for
pikapkg/snowpack
/jakedeichert/svelvet
)
v0.1.0 - (RE-RELEASE)
NOTE: This version was re-released to update the
.version
field insidepackage.json
!
CHANGELOG
- BREAKING CHANGES
- Moved
query_param
fromstores/browser/location
tostores/browser/query_param
- Moved
router
fromstores/browser/location
tostores/shared/router
- Moved
storage
fromstores/browser/storage
tostores/shared/storage
- Updated
hash
/pathname
- Both are now Browser-only, due to
router
no longer needing them on Server context - Both now default to creating new History states for Store changes
- To revert back to old History behaviour, pass
ILocationOptions.replace
, e.g.const store = hash({replace: true});
- They can be made read-only via
ILocationOptions.readonly
, e.g.const store = hash({readonly: true});
- Both are now Browser-only, due to
- Updated
query_param
to now require default values, used to determine typing - Updated
storage
to not automagically returnReadable
Stores on Server- Replacements: Utilize
make_memory_storage
andstorage
to create a graceful degradation Store, or, default to areadable
iflocal_storage
not found, etc... - Example #1:
const graceful_storage = local_storage || session_storage || storage(make_memory_storage());
const color = graceful_storage("preferences.color", "red");
- Example #2:
const color = local_storage ? local_storage("preferences.color", "red") : readable("red");
- Replacements: Utilize
- Updated
local_storage
/session_storage
to benull
if their respective Web Storages are not available - Updated
router
to return{component, href, goto, url, page: {host, path, params, query}}
,page
with Sapper'spage
IRouterReturn.goto
in this case is the same as normalgoto
, but has itsIGotoOptions.base_url
andIGotoOptions.hash
bound toIRouterOptions
- Removed deprecated
attribute_passthrough
/class_passthrough
/html5_passthrough
fromactions/browser/element
- Removed deprecated
immutable_readable
/immutable_writable
fromstores/shared/immutable
- Removed the old
util/shared/context
APIs to reflect newrouter
changes
- Moved
- Added
search
tostores/browser/location
- Added
goto
toutil/browser/location
- Added
IS_BROWSER
toutil/shared/browser
- Updated
format_url
,is_internal_href
,join
,normalize_pathname
inutil/shared/url
to be public API - Updated
storage
to utilizeoverlay
v0.0.4
CHANGELOG
- Added to
overlay
tostores/shared/overlay
for similar functionality asderived
, but providing a second callback to handleWritable
Svelte Stores - Added
make_memory_storage
toutil/shared/browser
, which makes an in-memory version of Web Storage API for use withstorage
- Updated
is_readable
/is_writable
to work as TypeScript Type Guards - Updated
immutable
,schema
to utilizederived
andoverlay
- Updated
tsconfig.json
to fix TypeScript Compiler output not working via CommonJSrequire
- Intent to deprecate
immutable_readable
/immutable_writable
, useimmutable
instead- The two functions were separate at the time, ONLY due to the
overlay
function not existing - Both
immutable_readable
/immutable_writable
are now aliases ofimmutable
- IMPORTANT NOTE:
immutable
defaults to aWritable
Store if you pass in a non-Store value, unlikeimmutable_readable
which defaults toReadable
- The two functions were separate at the time, ONLY due to the
v0.0.3
CHANGELOG
- Added
geraintluff/tv4
as a dependency for JSON Schema validation - Added
format_css_declaration
,format_css_reference
,format_css_variable
toutil/shared/browser
for handling CSS standardized formatting - Added
map_classes
,map_style
,map_variables
toutil/shared/browser
for handling mapping HTML and CSS properties to objects - Added
format_dash_key
toutil/shared/string
for transforming text into dash key-like strings- e.g.
format_dash_key("This is a KeyYep")
->this-is-a-key-yep
- e.g.
- Added
format_tokens
toutil/shared/string
for substituting%s
tokens in a string, with the vararg spread- e.g.
format_tokens("My name is %s! How are you, %s?", "Jeff", "Karen")
->My name is Jeff! How are you, Karen?
- e.g.
- Added
merged
tostores/shared/merged
for applying partials changes to an object over time - Added
schema
tostores/shared/schema
for continuous JSON Schema validation for Svelte Store I/O - Intent to deprecate
attribute_passthrough
,class_passthrough
, andhtml5_passthrough
fromactions/browser/element
- Due to SSR not being possible with them, not being considered before
- Use prop spreading to replace
attribute_passthrough
- Use
map_classes
fromutil/shared/browser
to replaceclass_passthrough
- Moved
IJSONType
fromstores/browser/storage
toutil/shared/builtin
- Updated
storage
to overrideWritable.set
/Writable.update
instead of handlingWritable.subscribe
- Fixed bug in
storage
, where if you setundefined
, it would not update Store to reflect default value
v0.0.2
CHANGELOG
- Updated
util/shared/stores
type exports with prefixes - Updated
util/shared/functional
type exports with new suffixes - Updated documentation
- Moved
actions/action.ts
toutil/shared/actions.ts
- Moved
stores/store.ts
toutil/shared/stores.ts
- Removed old type export from
util/shared/functional