You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 22, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 22, 2024. It is now read-only.
If a server rendered page has multiple root elements (i.e. multiple apps), then preboot won't work. It just works with one app. This is for particular use that mostly involves pre-rendering. To accomplish this, most of the logic will be on the server side preboot library to generate client side preboot code for each root element.
The key is that you can't increase the size of the generated client side
preboot?
You mean that we do not want to generate the same preboot code for all the
toplevel components?
So, the client side preboot code is generated by the server side preboot library based on the input options. Most of the time the defaults are used. These options determine the size of the resulting client side preboot code since we use browserify (currently) to remove code that we know won't be used. So, my point is that the ability to deal with multiple root elements is a minority use case. We should support it but it would be an option passed into the server side preboot library (or perhaps just something if an array of appRoot elements are passed in). So, my point is that we would need to figure out a way to implement this when the user specifies multiple root components BUT if the user does not then we just need to make sure there is not any unnecessary code generated that is only really used to support the multiple root use case.
How about this: forget what I just said and first think of how you would modify the current preboot code to support multiple appRoot elements (look at how the options are passed in to getBrowserCode()). Then we can discuss how to implement your design in such a way that doesn't adversely affect the generated code size.
Activity
JohnGorter commentedon Feb 11, 2016
Something 4 me to work on?
jeffwhelpley commentedon Feb 11, 2016
That would be awesome. The key is that you can't increase the size of the generated client side preboot.
JohnGorter commentedon Feb 11, 2016
The key is that you can't increase the size of the generated client side
preboot?
You mean that we do not want to generate the same preboot code for all the
toplevel components?
John.
On Thu, Feb 11, 2016 at 1:05 PM, Jeff Whelpley notifications@github.com
wrote:
jeffwhelpley commentedon Feb 11, 2016
So, the client side preboot code is generated by the server side preboot library based on the input options. Most of the time the defaults are used. These options determine the size of the resulting client side preboot code since we use browserify (currently) to remove code that we know won't be used. So, my point is that the ability to deal with multiple root elements is a minority use case. We should support it but it would be an option passed into the server side preboot library (or perhaps just something if an array of appRoot elements are passed in). So, my point is that we would need to figure out a way to implement this when the user specifies multiple root components BUT if the user does not then we just need to make sure there is not any unnecessary code generated that is only really used to support the multiple root use case.
How about this: forget what I just said and first think of how you would modify the current preboot code to support multiple appRoot elements (look at how the options are passed in to getBrowserCode()). Then we can discuss how to implement your design in such a way that doesn't adversely affect the generated code size.
PatrickJS commentedon Mar 4, 2016
multiple ng2 server rendering works so ling as preboot can take an array for
appRootPatrickJS commentedon Mar 4, 2016
closing for 9541a9b...d5e34c1 open again if preboot doesn't support arrays for
appRootyazeedb commentedon Nov 8, 2016
@gdi2290 Could you point me to any resources indicating how to set up a Universal project with multiple app roots?
angular-automatic-lock-bot commentedon Sep 4, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.