It's React, but in Python
MIT License
Bot releases are visible (Hide)
Published by rmorshea about 3 years ago
Contains a small number of bug fixes and improvements. The most significant change is the addition of a warning stating that IDOM_FEATURE_INDEX_AS_DEFAULT_KEY=1
will become the default in a future release. Beyond that, a lesser improvement makes it possible to use the default export from a Javascript module when calling module_from_template
by specifying exports_default=True
as a parameter.
Closed Issues
Pull Requests
Published by rmorshea about 3 years ago
A release to fix a memory leak caused by event handlers that were not being removed
when components updated.
Closed Issues
Published by rmorshea about 3 years ago
A hot fix for a regression introduced in 0.33.0
where the root element of the layout could not be updated. See #498 for more info. A regression test for this will be introduced in a future release.
Pull Requests
Published by rmorshea about 3 years ago
The most significant fix in this release is for a regression which manifested in #480, #489, and #451 which resulted from an issue in the way JSON patches were being applied client-side. This was ultimately resolved by #490. While it's difficult to test this without a more thorough Javascript suite, we added a test that should hopefully catch this in the future by proxy.
The most important breaking change, is yet another which modifies the Custom Javascript Component interface. We now add a create()
function to the bind()
interface that allows IDOM's client to recursively create components from that (and only that) import source. Prior to this, the interface was given unrendered models for child elements. The imported module was then responsible for rendering them. This placed a large burden on the author to understand how to handle these unrendered child models. In addition, in the React template used by module_from_template
we needed to import a version of idom-client-react
from the CDN - this had already caused some issues where the template required a version of idom-client-react
in the which had not been released
yet.
Closed Issues
__error__
tag can leak secrets - #454
Pull Requests
Published by rmorshea about 3 years ago
In addition to a variety of bug fixes and other minor improvements, there's a breaking change to the custom component interface - instead of exporting multiple functions that render custom components, we simply expect a single bind()
function. binding function then must return an object with a render()
and unmount()
function. This change was made in order to better support the rendering of child models.
Closed Issues
Pull Requests
Published by rmorshea over 3 years ago
The Layout
is now a prototype, and Layout.update
is no longer a public API. This is combined with a much more significant refactor of
the underlying rendering logic.
The biggest issue that has been resolved relates to the relationship between LifeCycleHook
and Layout
. Previously, the LifeCycleHook
accepted a layout instance in its constructor and called Layout.update
. Additionally, the Layout
would manipulate the LifeCycleHook.component
attribute whenever the component instance changed after a render. The former behavior leads to a non-linear code path that's a touch to follow. The latter behavior is the most egregious design issue since there's absolutely no local indication that the component instance can be swapped out (not even a comment).
The new refactor no longer binds component or layout instances to a LifeCycleHook
. Instead, the hook simply receives an unparametrized callback that can be triggered to schedule a render. While some error logs lose clarity (since we can't say what component caused them). This change precludes a need for the layout to ever mutate the hook.
To accomodate this change, the internal representation of the layout's state had to change. Previsouly, a class-based approach was take, where methods of the state-holding classes were meant to handle all use cases. Now we rely much more heavily on very simple (and mostly static) data structures that have purpose built constructor functions that much more narrowly address each use case.
After these refactors, ComponentTypes
no longer needs a unique id
attribute. Instead, a unique ID is generated internally which is associated with the LifeCycleState
, not component instances since they are inherently transient.
Published by rmorshea over 3 years ago
Removes the usage of the id()
function for generating unique ideas because there were situations where the IDs bound to the lifetime of an object are problematic. Also adds a warning Deprecation
warning to render functions that include the parameter key
. It's been decided that allowing key
to be used in this way can lead to confusing bugs.
Published by rmorshea over 3 years ago
With recent changes to the custom component interface, it's now possible to remove all runtime reliance on NPM. Doing so has many virtuous knock-on effects:
loadImportSource()
function that looks for route serving the contents of IDOM_WEB_MODULES_DIR.
This change includes large breaking changes:
idom.client
is being removed in favor of a stripped down idom.web
moduleIDOM_CLIENT_BUILD_DIR
config option will no longer exist and a new IDOM_WEB_MODULES_DIR
which only contains dynamically linked web modules. While this new directory's location is configurable, it is meant to be transient and should not be re-used across sessions.The new idom.web
module takes a simpler approach to constructing import sources and expands upon the logic for resolving imports by allowing exports from URLs to be discovered too. Now, that IDOM isn't using NPM to dynamically install component libraries idom.web
instead creates JS modules from template files and links them into IDOM_WEB_MODULES_DIR
. These templates ultimately direct the browser to load the desired library from a CDN.
Published by rmorshea over 3 years ago
Contains breaking changes, the most significant of which are:
createElement
, render
, unmountComponentAtNode
functions from React.Issues Fixed:
Highlighted Commits:
Published by rmorshea over 3 years ago
Includes a wide variety of improvements:
currentTime
attr of audio/video elementsfiles
attribute from the target of input elementsmount()
functionmountLayoutWithWebSocket
function to idom-client-react
and breaking changes, the most significant of which are:
package.json
.loadImportSource()
function instead of trying to infer the path to dynamic modules which was brittle and inflexible. Allowing the specific client implementation to discover where "import sources" are located means idom-client-react
doesn't need to try and devise a solution that will work for all cases. The fallout from this change is the addition of importSource.sourceType
which, for the moment can either be "NAME"
or "URL"
where the former indicates the client is expected to know where to find a module of that name, and the latter should (usually) be passed on to import()
Published by rmorshea over 3 years ago
Introduces changes to the interface for custom Javascript components. This now allows JS modules to export a mount(element, component, props)
function which can be used to bind new elements to the DOM instead of using the application's own React instance and specifying React as a peer dependency. This avoids a wide variety of potential issues with implementing custom components and opens up the possiblity for a wider variety of component implementations.
Published by rmorshea over 3 years ago
A collection of minor fixes and changes that, as a whole, add up to something requiring a minor release. The most significant addition is a fix for situations where a Layout
can raise an error when a component whose state has been delete is rendered. This occurs when element has been unmounted, but a latent event tells the layout it should be updated. For example, when a user clicks a button rapidly, and the resulting update deletes the original button.
Published by rmorshea over 3 years ago
Completely refactors layout dispatchers by switching from a class-based approach to one that leverages pure functions. While the logic itself isn't any simpler, it was easier to implement, and now hopefully understand, correctly. This conversion was motivated by several bugs that had cropped up related to improper usage of anyio
.
Issues Fixed:
Highlighted Commits:
Published by rmorshea over 3 years ago
This release contains an update that allows components and elements to have “identity”. That is, their state can be preserved across updates. Before this point, only the state for the component at the root of an update was preserved. Now though, the state for any component and element with a key that is unique amongst its siblings, will be preserved so long as this is also true for parent elements/components within the scope of the current update. Thus, only when the key of the element or component changes will its state do the same.
In a future update, the default key for all elements and components will be its index with respect to its siblings in the layout. The IDOM_FEATURE_INDEX_AS_DEFAULT_KEY
feature flag has been introduced to allow users to enable this behavior early.
Published by rmorshea over 3 years ago
Published by rmorshea over 3 years ago
Published by rmorshea over 3 years ago
Commits on Mar 02, 2021
Commits on Mar 03, 2021
Published by rmorshea over 3 years ago
Commits on Feb 26, 2021
Published by rmorshea over 3 years ago
Prior to this fix a random available port was used to run servers from by default. This does not provide a great dev experience since you cannot simply refresh a page after restarting a server.
Published by rmorshea over 3 years ago
Various minor tweaks to get things working on Windows.
Unfortunately CI is still now running the full test suite for windows though. The web-driver doesn't seem to work correctly. See #289