Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

make preboot work with multiple apps #259

Closed

Description

@jeffwhelpley

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.

Activity

  1. JohnGorter commented on Feb 11, 2016

    @JohnGorter
    Contributor

    Something 4 me to work on?

  2. jeffwhelpley commented on Feb 11, 2016

    @jeffwhelpley
    ContributorAuthor

    That would be awesome. The key is that you can't increase the size of the generated client side preboot.

  3. JohnGorter commented on Feb 11, 2016

    @JohnGorter
    Contributor

    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:

    That would be awesome. The key is that you can't increase the size of the
    generated client side preboot.

    —
    Reply to this email directly or view it on GitHub
    #259 (comment).

  4. jeffwhelpley commented on Feb 11, 2016

    @jeffwhelpley
    ContributorAuthor

    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.

  5. PatrickJS commented on Mar 4, 2016

    @PatrickJS
    Contributor

    multiple ng2 server rendering works so ling as preboot can take an array for appRoot

  6. PatrickJS commented on Mar 4, 2016

    @PatrickJS
    Contributor

    closing for 9541a9b...d5e34c1 open again if preboot doesn't support arrays for appRoot

  7. yazeedb commented on Nov 8, 2016

    @yazeedb
    Contributor

    @gdi2290 Could you point me to any resources indicating how to set up a Universal project with multiple app roots?

  8. angular-automatic-lock-bot commented on Sep 4, 2019

    @angular-automatic-lock-bot

    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.

  9. locked and limited conversation to collaborators on Sep 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions