Skip to content

Defer loading Babel until it is needed #2

Closed

Description

@bvaughn

We currently load Babel via CDN (which is nice) but we load it in the <head> of the page (which is not so nice). We should only load it on pages that actually use it (eg pages that use the CodeEditor).

Check out the Babel website's REPL for an example of similar deferred loading.

Activity

  1. renanpvaz commented on Oct 6, 2017

    @renanpvaz
    Contributor

    Is it necessary to use a worker or could it be achieved through XHR + eval?

  2. bvaughn commented on Oct 6, 2017

    @bvaughn
    ContributorAuthor

    Worker is totally not necessary (but a nice touch). I built a non-worker based version for Babel REPL initially. (It's there in the Git history if you're curious.)

  3. renanpvaz commented on Oct 6, 2017

    @renanpvaz
    Contributor

    Okay, I'll look into it and then attempt to fix the issue.

  4. bvaughn commented on Oct 6, 2017

    @bvaughn
    ContributorAuthor

    Okay. I've tagged this as "in-progress" then. Please let me know if you decide not to submit a PR and I'll remove that label so someone else can claim the task.

  5. renanpvaz commented on Oct 9, 2017

    @renanpvaz
    Contributor

    @bvaughn should docsearch be loaded the same way?

  6. bvaughn commented on Oct 9, 2017

    @bvaughn
    ContributorAuthor

    Could be pretty cool to just-in-time load Algolia too, yeah. 😄

    I plan to remove it in favor of a client-side search solution like js-worker-search at some point in the future so I hadn't considered it much. That being said, it might take me a long time to get to that so...

  7. bvaughn commented on Oct 9, 2017

    @bvaughn
    ContributorAuthor

    Check out issue #98 for my thoughts on that if you're interested

  8. added a commit that references this issue on Jan 12, 2018
  9. added a commit that references this issue on Mar 6, 2018
  10. added a commit that references this issue on May 23, 2026
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