Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue/2760 Added ChildViews API for rendering control (v5.7.0) #2761

Merged
merged 76 commits into from
Aug 21, 2020

Conversation

olivermartinfoster
Copy link
Contributor

@olivermartinfoster olivermartinfoster commented May 9, 2020

#2760

Changed

  • async Adapt.navigateToElement Made async, resolves when navigation is finished
  • async Adapt.scrollTo Made async, resolves when scroll/navigation is finished
  • AdaptView.childViews from an indexed hash into a flat array with deprecated warnings
  • Adapt.remove now resets _isReady and _isRendered
  • AdaptModel.checkReadyStatus now returns true/false and checks _isRendered and _isReady
  • PageView.preRender now executes new AdaptModel.checkIfResetOnRevisit on descendants before rendering them
  • async AdaptView.addChildren now renders first-child-first rather than parent-first, resolves asynchronously when all possible children have been added, triggers a view:addChild(ChildEvent) event before rendering a model to see if plugins want to stop the render. It triggers a view:requestChild(ChildEvent) if model has _canRequestChild: true when it is at the end of the list of children to see if plugins wish to add any more. If addChildren is called more than once it will now continue rendering from where it was last stopped making await Adapt.parentView.addChildren(); await Adapt.parentView.whenReady(); the easiest way to continue adding children and to wait until they are rendered and ready.
  • Added default animation time of 400ms to router Adapt.navigateToElement when routing to a sub contentobject id

Added

  • ChildEvent object to control rendering
  • AdaptModel.checkIfResetOnRevisit as this is a view only function at the moment
  • AdaptModel._canRequestChild to control if AdaptView.addChildren can request more children from plugins
  • AdaptModel._isRendered to indicate when a model has been rendered
  • AdaptView.addChildView(AdaptView) triggers view:childAdded(parentView, childView)
  • AdaptView.getChildViews()
  • AdaptView.setChildViews([AdaptView])
  • async AdaptView.addDescendants() runs addChildren on existing child views
  • async AdaptView.whenReady() to resolve when all of the views are ready
  • AdaptView._getAddChildEvent(model) to trigger view:addChild and view:requestChild events and return ChildEvent control object on behalf of AdaptView.addChildren
  • await ContentObjectView.renderTo(id) to have a content object force render to the specified id, resolves when the views are ready

oliverfoster and others added 30 commits March 31, 2020 17:03
Co-Authored-By: tomgreenfield <tomgreenfield@users.noreply.github.com>
Co-Authored-By: tomgreenfield <tomgreenfield@users.noreply.github.com>
Co-Authored-By: tomgreenfield <tomgreenfield@users.noreply.github.com>
Co-Authored-By: tomgreenfield <tomgreenfield@users.noreply.github.com>
Co-Authored-By: tomgreenfield <tomgreenfield@users.noreply.github.com>
@oliverfoster oliverfoster changed the base branch from release/v5.5.0 to release/v5.6.0 May 12, 2020 10:21
@oliverfoster oliverfoster changed the title issue/2760 Added ChildViews API for rendering control (v5.5.0) issue/2760 Added ChildViews API for rendering control (v5.6.0) May 12, 2020
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

@oliverfoster oliverfoster changed the title issue/2760 Added ChildViews API for rendering control (v5.6.0) issue/2760 Added ChildViews API for rendering control (v5.7.0) Jun 17, 2020
Copy link
Contributor

@moloko moloko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code 👓 one minor thing, otherwise looks good

src/core/js/adapt.js Outdated Show resolved Hide resolved
@moloko
Copy link
Contributor

moloko commented Jul 7, 2020

this PR should probably be changed to merge into master rather than release/v5.6.0 I think? either that or the release/v5.6.0 branch just needs renaming

@oliverfoster oliverfoster changed the base branch from release/v5.6.0 to master July 7, 2020 17:47
@moloko
Copy link
Contributor

moloko commented Jul 20, 2020

@olivermartinfoster conflict needs resolving...

Copy link

@lc-alexanderbenesch lc-alexanderbenesch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

adapt_framework v5.7.0: Add ChildViews API for rendering control
5 participants