Skip to content

proposal: refactor $.getJSON examples to use fetch #570

Closed

Description

Converting code examples for Octane has refreshed a discussion about using jQuery in trivial code examples. I think we should refactor code examples that feel dated due to using $.getJSON. See #33 for my prior hang ups. Tangential to #499.

current usage in release guides

why use window.fetch?

I propose we use window.fetch for at least 3 reasons:

  1. it is widely supported by modern browsers.
  2. In a land of jQuery free Ember applications, why should we promote depending on the entire jQuery library for a single function?
  3. Easier teaching and mental model. By aligning with a web standard, we leverage existing teaching and developer experience. For new developers it gives them a helpful tool that could be considered a best practice in web development. Fetch's Promise based design flows nicely with concepts taught throughout the Ember guides and modern asynchronous web programming.

Activity

  1. acorncom commented on Mar 28, 2019

    @acorncom
    Member

    @efx I like the idea here. Given that the browser matrix for Ember still includes IE 11, it seems like it would be best to be suggesting using https://github.com/ember-cli/ember-fetch so we don't deliberately steer folks toward something that could cause them headaches in production. Thoughts?

  2. added
    help wanted
    time-sensitive
    on May 31, 2019
  3. pinned this issue on May 31, 2019
  4. unpinned this issue on Jun 18, 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

    Labels

    help wantedtime-sensitive

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions