Skip to content

Event dispatcher - #18316

Merged
DeepDiver1975 merged 2 commits into
masterfrom
event-dispatcher
Aug 14, 2015
Merged

DeepDiver1975 merged 2 commits into
masterfrom
event-dispatcher

Conversation

@DeepDiver1975

Copy link
Copy Markdown
Contributor

@DeepDiver1975 DeepDiver1975 added this to the 8.2-current milestone Aug 14, 2015
@PVince81

Copy link
Copy Markdown
Contributor

Looks nice.

We have a few other places in core where we'd need that.

By the way: in what way would this affect the assets pipeline ? Would there be two JS bundles one with the extra scripts and one without ?

@PVince81

Copy link
Copy Markdown
Contributor

We could actually dispatch a similar event after "app.php" of any app has run. Not sure about the performance though if we do it for each app in every request...

@DeepDiver1975

Copy link
Copy Markdown
Contributor Author

By the way: in what way would this affect the assets pipeline ? Would there be two JS bundles one with the extra scripts and one without ?

Not at all from my understanding - all scripts/styles will be summed up during rendering of the template. And the version hash of the assembled files will change based on the files included.

@RobinMcCorkell

Copy link
Copy Markdown
Contributor

Death to the hooks! I like this 😄

Comment thread apps/files/index.php Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm guessing this is example code and isn't actually supposed to be run? Otherwise it seems odd the dispatch call is above

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't get it. In this case the dispatch happens before the registration of the listeners. So the listener isn't called. Or am I totally wrong and missunderstood the EventDispatcher?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@MorrisJobke this block is supposed to be in the activity app's appinfo/app.php.
@DeepDiver1975 has added it only to show an example. That must be removed before merging.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I guess this will completely mess up once the apps are not loaded in the correct order.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

sure - this will go into the activity app

@DeepDiver1975

Copy link
Copy Markdown
Contributor Author

We could actually dispatch a similar event after "app.php" of any app has run. Not sure about the performance though if we do it for each app in every request...

We have to do this slightly different

  1. load all apps
  2. emit the app-loaded hook for all of them

Otherwise an app being loaded later cannot react on a loaded event of a previous app

@PVince81

Copy link
Copy Markdown
Contributor

Anyway, I'm fine with the current approach for now.
Then we can adapt all files_* apps to load their scripts in that handler instead of app.php.

@RobinMcCorkell

Copy link
Copy Markdown
Contributor

👍

2 similar comments
@BernhardPosselt

Copy link
Copy Markdown
Contributor

👍

@PVince81

Copy link
Copy Markdown
Contributor

👍

@DeepDiver1975

Copy link
Copy Markdown
Contributor Author

Let me squash the last two commits later before merge ...

@PVince81

Copy link
Copy Markdown
Contributor

@DeepDiver1975 time to squash

@PVince81

Copy link
Copy Markdown
Contributor

Please fix the commit text

@scrutinizer-notifier

Copy link
Copy Markdown

A new inspection was created.

@PVince81

Copy link
Copy Markdown
Contributor

👍

@DeepDiver1975

Copy link
Copy Markdown
Contributor Author

@owncloud-bot 👽

@ghost

ghost commented Aug 14, 2015

Copy link
Copy Markdown

🚀 Test PASSed.🚀
chuck

@MorrisJobke

Copy link
Copy Markdown
Contributor

@owncloud-bot retest this please

@ghost

ghost commented Aug 14, 2015

Copy link
Copy Markdown

🚀 Test PASSed.🚀
chuck

DeepDiver1975 added a commit that referenced this pull request Aug 14, 2015
@DeepDiver1975
DeepDiver1975 merged commit 72f829e into master Aug 14, 2015
@DeepDiver1975
DeepDiver1975 deleted the event-dispatcher branch August 14, 2015 17:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants