- Fall back to the exposed
app_versionfor client template fetches:getFirstAvailableInternalSourceread theapp_versionproperty, which is still empty early in the boot process, producing unversioned/hawkejs/templatesurls. Combined with the server's 1h cache header on versioned urls, browsers could keep rendering an old element template for up to an hour after a deploy - Remove the dead server-side
Hawkejs.closest()static: it unconditionally returnednulland had no callers (the realclosest()lives on the DOM element implementation) - Upgrade the
mochadevDependency to v11 so the test suite runs on modern Node again - Restore the covered url when closing a navigation dialog: a route rendered into a
he-dialog(viamakeDialog()) changes the url, but closing the dialog left that stale url in place. The long-disabledif (false && ...)branch inclose()also read the wrong renderer and used an undeclared variable; the scene now stamps the covered url on navigation dialogs at creation time (inlineshowDialog()dialogs are untouched) - Drop an ignored second argument from the two
createTextNodeFromUnsafe()call sites - Make the test harness fall back to a working system Chrome/Chromium when puppeteer's own bundled download is broken or incomplete:
puppeteer.launch()would otherwise hang until its connect-timeout instead of failing fast, since a bad binary can still pass a bare--versioncheck
- Fix an un-bound Protoblast Array method call
- Fix custom elements trying to populate slots belonging to ancestor elements
- Fix dynamic
expose_to_scenevalues not being sent to the client scene properly - Fix
eachstatement null issue - Fix memory leak in
appears()withlive: trueoption where event listeners and intervals were never cleaned up; addeddestroy()method to returned function for manual cleanup - Fix debug
console.logleft in server-sideclosest()implementation - Fix inverted
indexOfcondition for placeholder check inBlockBuffer; changed to useincludes()for correct behavior
- Fix variables not being available for custom elements that require synchronous rendering
- Add support for
gteandlteoperator, which are aliases forgeandle - Reintroduce old slot logic as a fallback for non-processed slots in custom elements
- Use shorter compiled function body ids when not on development environment
- Add basic
Optionalvalue-wrapper class support - Make sure variables are always cast to a
Variablesinstance - 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
Variablesclass - 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
renderCustomTemplatefunction - Add initial reactive variable support
- Allow assigning an element to a reference using
:refsyntax - 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
valueproperty on a<select>item not changing the selected option - Make the
eachexpression handleMap-like instances correctly - Fix
eachexpression 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
addElementGetterandaddElementsGettercache when rendering
- Add
setGlobal,getGlobalandhasGlobalmethods to theHawkejsclass, for setting "global" variables that are available to all templates - Allow Hawkejs syntax operators to be uppercased
- Allow
Hawkejs.RESULTproperties 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-rerenderingattribute 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
HePlaceholderrender when made & inserted in the DOM manually - Improve printed error messages during rendering
- Actually update the
hawkejs.scene.exposedvalues after receiving new data from the server - Fix custom-element render issue with overlaying variable instances
- Fix setting
valuenot 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&endsWithmethod
- 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 arenderproeprty 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_asyncoption of theHawkejs.seriesmethod 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-contextelements 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
onHawkejsAssembleandretainedmethod
- 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
lielements 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
ElementInternalsproperty getters to the server-sideHTMLElementimplementation - Add the
Element#hideForAssistiveTechnology(value)method - Add the
Element#hideForEveryone(value)method, which will set bothhiddenandaria-hidden - Implement the server-side
Style#removeProperty(name)method - Let the
Builderkeep 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_OPTIONSsymbol before rerendering a custom element - Add the
setVariableandgetVariablemethods to the custom element class - Add the
<he-dynamic>element, which remembers its original content source as its template - Try to get the
scene_idfrom 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 theElementbase class - Upgrade dependencies
- Extract some functionality from the
HTMLElementclass and put it into the new parentElementclass - Add the
Hawkejs.Builderclass 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
pushStatecalls in a try-catch block
- Allow paths to begin with a function call
- Optimize server-side
HTMLElement'schildrenproperty implementation - Optimize the
Hawkejs.normalizeChildren(element)method - Optimize
HTMLElement#innerHTMLproperty - Optimize
Hawkejs.recurseLineTasks() - Optimize by letting the
_initHawkejsvalue be an object again - Add the
RenderTasksclass - 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
Rendererinstances 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_tagsnot 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
DOMStringMapclass accepting dasherized keys, when it should throw an error - Link the
roleproperty to theroleattribute 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
toDryObjectinstead ofdryfor 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
classNamecaused an error - Allow setting form/link submission scroll behaviour explicitly to true
- Fix issue in error handler when
codeis 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-bottomelement as fixed - Allow creating
DOMTokenListinstances on the fly withHawkejs.DOMTokenList - Also call
attributeChangedCallbackafter removing an attribute on the server side - Add some missing methods & properties to the server-side
DOMTokenListimplementation - Add support for custom
DOMTokenListattributes
- Improve context-menu behaviour
- Fix optionally-closed elements never being able to be nested
- Make
LIelement 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.historyis explicitly false - Fix
Scene#enableStyle()creating too many pledges - Make
break numberactually work as expected
- Make
ClassList#add()andClassList#remove()behave the same way as in the browser - Add
Renderer#is_root_renderergetter - Add
Renderer#is_follower_renderergetter - 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_limitin 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_nameproperty being set to empty string after serializing - Don't re-use stale
Variablesclones - Don't ignore error in
Scene#openUrl()
- Add
has_finishedproperty toRendererso (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
Renderersometimes causing an infinite loop when being cloned
- Use fixed version for
nwsapidependency because latest minor version update is broken - Try to use as few true-async
Function.parallelandFunction.seriescalls as possible - Remove some
nextTickcalls 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.parallelandFn.seriescalls 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
createElementmethod 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
prepareRenderVariablesbefore rendering - Use
HashSetfor 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#moveAfterElementandElement#moveBeforeElementwork for non-siblings too - Make context menus fit on the screen
- Fix undeclared variable in
Templates#themessetter - 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
undefinedto an element'sinnerHTMLproperty behave the same was as in the browser - Fix evaluated code in print commands breaking the current render
- Make
macroexpression work again, addrunexpression 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_variablesproperty 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
afterRendercall immediately if already rendered - Store the URL being opened on the
Scene#opening_urlpledge - Fix SVG void elements not closing properly
- Fix issue where getting the
getStaticExposedPathin the wrong order causes it to remain empty
- Make the template wait for
implementcalls 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
implementcalls when switching to a different template
- Fix
getElementContent()still usingBlast.parseHTML() - Add
setexpression - Do not use
xhrproperty of aDevelry.Requestinstance - 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-placeholderelements 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
switchexpression - Add
transposeoption to themarkdownexpression - Allow using plus & minus token at the start of an expression
Hawkejs.parseHTML(html)now also works in the browser- Use Protoblast's
Branchclass as the basis for the server-sideNodeimplementation - Fix
preTasksnot 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-templatebody 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
rootoption inScene#openUrl() - Look for a
toAttribute()method when assigning a value to an element's attribute during render - Add a
stateproperty to theRendererclass - Expressions can now check the
stateproperty and change their behaviour when an element is being created, for example - Assigning a value to an attribute will triger their
toAttributeValuemethod - Let the
Rendererclass keep track of the html, head & body elements - Add a
languageproperty to theRendererclass, which also sets the htmllangattribute - Fix location hash not changing when clicking a link
- Call the deprecated
renderHawkejsContentmethods 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_limitproperty 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() Helperdirective 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
neqoperator
- 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#innerHTMLassignments 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_dataproperty 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_delaysproperty so it can wait on extra promises before creating the foundation - Allow setting multiple getters with an object in
CustomElement#addElementGetterandCustomElement#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
renderedevent after their template has been rendered
Scene#onFormSubmit()will now also check for the target & data-he-link attribute- Add the
Blocksclass - Fix the
Renderer#makeDialog()method
- Fix "back" functionality
- Fix toggling the
Scene#allow_back_buttonproperty - 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-popupheader
- 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
outerHTMLvalue 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-dialogelement
- Code rewrite
- Templates are now built with a virtual dom
var,letandconstcan 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
nwsapidependency 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
HelperCollectionclass: helper classes are now only initialized when they're needed BlockBufferis no longer a descendant of Array, but has alinesarray property- Calling multiple
start()for the same block withcontent: pushon will do as expected - Fix undrying elements that are not included in the dom
- Call the
retainedmethod 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#valueproperty - Fix
HTMLElement#innerTextandHTMLElement#textContentproperties - Fix
data-attributes not being removed when changingdatasetproperty - Add
HTMLElement#childrenproperty & 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
HTMLElementinstances can now also be revived when they have ahawkejs_id - Use Protoblast's
Requestclass forScene#fetch&Scene#openUrl - Add
Element#enableFocusWithinEvent&Element#enableHtmlChangeEvent - Fix server-side HTMLElement
valueproperty implementation - Add
ViewRender#getBlockByName()andViewRender#active_block - Add
trimexpression, to trim away whitespace on left and/or right side - Make
printexpression smarter - Don't add the "result" html when json-ifying Placeholder instances
- If
version_infois available, add it as a GET parameter to stylesheet & template requests - Use
Blast.fetchfor getting the templates on the client-side - Make
Scene#serverResponse()work without an actual XHR instance - Add server-side
Element#insertAdjacentElement()and fixappendChildandinsertBeforefrom not adding the same element twice - Add server-side
Element#hiddenproperty support - Allow calling
CustomElement#setAssignedPropertywith only a function argument - The on-assigned-data method callbacks will no longer replace the value if it returns a thennable
- Fix
CustomElement#setAssignedPropertywith 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_urlevent when executingScene#openUrl() - Handle hawkejs-client script loading before the
_initHawkejsobject is present - Fix
Scene#disableStyle()to also work on Firefox - Make
Scene#serverResponse()callback with an error if response status >= 500
- Calling
CustomElement#setAttributemethod will now add itself as a constitutor - Add
Nodeclass, letElementinherit from it - Add
Element#queryTabbableElements hawkejs_initwill now emit with the revived variables,hawkejs_initingwill emit with the dried variables- Recursively perform
getContenton finished blocks & on HTMLElement childnodes - Fix
setAssignedPropertyreplacing the wrong value when a setter is given - Allow element with class
js-he-unlinkto prevent a customjs-he-linkfrom being fired when clicking on it - Allow disabling moving browser focus by passing
move_browser_focus: falsetoScene#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
nodeNameandtagNamein 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
RURLclass fromprotoblastversion 0.5.7
- Emit
hawkejs_sceneevent on the Blast object when the scene is being made - Emit
hawkejs_initevent 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_commonjsoption, which will wrap it in a function withHawkejs, Blastarguments JSON-drycan now directly undry an object, no need to stringify it first- You can add a
interceptOpenUrlmethod on theSceneclass to intercept open urls - Add client-side connection checking
- Add
use strictto all helpers - Add
module.exportsheaders to helpers automatically - Added
HTMLElement#hasAttributemethod - Added
HTMLElement#insertBeforemethod - Also wait for objects that have a
whenFinishedOrTimeoutmethod isVisiblefix:overflow: autoalso makes a view context- Custom elements are now stored in the
Hawkejs.Elementnamespace - Allow the use of custom default prefixes in custom elements, instead of "he"
- Helpers are now stored in the
Hawkejs.Helpernamespace - Prefer "partial" over "element", so added methods like 'ViewRender#print_partial'
- Make sure
registerRenderdoesn't fail when there is no url - Fix
Hawkejs.removeClassesandHawkejs.addClassesso it doesn't crash on a class_name with only whitespace - Use
decodeURIwhen using ax-history-urlas new url - Put every class under the
Hawkejsnamespace - 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#getSourcewill no longer cache template when debugging- Fix
Hawkejs#loadusingbrowserproperty instead ofclient - Add dataset polyfill for ancient browsers
- Fix
getFirstAvailableInternalSourceon the client not returning an object - Use
useragent#lookupfor faster parsing of useragents - The
Scene#generalViewproperty is created even before the document is ready - Custom elements now have a
hawkejs_viewproperty, so a ViewRender instance can always be accessed - Custom elements also have a
hawkejs_helpersproperty - Hawkejs block elements are now identified by the 'x-hawkejs' class instead of tag name
isVisibleshould 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#fetchandScene#openUrlwill no longer try to parse empty "json" responses. (This happened on Firefox, not on chrome)- Cookies will use the
secureflag 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-urlheader value will be encoded usingencodeURI- The
_initHawkejsjson variable will now escape "</script>" tags
- Creating a Helper instance without a view on the server side will no longer throw an error
Scene#serverResponsewill now callback with theViewRenderinstance- 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#fetchduringxhr#send stylecalls can now be full urls- Added
Scene#rendermethod, which applies the render results to the current scene (Hawkejs#renderwill only render them, without applying) - Make
js-he-forms use themethodattribute, instead oftype - The
getoption can now also be aFormDatainstance add_classcalls will now also work in blocks that have been turned into a dialog- Forms and links with
js-he-close-dialogas a CSS class will close the parent dialog after their successful request Scene#rendernow returns the created ViewRender instance- Fix:
ViewRender#beginRendernow 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
getContentandtoHawkejsString - Fix
Scene#scrollTonot working at all - Don't scroll to anything when an openUrl call results in a dialog being made.
- Add
ViewRender#showDialogwhich can add dialogs from the server side - Call
Scene#ajaxifyafter 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
doExtensionsmethod will now alsochangeMainblock 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_diversionandhtopfrom history urls - When using
Scene#scrollTowithout any parameters, just scroll to the top immediately - Add
Hawkejs#delayReadywhich is intended to be used in "onclick" attributes - Fix some isVisible handling
- Fix the
Helper#parseURLmethod - Add simple code to get rid of dialogs when using back button (needs rework)
- Added another attempt to fix scrollTo
- The default
scrollToduration can be overwritten by exposingdefault_scrollto_duration
- Add
Templates#nameproperty - Add
assignsproperty toViewRender#toJson() - Add
Hawkejs.removeClasses classNames set inassign()options will remain on the block,classNames set in astart()call will be removed when a newstart()is issuedquerySelectorAllresults don't have aforEachmethod in Edge, so fix that- Fix race condition in
Hawkejs#createClientFile - Fix
Hawkejs#requirenot honouring path property on the client side - Add dialog css as style element
- Bundle client-side template requests
- Added
add_classmethod to add CSS classnames to a Hawkejs element Element#reloadwill now render the correct theme of template- Elements with the
data-update-requestattribute 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
attachmentstoassigned_data CustomElement#attachis nowCustomElement#assignData- Added
CustomElement#emitto emit a custom browser event - Added
CustomElement#connectedCallbackfunctionality - Scene view helpers will be created before scripts are requested
Scene#appearsnow 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-locationwillopenUrlon change - Make
wheelandclicklisteners 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_commonjsset 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