- Fix variables not being available for custom elements that require synchronous rendering
- Add support for
gte
andlte
operator, which are aliases forge
andle
- Use shorter compiled function body ids when not on development environment
- Add basic
Optional
value-wrapper class support - Make sure variables are always cast to a
Variables
instance - Add
Variables#get(key)
&Variables#setFromTemplate(key, value)
method - Don't let
Hawkejs.doNextSync(promise)
swallow errors - Use methods for getting (and proxy traps for setting) variables on the
Variables
class - Refactor variable access in compiled template code
- Only clone certain variables once, when they are initially set
- Prepare text nodes during compiling
- Clean up custom element
renderCustomTemplate
function - Add initial reactive variable support
- Allow assigning an element to a reference using
:ref
syntax - Add support for ternary conditionals
- Add
CustomElement.defineStateVariable(name, config)
static method - Add
CustomElement#setState(name, value)
andCustomElement#getState(name)
methods - Make template slots behave more like vanilla custom element slots
- Finally upgrade NWSAPI from v2.2.0 to v2.2.12
- Fix setting
value
property on a<select>
item not changing the selected option - Make the
each
expression handleMap
-like instances correctly - Fix
each
expression not supporting function calls - Don't render manually created custom element on initial attachment to the DOM if it has already been manually rendered
- Clear
addElementGetter
andaddElementsGetter
cache when rendering
- Add
setGlobal
,getGlobal
andhasGlobal
methods to theHawkejs
class, for setting "global" variables that are available to all templates - Allow Hawkejs syntax operators to be uppercased
- Allow
Hawkejs.RESULT
properties to be functions - Add
Element.setStylesheetHandler(fnc)
to add custom stylesheet handling of custom elements - Don't apply the custom-element options twice when a sync render is requested
- Support all form submission methods
- Fix optional chaining not working in EJS code
- Use original slot elements when re-rendering a custom element
- Set
data-he-rerendering
attribute while rerendering a custom element - Make custom element keep width & height while rerendering
- Fix server-side
HTMLElement#removeAttribute()
not removing dataset attributes with dashes - Make custom elements use a new renderer scope when it's being rendered in a dialog
- Trigger
HePlaceholder
render when made & inserted in the DOM manually - Improve printed error messages during rendering
- Actually update the
hawkejs.scene.exposed
values after receiving new data from the server - Fix custom-element render issue with overlaying variable instances
- Fix setting
value
not working server-side on<textarea>
elements - Add
Renderer#handleError()
method - Newlines are no longer an expression delimiter, only semicolons are
- Fix
Renderer#addSubtemplate(template, variables)
not preparing variables properly - Remove usage of bound
startsWith
&endsWith
method
- Cancel previous render when a new one is started of a custom element
- Implement bracket notation property accessor
- If an
openUrl()
call receives an object with arender
proeprty set to false, no render will be performed - Improve performance by creating less promises when possible
- Fix
Renderer#_emitBegin()
slowing to a crawl the more subrenders start - Make sure getting template sources stay within the allowed paths
- Automatically set the
force_async
option of theHawkejs.series
method to false - Use as many Swift pledges as possible
- Improve performance of enabling styles/scripts in the browser
- Fix performance issue when rendering hundreds of custom elements
- Fix deadlock when rerendering an element during a render
- Fix
he-context
elements always having scrollbars - Add more popup options when receiving a
openUrl()
response
- Fix elements being added to another element directly not being marked as dirty on the browser side, and thus not running the
onHawkejsAssemble
andretained
method
- Make
Renderer#getId(prefix)
check for existing elements on the browser first - Make the getters of boolean attributes of custom elements always return a boolean instead of null
- Fix infinite loop due to overriden ancestor element
- Handle printed promises as expected
- Fix
li
elements not being seen as valid child elements of anol
- Fix
Renderer#getId(prefix)
returning the same value when using a prefix
- Fix deadlock in browser-side
Renderer#doTasksGrouped()
method
- Fix programatically added head tags not having their custom attributes set
- Allow using expressions for dynamic element tag names
- Add more
ElementInternals
property getters to the server-sideHTMLElement
implementation - Add the
Element#hideForAssistiveTechnology(value)
method - Add the
Element#hideForEveryone(value)
method, which will set bothhidden
andaria-hidden
- Implement the server-side
Style#removeProperty(name)
method - Let the
Builder
keep track of the original source code - Also use custom variables defined on an element (using
+
) inside the template - Also serialize a custom element's custom variables
- Always set the
Hawkejs.APPLIED_OPTIONS
symbol before rerendering a custom element - Add the
setVariable
andgetVariable
methods to the custom element class - Add the
<he-dynamic>
element, which remembers its original content source as its template - Try to get the
scene_id
from the exposed variables before creating a new one - Fix variables not being passed to subtemplates properly
- Fix History API issues
- Fix
isDataString()
method not working in theElement
base class - Upgrade dependencies
- Extract some functionality from the
HTMLElement
class and put it into the new parentElement
class - Add the
Hawkejs.Builder
class to easily create HTML & XML trees programmatically
- Force move the focus when clicking on anchor links
- Let
Scene#pushToHistory(data, url)
normalize the url value first - Allow keywords as property names
- Fix elements being added with
insertBefore()
andinsertAfter()
not being marked as dirty - Wrap
pushState
calls in a try-catch block
- Allow paths to begin with a function call
- Optimize server-side
HTMLElement
'schildren
property implementation - Optimize the
Hawkejs.normalizeChildren(element)
method - Optimize
HTMLElement#innerHTML
property - Optimize
Hawkejs.recurseLineTasks()
- Optimize by letting the
_initHawkejs
value be an object again - Add the
RenderTasks
class - Make
Hawkejs.recurseLineTasks()
method skip elements that are certain to be finished already - Don't let
BlockBuffer#makeNode(line)
return strings - Don't loop over every element when informing them of assembly
- Upgrade to Protoblast v0.8.0
- Upgrade Marked to v4.2.12
- Prefer heading elements when a readable element should be focused
- Improve performance of setting/setting text content
- Add
LinkedTokenList#contains(value)
method
- Ignore setting
Renderer
instances on custom elements that have not been undried yet - Ignore attribute name errors during rendering
- Wait for the document to be queryable before initing Hawkejs on the browser
- Fix extra
head_tags
not being added to the generated HTML
- Fix server-side
Node#replaceWith()
method failing when the node has no next siblings - Use fast custom method to check for
data-
attributes server-side - Add 'Hawkejs.logError()` methods, which will not get culled by minifying
- Fix server-side
DOMStringMap
class accepting dasherized keys, when it should throw an error - Link the
role
property to therole
attribute for custom elements - Fix bug where
delayed_elements
(like the foundation content) were actually rendered in the first sub-renderer
- Do not automatically scroll when opening a URL without history
- Use
toDryObject
instead ofdry
for storing history states - Remember & restore scroll position when using the history api
- Fix the initial server-side render not being able to be re-rendered by the history api
- Fix issue where assigning something other than a string to
className
caused an error - Allow setting form/link submission scroll behaviour explicitly to true
- Fix issue in error handler when
code
is a number - Fix css_styles not being set for client-side added elements that do not have a template
- Ensure custom element css only once per request
- Position the
he-bottom
element as fixed - Allow creating
DOMTokenList
instances on the fly withHawkejs.DOMTokenList
- Also call
attributeChangedCallback
after removing an attribute on the server side - Add some missing methods & properties to the server-side
DOMTokenList
implementation - Add support for custom
DOMTokenList
attributes
- Improve context-menu behaviour
- Fix optionally-closed elements never being able to be nested
- Make
LI
element placement when used near other optionally closed elements - Add
Node#contains(other_node)
method to the server-side DOM implementation - Fix false-y default attribute values never being set
- Fix error because styles try to load before scene is created
- Allow setting a custom tag name manually on a custom element
- Fix
Element.addObservedAttribute()
attributes not inheriting properly - Add
Element#addIntervalListener()
to add an interval listener that will only run while the element is connected - Ignore history change when
renderer.history
is explicitly false - Fix
Scene#enableStyle()
creating too many pledges - Make
break number
actually work as expected
- Make
ClassList#add()
andClassList#remove()
behave the same way as in the browser - Add
Renderer#is_root_renderer
getter - Add
Renderer#is_follower_renderer
getter - Try to group certain parallel operations together in the browser
- Add support for elements that can optionally be closed
- Make custom-element slots work with synchronous & plain-html templates
- Use a higher
parallel_task_limit
in the browser - Make client-side style loading a bit more performant
- Revert early error throwing in
Scene#openUrl()
- Make sure variables are prepared before rendering a subtemplate
- Fix
Template#source_name
property being set to empty string after serializing - Don't re-use stale
Variables
clones - Don't ignore error in
Scene#openUrl()
- Add
has_finished
property toRenderer
so (inline) styles don't get added to dormant renderers - Fix template names not getting deduplicated when requesting sources from the server
- Fix custom element styles sometimes not being loaded when rendering element in the browser
- Fix
Renderer
sometimes causing an infinite loop when being cloned
- Use fixed version for
nwsapi
dependency because latest minor version update is broken - Try to use as few true-async
Function.parallel
andFunction.series
calls as possible - Remove some
nextTick
calls too to get more speed - Call
Element#attributeChangedCallback()
later if the scene instance isn't ready - Use much faster checksum to cache client-side use of
getFirstAvailableInternalSource()
- Use grouped versions
Blast.nextGroupedTick()
andBlast.nextGroupedImmediate()
- Add
Hawkejs.series()
andHawkejs.parallel()
which uses a grouped-queue to minimize async overhead - Use new Hawkejs function flow methods for remaining calls that couldn't be synchronized
- Replace all remaining
Fn.parallel
andFn.series
calls with the Hawkejs equivalent
- Add
Hawkejs.getInstance()
so hawkejs can be worked with as a singleton - Define custom elements in the browser as soon as they have been fully constituted
- Add
Hawkejs.isCustomElement(input)
to check if something is a custom element - Fix not calling custom element constructors when created with
Hawkej.createElement()
- Make new renderer instances get the main hawkejs instance as a fallback
- Move the
createElement
method to the main Hawkejs class - Add
Renderer#ensureHawkejsRenderer()
which will always return a valid renderer - Make a renderer "adopt" elements coming from another renderer
- Allow running the unit test server on a specific port
- Make sure custom elements created outside of a renderer are properly constructed
- Don't capture clicks when holding down ctrl or meta key
- Wait for elements to be fully constructed before calling connected callbacks
- Also clone variables fetched via
prepareRenderVariables
before rendering - Use
HashSet
for keeping track of added scripts & styles
- Also register custom elements when
assignData()
method is used - Fix interpreted templates also being executed as an event handler
- Make
Element#moveAfterElement
andElement#moveBeforeElement
work for non-siblings too - Make context menus fit on the screen
- Fix undeclared variable in
Templates#themes
setter - Make sure inlined custom-element css has been added
- Add
CustomElement#waitForTasks()
to wait for the element to have finished all rendering tasks - Make sure custom elements with inlined, plain html templates do not render twice
- Fix expressions sometimes not finding correct variable to work with
- Add
<he-context-menu>
element
- Throw an error when an open tag isn't valid
- Make assigning
undefined
to an element'sinnerHTML
property behave the same was as in the browser - Fix evaluated code in print commands breaking the current render
- Make
macro
expression work again, addrun
expression to use it - Do not re-render a CustomElement's synchronous template if it has already been rendered
- Fix pushing null values to a BlockBuffer throwing an error
- Add
Renderer#current_variables
property which always point to the current active variables - Set the correct ancestor element for root elements in partials
- Render custom element contents as soon as it's being queried
- Don't load hawkejs-client file via javascript when debugging to fix sourcemap issues
- Make callbacks scheduled with
afterRender
call immediately if already rendered - Store the URL being opened on the
Scene#opening_url
pledge - Fix SVG void elements not closing properly
- Fix issue where getting the
getStaticExposedPath
in the wrong order causes it to remain empty
- Make the template wait for
implement
calls when switching to a different template
Hawkejs.handleError()
will now pass previously handled errors without changing them- Don't throw an error when trying to close a void tag
- Closing wrong tags in html-only mode should not throw an error
- Do not render code inside HTML comments
- Do not parse hawkejs code when setting innerText/innerHTML of an element
- Fix
Hawkejs.removeChildren(element)
not removing children of<form>
element
- Change the way templates are compiled (part of the "variable references" work)
- Make the template wait for
implement
calls when switching to a different template
- Fix
getElementContent()
still usingBlast.parseHTML()
- Add
set
expression - Do not use
xhr
property of aDevelry.Request
instance - Put the static exposed variables in a temporary javascript file
- A single Hawkejs syntax block can now contain multiple expressions, separated by either a newline or a semicolon
- Parsing HTML elements & hawkejs syntax now happen in the same step
- Reworked mapping errors to the original template source
- Renderer#closeElement() should work fine when called with no arguments
- Calling
Blast.doLoaded()
should catch errors Scene#openUrl()
should mark source elements as not-busy after a request has been intercepted- Custom elements with a simple HTML template should render their contents BEFORE applying element options
- Fix
he-placeholder
elements sometimes causing an infinite loop - Set custom element render variables from within the element tag using the
+
sign - Apply certain element options before rendering a custom element's template synchronously
- Delay custom element constructor until readyState is "loaded"
- Make sure stylesheets of custom elements are loaded when rendered on the client side
- Add
switch
expression - Add
transpose
option to themarkdown
expression - Allow using plus & minus token at the start of an expression
Hawkejs.parseHTML(html)
now also works in the browser- Use Protoblast's
Branch
class as the basis for the server-sideNode
implementation - Fix
preTasks
not being run before other tasks - Don't throw an error when closing void elements
- Add new events for debug purposes
- Fix
<!DOCTYPE>
never having attributes - Set the
data-he-last-template
body attribute on the server-side too - Add
assertPropertyName(name)
function to make sure added custom element properties are allowed - Allow setting default custom element attribute values
- Add
Element.setRole(value)
method - Fix server-side
Node#compareDocumentPosition()
returning the reversed result - Fix the
root
option inScene#openUrl()
- Look for a
toAttribute()
method when assigning a value to an element's attribute during render - Add a
state
property to theRenderer
class - Expressions can now check the
state
property and change their behaviour when an element is being created, for example - Assigning a value to an attribute will triger their
toAttributeValue
method - Let the
Renderer
class keep track of the html, head & body elements - Add a
language
property to theRenderer
class, which also sets the htmllang
attribute - Fix location hash not changing when clicking a link
- Call the deprecated
renderHawkejsContent
methods withHawkejs.callDeprecatedRenderContent()
so they don't get called multiple times - Using
Scene#openUrl()
with a specific root element will no longer interfere with the current opening url request - Add
Hawkejs#parallel_task_limit
property to limit amount of concurrent parallel tasks (especially needed for unit tests) - Fix custom element boolean attribute setters
Hawkejs.recurseLineTasks()
will now also prepare printed blocks- Fix setting the page title using asynchronous values on the client side
- Add
Renderer#createSubRenderer()
Helper
directive methods can now return promises- When
async()
calls return an error, print the stacktrace instead of hanging - Non-node objects are now also wrapped in a placeholder on the server-side
- Remove
Template#waitForOtherTemplates()
method, the foundation is now rendered differently - Add
CustomElement#rendered()
callback method - Fix the client-script being loaded twice
- Implement the
neq
operator
- Don't stringify function templates before rendering them in
HTMLElement#_setInnerHTML
- Fix
Hawkejs#rewriteVariableReferences()
triggering getters - Implement
Node#compareDocumentPosition(other)
- Make EJS
<%= %>
print commands unsafe - Add server-side
Node#replaceChild()
andNode#replaceWith()
implementation - Fix slots not being filled in subtemplated of custom elements
- Fix
Hawkejs.getTextContent()
not returning correct text value for text nodes in the browser - Fix
Renderer#makeDialog()
not working when rendering from inside the browser - Add the
{% include "template" %}
expression - Add SVG elements to the VOID_ELEMENTS object
- Stringify objects before setting them as the innerHTML
- Add
Hawkejs#evaluate(source, variables)
to synchronously render a simple template - Parse
HTMLElement#innerHTML
assignments to actual elements on-the-fly on the server - Allow plain HTML custom Element templates to be rendered synchronously upon creation
- During a render, element options are only applied when closing the element, or the current element is accessed using
$0
- Fix
Hawkejs.getFirstElement(entries)
returning text nodes - Fix the
assigned_data
property not always being sent to the client-side Hawkejs.addPreTask(element, task)
now also accepts a promise- Add
CustomElement#delayAssemble(task, delay_foundation = true)
which will immediately start the task, but delay the assembly of the element until it finishes (and also delay the "foundation" by default) - Added
Renderer#foundation_delays
property so it can wait on extra promises before creating the foundation - Allow setting multiple getters with an object in
CustomElement#addElementGetter
andCustomElement#addElementsGetter
- Add
Scene#render(template, variables)
to render & apply to the current scene - Add
Renderer#addClass(names)
command to add CSS classes to the current block Scene#getScript()
will now reject the returned promise if an error occurs- Custom elements now emit a
rendered
event after their template has been rendered
Scene#onFormSubmit()
will now also check for the target & data-he-link attribute- Add the
Blocks
class - Fix the
Renderer#makeDialog()
method
- Fix "back" functionality
- Fix toggling the
Scene#allow_back_button
property - Remove the
Hawkejs.closest()
method - Allow safe-printing variables with single curly brackets only, like
{{my_variable}}
- Implement option notation (
a="something"
) as an alternative way to make an object - Add
Scene#detectDoubleClick(request, min_duration=1000)
- Allow opening redirects in a popup window with
x-hawkejs-popup
header
- Fix
Scene#scrollTo()
always assuming the second parameter are options - Fix
Element#getScrollContainer()
returning the wrong scrollable container - Allow custom elements to define CSS with the
Element.setStylesheet()
static method - Add
BlockBuffer#addInfoToElement(el)
to set block info & attributes on the given element - Fully serialize an element when
JSON-Dry
-ing it for a client-side render - Add
Hawkejs.appendChildren(target, children)
method - Fix Element instances with only a dried
outerHTML
value not being properly undried - Move the
BlockBuffer#prepareLineTasks()
logic toHawkejs.prepareLineTasks(lines, renderer)
so it can be re-used - Re-implement dialog support using custom
he-dialog
element
- Code rewrite
- Templates are now built with a virtual dom
var
,let
andconst
can now safely be used inside templates- Added
CustomElement#setAttributeSilent()
in order to not trigger a setter - Added
CustomElement#prepareRenderVariables()
which allows you to add variables before rendering the contents CustomElement#setAttribute(name)
calls will now normalize the attribute & property name- Added
nwsapi
dependency so querying methods can also work on the server
- Fix
BlockBuffer#push()
not returning the index of the pushed line - Backport element attribute serialization fix from 2.0.0
- Allow using simple expressions in templates, without print
- Methods can now be called from within hawkejs expressions
- Fix using OR & AND operators in expressions
- Fix adding multiple operators
- Added
HelperCollection
class: helper classes are now only initialized when they're needed BlockBuffer
is no longer a descendant of Array, but has alines
array property- Calling multiple
start()
for the same block withcontent: push
on will do as expected - Fix undrying elements that are not included in the dom
- Call the
retained
method of a custom-element when it's being rendered in a view
- Attempt to register the server-side render during scene initialization
CustomElement#emit(name, options)
now takes an option object as second argument- Add
HTMLElement#append()
method - Add
HTMLElement#insertAdjacentHTML()
method - Fix
HTMLElement#value
property - Fix
HTMLElement#innerText
andHTMLElement#textContent
properties - Fix
data-
attributes not being removed when changingdataset
property - Add
HTMLElement#children
property & fix#getSiblingByIndex()
and#insertAfter()
- Add support for native v1 custom-element implementation
- Add
Expression.isTruthy()
method to check if a variable is truthy - Add
Element#createElement(tag_name)
to create any element with a hawkejs_id - The basic
HTMLElement
instances can now also be revived when they have ahawkejs_id
- Use Protoblast's
Request
class forScene#fetch
&Scene#openUrl
- Add
Element#enableFocusWithinEvent
&Element#enableHtmlChangeEvent
- Fix server-side HTMLElement
value
property implementation - Add
ViewRender#getBlockByName()
andViewRender#active_block
- Add
trim
expression, to trim away whitespace on left and/or right side - Make
print
expression smarter - Don't add the "result" html when json-ifying Placeholder instances
- If
version_info
is available, add it as a GET parameter to stylesheet & template requests - Use
Blast.fetch
for getting the templates on the client-side - Make
Scene#serverResponse()
work without an actual XHR instance - Add server-side
Element#insertAdjacentElement()
and fixappendChild
andinsertBefore
from not adding the same element twice - Add server-side
Element#hidden
property support - Allow calling
CustomElement#setAssignedProperty
with only a function argument - The on-assigned-data method callbacks will no longer replace the value if it returns a thennable
- Fix
CustomElement#setAssignedProperty
with custom setters not having their value set - Forward some errors to
Scene#handleError(err)
, if it is set - Only remove custom elements from the browser store a few seconds after it has been introduced
- Don't print whitespaces after code blocks ending with a dash, like
<% -%>
- Add new, additional template syntax:
{% %}
- Prevent
CustomElement#attributeChangedCallback()
from firing twice - Add
Helper#createElement(name)
method - Emit
opening_url
event when executingScene#openUrl()
- Handle hawkejs-client script loading before the
_initHawkejs
object is present - Fix
Scene#disableStyle()
to also work on Firefox - Make
Scene#serverResponse()
callback with an error if response status >= 500
- Calling
CustomElement#setAttribute
method will now add itself as a constitutor - Add
Node
class, letElement
inherit from it - Add
Element#queryTabbableElements
hawkejs_init
will now emit with the revived variables,hawkejs_initing
will emit with the dried variables- Recursively perform
getContent
on finished blocks & on HTMLElement childnodes - Fix
setAssignedProperty
replacing the wrong value when a setter is given - Allow element with class
js-he-unlink
to prevent a customjs-he-link
from being fired when clicking on it - Allow disabling moving browser focus by passing
move_browser_focus: false
toScene#openUrl
- Upgrade FormData polyfill which fixes some IE11 issues
- Fix
Scene#serialize_form(form)
so it correctly serialize checkboxes - Make
Scene#fetch()
accept with FormData - Fix exporting the Hawkejs namespace
Hawkejs#compile()
now accepts a single string with a template source again
- Set
nodeName
andtagName
in the correct case when usingHawkejs#createElement
- Add
HTMLElement#isFocusable()
andHTMLElement#isTabbable()
methods - Add
HTMLElement#forceFocus()
to force setting focus to an element - Change focus to the first created block on a page after an AJAX browse
- Use new
RURL
class fromprotoblast
version 0.5.7
- Emit
hawkejs_scene
event on the Blast object when the scene is being made - Emit
hawkejs_init
event with the new instance and non-undried init objects - The temp file created for the client file will now have a 'hawkejs_' prefix and a '.js' suffix
- When manually adding helper files you can now pass the
make_commonjs
option, which will wrap it in a function withHawkejs, Blast
arguments JSON-dry
can now directly undry an object, no need to stringify it first- You can add a
interceptOpenUrl
method on theScene
class to intercept open urls - Add client-side connection checking
- Add
use strict
to all helpers - Add
module.exports
headers to helpers automatically - Added
HTMLElement#hasAttribute
method - Added
HTMLElement#insertBefore
method - Also wait for objects that have a
whenFinishedOrTimeout
method isVisible
fix:overflow: auto
also makes a view context- Custom elements are now stored in the
Hawkejs.Element
namespace - Allow the use of custom default prefixes in custom elements, instead of "he"
- Helpers are now stored in the
Hawkejs.Helper
namespace - Prefer "partial" over "element", so added methods like 'ViewRender#print_partial'
- Make sure
registerRender
doesn't fail when there is no url - Fix
Hawkejs.removeClasses
andHawkejs.addClasses
so it doesn't crash on a class_name with only whitespace - Use
decodeURI
when using ax-history-url
as new url - Put every class under the
Hawkejs
namespace - Custom element instances created during a client side render will no longer be re-created when finally inserted into the DOM
ViewRender#getId(prefix)
now accepts a prefix, which starts a new number sequence- Added
Hawkejs.elementHasBeenRegistered(name)
Hawkejs#getSource
will no longer cache template when debugging- Fix
Hawkejs#load
usingbrowser
property instead ofclient
- Add dataset polyfill for ancient browsers
- Fix
getFirstAvailableInternalSource
on the client not returning an object - Use
useragent#lookup
for faster parsing of useragents - The
Scene#generalView
property is created even before the document is ready - Custom elements now have a
hawkejs_view
property, so a ViewRender instance can always be accessed - Custom elements also have a
hawkejs_helpers
property - Hawkejs block elements are now identified by the 'x-hawkejs' class instead of tag name
isVisible
should now work correctly, even in nested scrolls. When no padding is given, it'll even do an occlusion check
- Add
Hawkejs.addAttributes(element, attributes)
Scene#fetch
andScene#openUrl
will no longer try to parse empty "json" responses. (This happened on Firefox, not on chrome)- Cookies will use the
secure
flag by default when on a secure page - Fix memory leak in history implementation
- The 'scene_start' cookie will be set on the url's pathname, not just path (which includes queries)
x-history-url
header value will be encoded usingencodeURI
- The
_initHawkejs
json variable will now escape "</script>" tags
- Creating a Helper instance without a view on the server side will no longer throw an error
Scene#serverResponse
will now callback with theViewRender
instance- When a dialog is closed by clicking on the wrapper "dialog_close" event will be emitted on the ViewRender instance
- Catch errors made by
Scene#fetch
duringxhr#send
style
calls can now be full urls- Added
Scene#render
method, which applies the render results to the current scene (Hawkejs#render
will only render them, without applying) - Make
js-he-form
s use themethod
attribute, instead oftype
- The
get
option can now also be aFormData
instance add_class
calls will now also work in blocks that have been turned into a dialog- Forms and links with
js-he-close-dialog
as a CSS class will close the parent dialog after their successful request Scene#render
now returns the created ViewRender instance- Fix:
ViewRender#beginRender
now actually waits for the emitted 'begin' events to finish. This used to cause race conditions. - Setting a pagetitle can now be done with an object supporting
getContent
andtoHawkejsString
- Fix
Scene#scrollTo
not working at all - Don't scroll to anything when an openUrl call results in a dialog being made.
- Add
ViewRender#showDialog
which can add dialogs from the server side - Call
Scene#ajaxify
after emitting the created events (so clicks can be prevented) - Strip HTML tags before setting the page title element
- Dialog wrappers will now use z-index of 998, 9000 less than before
- The client-side
doExtensions
method will now alsochangeMain
block when extending - Client-side extensions will now also work when extending a dialog
- Hawkejs elements now can also have a "data-entry-template", indicating which templated was the original entry point
- Bump version to 1.2.0, as there are too many breaking changes
- Also remove
h_diversion
andhtop
from history urls - When using
Scene#scrollTo
without any parameters, just scroll to the top immediately - Add
Hawkejs#delayReady
which is intended to be used in "onclick" attributes - Fix some isVisible handling
- Fix the
Helper#parseURL
method - Add simple code to get rid of dialogs when using back button (needs rework)
- Added another attempt to fix scrollTo
- The default
scrollTo
duration can be overwritten by exposingdefault_scrollto_duration
- Add
Templates#name
property - Add
assigns
property toViewRender#toJson()
- Add
Hawkejs.removeClasses
className
s set inassign()
options will remain on the block,className
s set in astart()
call will be removed when a newstart()
is issuedquerySelectorAll
results don't have aforEach
method in Edge, so fix that- Fix race condition in
Hawkejs#createClientFile
- Fix
Hawkejs#require
not honouring path property on the client side - Add dialog css as style element
- Bundle client-side template requests
- Added
add_class
method to add CSS classnames to a Hawkejs element Element#reload
will now render the correct theme of template- Elements with the
data-update-request
attribute will only get the click/change listener once - CustomElements will be registered once all the Hawkejs code has executed
- Fixed calling of
CustomElement#undried
- Renamed CustomElements
attachments
toassigned_data
CustomElement#attach
is nowCustomElement#assignData
- Added
CustomElement#emit
to emit a custom browser event - Added
CustomElement#connectedCallback
functionality - Scene view helpers will be created before scripts are requested
Scene#appears
now also accepts elements and array of elements- History url can also be changed on initial page load with exposed
redirected_to
- Input elements with
data-update-location
willopenUrl
on change - Make
wheel
andclick
listeners passive
- Stylesheet theme support
- Client files: remove code between "//HAWKEJS START CUT" and "//HAWKEJS END CUT"
- Client files can now be non-commonjs formatted (using
is_commonjs
set to false) - Client files no longer use the entire file path as an identifier
- Improve template error reporting
- Integrate custom elements
- Work with HTMLElements
- Complete rewrite
- Remove DOM-style rendering from the server
- Live-data binding
- Add custom 'x-hawkejs-request' header to GETs and POST requests
- Add Mozilla's localforage library
- Expose the ejs renderer via hawkejs.ejs
- Upgrade the History library to version 4.0.9
- Add LZ-String and use it to compresses History API payloads that are too big for certain browsers (IE & Firefox). This slows down the browser, an asynchronous web-worker solution should be sought after next.
- If it is given, use the 'X-History-Url' response header as the url to register with the HTML5 History API.
- Emit viewready event after render or pageload
- Upgrade DOMSpot to 0.1.0
- Don't use the History API on forms that have the 'data-no-history' attribute
- Update History.js to version v4.1.0, fixes some Firefox security errors
- Submit POSTs as JSON instead of urlencoded strings
- Use TJ Holowaychuk's querystring code to convert a form to an object. This makes it perfectly compatible to express, where the same code is used.
- Add events for created 'implementations'. Still need to add them for destroyed ones, too.
- Revert to jQuery 1.8 on the server side
- Add DOMSpot for ClientSide usage
- Upgrade ejs from 0.8.3 to 0.8.5, an upgrade that needed some tweaking.
- Also upgrade cheerio, entities and jquery
- Don't thrown an error when _EjsRender returns an empty string after render, sometimes that's just what needs to happen.
- Fix the History API implementation. Some functions were modified in a way nothing happened anymore on pressing the back & next buttons. The 'historyChange' event is also emitted after the state has been applied.
- Add getObjectPath function, which takes an object and a string and uses that string as a path to look for in the object
- Add uneval function. Right now it only correctly uneval's functions, but more is to come.
- Script tag names are no longer prefixed with 'hawkejs' because it messed up encoding of chars like '<'. To not have the scripts run too soon, jQuery's .parseHTML is used.
- Replace hawkejs.µ with hawkejs.utils, as it caused encoding problems.
- Add a new jQuery converter setting for json-dry strings
- Hawkejs event listener now allows you to pass an array of queries or strings
- Add hawkejs.downloadAjax function, which allows the user to POST data to the server and download the file, as if via AJAX. Even allows callback functions (for when download begins) if the server supports it. Inspired by this stackoverflow question: http://stackoverflow.com/questions/1106377/detect-when-browser-receives-file-download
- Add formify function, which turns an object into key-value pairs fitted for form submission
- Many new functions & helpers
- Partial rewrite of the script & asset helpers
- Expose vendor folder for client side
- The expands() helper now accepts an array of string
- Add serial drones
- Allow links to have no content text
- Improve url matching & add greedy matching
- Make sure links created by add_link have unique ids
- Emit events when a script is added
- Make ejsrender return more data if requested
- Add order & treeify functions
- Add json-dry functions (json with support for dates & regexes)
- Add pr() function for debugging
- Use cheerio 0.12.2 because of a bug in 0.12.3
- client side rendering produces the same html code as the server
- first push to npm after +/- 31 hours of development