-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
ember-engine + ember-page-title fails #112
Comments
Hi, could you provide a reproducible test for this, either in repository form or ember twiddle form so I can help with this? |
This is related to ember-fastboot/ember-cli-head#23. |
Latest version doesn't give the error above, but it also still doesn't work. Fails silently it seems. |
Okay so instructions on getting this working on 4.0.0 with an engine.
"dependencies": {
"ember-cli-htmlbars": "*",
"ember-cli-babel": "*",
"ember-page-title": "*"
},
const Eng = Engine.extend({
modulePrefix,
Resolver,
dependencies: {
services: [
'headData',
],
},
});
const App = Ember.Application.extend({
modulePrefix: config.modulePrefix,
Resolver,
engines: {
account: {
dependencies: {
services: [
'headData',
],
},
},
},
...
<title>{{model.title}}</title> |
What I posted doesn't fully work. It works on fresh loads on any page. But only for the initial engine/app. So if you load an app route it works there only, all engines it won't. Or if you load into an engine then it doesn't work in app or any other engine. |
😭 |
Engines are just a mess anyway. |
This worked for me:
|
I did this change but I still have the issue of going in or out of an engine it doesn't work. What happens is the first loaded part (if app or engine) gets the page titles working but if you go to anything else it stops (going back works in the original area). |
Could someone create an engine test PR so we can work on getting this resolved? |
I refactored away from engines and life has been easier, so this issue doesn't concern me anymore and I don't suggest anyone use engines at all. I'm gonna unwatch this. |
This is still an issue for me, since I have quite a big web app that I had to split with engines. Just to let you know. I'll try and look into the code when I have time. |
@danidr we have a very big app, and using engines was a very bad decision (by me). Most problems they solve are being solved in other ways with ember octane. And it barely has development on them. I'm confident you will continue to run into other issues are ember updates happen etc if you use engines (in-repo ones anyway, the out of repo ones that are more standalone I think are still mostly okay). |
@robclancy Sure, my comment was not directed towards you; let's say that besides some little things that needed to be worked around, engines are working fine for me, and as far as I understand, this is the way Ember is going for asynchronous loading of components/routes. |
Nope or engines would have been improved a lot more by now if they were using it as the solution to how big the app can get. Code splitting is what will be used here https://www.emberjs.com/statusboard/ Then organizing code will be improved with module unification (other reason I used engines at first). |
@robclancy Very interesting read, thanks. Well, each part has its role there. Please notice that
in that same article you have posted. |
Yes and after using it for 11 engines and seeing all the problems in discord over and over I don't think they should be recommended at all. I actually think it should be deprecated. |
I've managed to make ember-page-title works with [email protected], following these steps:
|
Would be awesome to get a pr for the readme @nightire |
With v6, should no longer need the head-data service, since we no longer use ember-cli-head. |
As @knownasilya mentioned, with v6 only "page-title-list" service is required. However we can definitely improve documentation for Ember Engine setup. |
@raido, what does the modified config look like for the engine addon? Can you provide a sample? For |
I'll try to test this out and come up with documentation PR. |
AFAICT the only steps needed are:
Step 2 might be a little weird as I don't think we consider the We could also link to the |
I'm running Ember 3.28 and ember-engines 0.9.0 (latest version of engines available), and I have noticed that the page title in an engine seems to display properly when the app loaded on a specific URL, but if you browse in the engine to another route the page title is reset to the Ember default -- if you reload again on this new engine route the proper title will then display. I'm just using Is this a known issue? |
Stack trace
The text was updated successfully, but these errors were encountered: