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

Deprecation/Removal of parseBefore, parseAfter events #736

Closed
balupton opened this issue Dec 13, 2013 · 7 comments
Closed

Deprecation/Removal of parseBefore, parseAfter events #736

balupton opened this issue Dec 13, 2013 · 7 comments

Comments

@balupton
Copy link
Member

The parseBefore and parseAfter events have-been/will-be deprecated in DocPad v6.58.

This was necessary for the following reasons:

  1. We have-been/are moving away from a scheduled generation style, into a reactive generation style

  2. Issue contentRendered always null #734 required dynamic documents to go through the proper generation cycle, rather than just the render file cycle, in order to have access to the render events templateData amendments, which it previously had no way of accessing.

    Adding the dynamic documents directly to the generation queue meant that we had to adjust the way files are loaded, as we want to ensure dynamic documents, just like other documents, are always up to date with their source (file-system) data.

    To accomplish this, we removed the partial then complete loading that was there before, in order to load files completely as they are found and injected, rather than at scheduled cycles. This ensures that documents are always up to date, without needing to go through generation cycles in order to be so.

What this means, is that we have removed the parseBefore and parseAfter events, in favour of loading/parsing documents as we find them, rather than altogether in a generation queue.

This has affected the following plugins, of which updates have been released:

The following plugins still need adjustment:

  • None reported yet

If you were previously using the parseAfter or parseBefore events, we'd recommend reviewing the way they have been fixed with the aforementioned plugins, or posting a comment here and we'll figure out a migration path for your plugin.

@balupton
Copy link
Member Author

Changes pushed to the reactiveloading loading branch.

@greduan
Copy link
Contributor

greduan commented Dec 13, 2013

Guess I'm gonna have to learn how reactive design works eh? :)

@dimitarkolev
Copy link

Where we can find the updated plugins for reference. All our custom plugins depend on pasrse events so it will be a huge rewrite and i want to be prepared before the release of the version.

@dimitarkolev
Copy link

What about renderBefore and renderAfter event are they going to be deprecated as well?

@balupton
Copy link
Member Author

Thanks for the questions!

Will push up the new plugins Monday.

renderBefore, renderAfter, contextualizeBefore, contextualizeAfter, and the other events will remain.

As an immediate workaround, you should be able to just rename parseAfter, and parseBefore to contextualizeAfter and contextualizeBefore. However, you will be better off doing something like the updates in the plugins that will be pushed later on, as it will be more efficient and have a better chance at catching events for imported documents — something that already impacts the parse events.

balupton added a commit that referenced this issue Dec 16, 2013
- v6.58.0 December 16, 2013
	- Deprecated and removed the `parseBefore` and `parseAfter` events
		- Files are now parsed as they are loaded in, rather than only when
they reach the generation cycle
		- See [issue #736](#736) for
discussion and upgrade options
	- Dynamic documents now have access to templateData that plugins have
extended (regression since always)
		- Dynamic documents now go through the standard generation process
		- Thanks to [Steve McArthur](https://github.com/SteveMcArthur),
[Marcus Stong](https://github.com/stongo) for
[docpad/docpad-plugin-feedr#5](https://github.com/docpad/docpad-plugin-f
eedr/issues/5)
	- Documents that want to be rendered, but not written, are now
rendered (possible regression since v6.55.0)
		- Thanks to [pflannery](https://github.com/pflannery) for [issue
#734](#734)
	- Moved the missing layout error check from contextualize step to
render step, as the layout may not be there if we are still loading
documents
@balupton
Copy link
Member Author

Release has been done. Plugins have been published. See the original post in this thread for links to the diffs.

balupton added a commit to docpad-archive/documentation that referenced this issue Dec 16, 2013
@dimitarkolev
Copy link

10x looks great. I have a question about live collections. Is there a place where we can find some more documentation and/or examples?

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

No branches or pull requests

3 participants