You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
✨ SnippetCache has been extracted into a separate component and the feature now has its own documentation page.
The historyUiCache option has been deprecated in favour of the new snippetCache option.
The HistoryHandler.uiCache flag has been deprecated in favour of the snippetCache option. You can configure it via naja.initialize(defaultOptions).
The data-naja-history-no-cache attribute has been deprecated in favour of data-naja-snippet-cache="off".
An alternative snippet cache storage has been added, utilizing SessionStorage which might offer a larger data quota than history entries. If your snippets are too large for history state, you might try this storage using the snippetCache: 'session' option.
The SnippetCache component exposes three events, store, fetch and restore, that allow you to tweak the caching behaviour or bypass it altogether.
✨ HistoryHandler exposes two new events, buildState and restoreState. These allow you to hook into the History API integration, and the SnippetCache is built on top of them.
✨ ScriptLoader is now able to deduplicate loaded scripts by a unique identifier (suggested in Best way to run code from newly added JS files by snippets #336). You can add a data-naja-script-id attribute to the <script> element inside a snippet. ScriptLoader will only load each identified script once, even if it repeatedly appears in multiple snippet responses.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
New features
✨ SnippetCache has been extracted into a separate component and the feature now has its own documentation page.
historyUiCache
option has been deprecated in favour of the newsnippetCache
option.HistoryHandler.uiCache
flag has been deprecated in favour of thesnippetCache
option. You can configure it vianaja.initialize(defaultOptions)
.data-naja-history-no-cache
attribute has been deprecated in favour ofdata-naja-snippet-cache="off"
.snippetCache: 'session'
option.store
,fetch
andrestore
, that allow you to tweak the caching behaviour or bypass it altogether.✨ HistoryHandler exposes two new events,
buildState
andrestoreState
. These allow you to hook into the History API integration, and the SnippetCache is built on top of them.✨ ScriptLoader is now able to deduplicate loaded scripts by a unique identifier (suggested in Best way to run code from newly added JS files by snippets #336). You can add a
data-naja-script-id
attribute to the<script>
element inside a snippet. ScriptLoader will only load each identified script once, even if it repeatedly appears in multiple snippet responses.Minor changes and bugfixes
data
into (Serialize top-level arrays in makeRequest() #315).naja.initialize()
is no longer required to be called after the DOM is loaded, Naja makes sure of that internally where necessary.Accept: application/json
header (Add Accept: application/json #314).This discussion was created from the release 2.2.0.
Beta Was this translation helpful? Give feedback.
All reactions