├── .gitignore
├── teams
├── cli.md
├── data.md
├── learning.md
├── steering.md
├── framework.md
└── typescript.md
├── stages
├── closed.md
├── accepted.md
├── exploring.md
├── proposed.md
├── released.md
├── recommended.md
├── discontinued.md
└── ready-for-release.md
├── images
├── npm_test.png
├── website_1.png
├── ember_test.png
├── survey_results.png
├── 457-dasherization.jpg
├── website_4-button_ui.png
├── website_6_nav_alt.png
├── website_7_pointer.png
├── 457-autocomplete-problem.gif
├── 457-when-to-use-curlies.jpg
├── EmberJS_Homepage_Outline.pdf
├── survey_results_analysis.pdf
├── website_3_url_examples.png
├── website_5_scrolled_nav.png
└── website_2_header_dropdown.png
├── .github
├── doc-assets
│ └── advance-rfc.png
├── workflows
│ ├── ci.yml
│ ├── generate-rfc-frontmatter-json.yml
│ ├── label-opened-new-rfc-prs.yml
│ ├── trigger-opening-advancement-pr.yml
│ └── advance-rfc.yml
├── actions
│ ├── setup-rfcs-tooling
│ │ └── action.yml
│ └── find-added-or-modified-rfcs
│ │ └── action.yml
├── PULL_REQUEST_TEMPLATE
│ ├── advance-to-released.md
│ ├── advance-to-ready-for-release.md
│ └── advance-to-recommended.md
└── pull_request_template.md
├── CODE_OF_CONDUCT.md
├── text
├── 0889-deprecate-ember-error.md
├── 0092-blueprint-remove-old-files.md
├── 0114-add-template-lint-addon.md
├── 0194-deprecate-custom-event-manager.md
├── 1117-deprecate-classic-classes.md
├── 1114-deprecate-ember-array.md
├── 0020-sri-default.md
├── 1116-deprecate-mixins.md
├── 0743-ember-data-deprecate-legacy-imports.md
├── 0690-deprecate-attrs-in-templates.md
├── 0011-improved-cp-syntax.md
├── 0029-addon-black-and-whitelist-for-apps.md
├── 1112-deprecate-proxy.md
├── 0750-deprecate-ember-assign.md
├── 0794-ember-data-schema-definition-service-simplify.md
├── 0742-ember-data-deprecate-helper-functions.md
├── 0237-deprecation-ember-map.md
├── 0105-addons-optionalDependencies.md
├── 0318-array-helper.md
├── 0999-make-hash-built-in.md
├── 1000-make-array-built-in.md
├── 0324-deprecate-component-isvisible.md
├── 0136-contains-to-includes.md
├── 0421-deprecate-application-controller-props.md
├── 0918-deprecate-travis-ci-support.md
├── 0121-remove-ember-cli-eslint.md
├── 0738-ember-data-deprecate-model-reopen.md
├── 0631-refresh-method-for-router-service.md
├── 0086-firefox-in-ci.md
├── 0181-deprecate-ember-data-initializers.md
├── 1055-vanilla-prettier-setup-in-blueprints.md
├── 0340-deprecate-ember-merge.md
├── 0326-ember-data-filter-deprecation.md
├── 0096-enable-yarn-usage.md
├── 0186-track-unique-history-location-state.md
├── 0741-ember-data-deprecate-model-static-field-access-without-lookup.md
├── 0012-help-json-output.md
├── 0101-ember-data-friendly-errors.md
├── 0752-inject-service.md
├── 0801-deprecate-blacklist-and-whitelist-build-options.md
├── 0050-cli-production-code-stripping.md
├── 0003-cli-ember-doctor.md
├── 0706-deprecate-ember-global.md
├── 0028-app-import-output-file.md
├── 0790-deprecate-ember-data-ajax.md
├── 1026-ember-data-deprecate-store-extends-ember-object.md
├── 0001-transform-attribute-meta-parameter.md
├── 0091-weakmap.md
├── 0272-deprecation-native-function-prototype-extensions.md
├── 0491-deprecate-disconnect-outlet.md
├── 0329-deprecated-ember-evented-in-ember-data.md
├── 0463-record-data-state.md
├── 0139-isHtmlSafe.md
├── 0702-eslint-plugin-qunit.md
├── 0645-add-ember-page-title-addon.md
├── 0796-ember-data-deprecate-rsvp.md
├── 0392-deprecate-component-manager-string-lookup.md
├── 0449-deprecate-partials.md
├── 0521-find-by-identifier.md
├── 0639-replace-blacklist-whitelist.md
├── 0522-default-serializers-and-adapters.md
└── 0003-block-params.md
├── deprecation-template.md
└── 0000-template.md
/.gitignore:
--------------------------------------------------------------------------------
1 | book/
2 | src/
3 |
--------------------------------------------------------------------------------
/teams/cli.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: CLI
3 | ---
4 |
--------------------------------------------------------------------------------
/teams/data.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Data
3 | ---
4 |
--------------------------------------------------------------------------------
/teams/learning.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Learning
3 | ---
4 |
--------------------------------------------------------------------------------
/teams/steering.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Steering
3 | ---
4 |
--------------------------------------------------------------------------------
/teams/framework.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Framework
3 | ---
4 |
--------------------------------------------------------------------------------
/teams/typescript.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: TypeScript
3 | ---
4 |
--------------------------------------------------------------------------------
/stages/closed.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Closed
3 | order: 10
4 | ---
5 |
--------------------------------------------------------------------------------
/stages/accepted.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Accepted
3 | order: 5
4 | ---
5 |
--------------------------------------------------------------------------------
/stages/exploring.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Exploring
3 | order: 1
4 | ---
5 |
--------------------------------------------------------------------------------
/stages/proposed.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Proposed
3 | order: 0
4 | ---
5 |
--------------------------------------------------------------------------------
/stages/released.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Released
3 | order: 7
4 | ---
5 |
--------------------------------------------------------------------------------
/stages/recommended.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Recommended
3 | order: 8
4 | ---
5 |
--------------------------------------------------------------------------------
/stages/discontinued.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Discontinued
3 | order: 11
4 | ---
5 |
--------------------------------------------------------------------------------
/images/npm_test.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emberjs/rfcs/HEAD/images/npm_test.png
--------------------------------------------------------------------------------
/images/website_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emberjs/rfcs/HEAD/images/website_1.png
--------------------------------------------------------------------------------
/stages/ready-for-release.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Ready For Release
3 | order: 6
4 | ---
5 |
--------------------------------------------------------------------------------
/images/ember_test.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emberjs/rfcs/HEAD/images/ember_test.png
--------------------------------------------------------------------------------
/images/survey_results.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emberjs/rfcs/HEAD/images/survey_results.png
--------------------------------------------------------------------------------
/images/457-dasherization.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emberjs/rfcs/HEAD/images/457-dasherization.jpg
--------------------------------------------------------------------------------
/images/website_4-button_ui.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emberjs/rfcs/HEAD/images/website_4-button_ui.png
--------------------------------------------------------------------------------
/images/website_6_nav_alt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emberjs/rfcs/HEAD/images/website_6_nav_alt.png
--------------------------------------------------------------------------------
/images/website_7_pointer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emberjs/rfcs/HEAD/images/website_7_pointer.png
--------------------------------------------------------------------------------
/.github/doc-assets/advance-rfc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emberjs/rfcs/HEAD/.github/doc-assets/advance-rfc.png
--------------------------------------------------------------------------------
/images/457-autocomplete-problem.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emberjs/rfcs/HEAD/images/457-autocomplete-problem.gif
--------------------------------------------------------------------------------
/images/457-when-to-use-curlies.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emberjs/rfcs/HEAD/images/457-when-to-use-curlies.jpg
--------------------------------------------------------------------------------
/images/EmberJS_Homepage_Outline.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emberjs/rfcs/HEAD/images/EmberJS_Homepage_Outline.pdf
--------------------------------------------------------------------------------
/images/survey_results_analysis.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emberjs/rfcs/HEAD/images/survey_results_analysis.pdf
--------------------------------------------------------------------------------
/images/website_3_url_examples.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emberjs/rfcs/HEAD/images/website_3_url_examples.png
--------------------------------------------------------------------------------
/images/website_5_scrolled_nav.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emberjs/rfcs/HEAD/images/website_5_scrolled_nav.png
--------------------------------------------------------------------------------
/images/website_2_header_dropdown.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emberjs/rfcs/HEAD/images/website_2_header_dropdown.png
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | The Ember team and community are committed to everyone having a safe and inclusive experience.
2 |
3 | **Our Community Guidelines / Code of Conduct can be found here**:
4 |
5 | http://emberjs.com/guidelines/
6 |
7 | For a history of updates, see the page history here:
8 |
9 | https://github.com/emberjs/website/commits/master/source/guidelines.html.erb
10 |
--------------------------------------------------------------------------------
/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | name: CI
2 |
3 | on:
4 | push:
5 | branches: [master, main]
6 | pull_request: {}
7 |
8 | jobs:
9 | lint-frontmatter:
10 | runs-on: ubuntu-latest
11 | steps:
12 | - uses: actions/checkout@v3
13 |
14 | - name: Setup RFCs tooling
15 | uses: ./.github/actions/setup-rfcs-tooling
16 |
17 | - name: Lint the frontmatter of all RFCs
18 | run: node ./rfcs-tooling/scripts/lint-rfc-frontmatter.mjs text/*.md
19 |
--------------------------------------------------------------------------------
/.github/actions/setup-rfcs-tooling/action.yml:
--------------------------------------------------------------------------------
1 | name: Setup RFCs Tooling
2 | description: 'Setup RFCs Tooling'
3 |
4 | runs:
5 | using: "composite"
6 | steps:
7 | - name: Checkout tools repo
8 | uses: actions/checkout@v3
9 | with:
10 | repository: emberjs/rfcs-tooling
11 | path: rfcs-tooling
12 | ref: 'v3.0.0'
13 |
14 | - uses: actions/setup-node@v3
15 | with:
16 | node-version: 16
17 |
18 | - run: yarn install
19 | shell: bash
20 | working-directory: rfcs-tooling
21 |
--------------------------------------------------------------------------------
/.github/workflows/generate-rfc-frontmatter-json.yml:
--------------------------------------------------------------------------------
1 | name: Generate a JSON file of all frontmatter
2 |
3 | on:
4 | push:
5 | branches: [ main, master ]
6 | paths:
7 | - 'text/*.md'
8 |
9 | jobs:
10 | generate-rfc-frontmatter-data-artifact:
11 | name: 'Generate a JSON file of RFC status'
12 | runs-on: ubuntu-latest
13 | steps:
14 | - uses: actions/checkout@v3
15 |
16 | - name: Setup RFCs tooling
17 | uses: ./.github/actions/setup-rfcs-tooling
18 |
19 | - name: Generate frontmatter data file
20 | run: |
21 | node rfcs-tooling/scripts/list-frontmatter.mjs text/*.md > rfc-data.json
22 |
23 | - uses: actions/upload-artifact@v4
24 | with:
25 | name: rfc-data
26 | path: rfc-data.json
27 | if-no-files-found: error
28 | overwrite: true
29 |
--------------------------------------------------------------------------------
/.github/workflows/label-opened-new-rfc-prs.yml:
--------------------------------------------------------------------------------
1 | name: Label newly opened RFC PRs
2 |
3 | on:
4 | pull_request_target: # This workflow has permissions on the repo, do NOT run code from PRs in this workflow. See https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
5 | types: [opened]
6 | paths:
7 | - 'text/*.md'
8 |
9 | jobs:
10 | label-pr:
11 | runs-on: ubuntu-latest
12 | steps:
13 | - uses: actions/checkout@v3
14 | with:
15 | ref: ${{ github.event.pull_request.head.sha }}
16 | fetch-depth: 0
17 | persist-credentials: false
18 |
19 | - name: RFCs Added or Changed
20 | id: rfcs
21 | uses: ./.github/actions/find-added-or-modified-rfcs
22 |
23 | - uses: actions-ecosystem/action-add-labels@v1
24 | if: steps.rfcs.outputs.added-rfcs-count > 0
25 | with:
26 | labels: S-Proposed
27 |
--------------------------------------------------------------------------------
/text/0889-deprecate-ember-error.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2022-12-15T00:00:00.000Z
4 | release-date: 2023-01-12T00:00:00.000Z
5 | release-versions:
6 | ember-source: v4.10.0
7 | teams:
8 | - framework
9 | - typescript
10 | prs:
11 | accepted: 'https://github.com/emberjs/rfcs/pull/889'
12 | released: 'https://github.com/emberjs/rfcs/pull/895'
13 | recommended: 'https://github.com/emberjs/rfcs/pull/899'
14 | project-link:
15 | ---
16 |
17 | # Deprecate @ember/error
18 |
19 | ## Summary
20 |
21 | The @ember/error package is just a re-export of the native Error and is therefore unnecessary.
22 |
23 | ## Motivation
24 |
25 | Removal of unnecessary code keeps the codebase cleaner and simplifies developer burden.
26 |
27 | ## Transition Path
28 |
29 | There is no use case for this anymore. A simple codemod can convert current uses to the native Error class.
30 |
31 | ## How We Teach This
32 |
33 | Remove @ember/error from docs.
34 |
35 | ## Drawbacks
36 |
37 | You'll have to run a codemod to resolve existing usage. However, this is trivial and will actually simplify user code.
38 |
39 | ## Alternatives
40 |
41 | None.
42 |
43 | ## Unresolved questions
44 |
45 | None.
46 |
--------------------------------------------------------------------------------
/.github/actions/find-added-or-modified-rfcs/action.yml:
--------------------------------------------------------------------------------
1 | name: Find added or modified RFCs
2 | description: 'Find added or modified RFC'
3 |
4 | # Any workflow using this action requires using actions/checkout with a fetch-depth: 0
5 |
6 | inputs:
7 | base-sha:
8 | description: 'Base SHA'
9 | required: false
10 | sha:
11 | description: 'SHA'
12 | required: false
13 |
14 | outputs:
15 | modified-rfc:
16 | description: "The path of the RFC that was added or modified"
17 | value: ${{ steps.modified-rfc.outputs.path }}
18 | modified-rfcs-count:
19 | description: "The count of how many RFCs were added or modified"
20 | value: ${{ steps.rfcs.outputs.all_changed_files_count }}
21 | added-rfcs-count:
22 | description: "The count of how many RFCs that were added"
23 | value: ${{ steps.rfcs.outputs.added_files_count }}
24 |
25 | runs:
26 | using: "composite"
27 | steps:
28 | - name: Find added or modified RFCs
29 | id: rfcs
30 | uses: tj-actions/changed-files@v39
31 | with:
32 | files: text
33 | json: true
34 |
35 | - name: Find modified or added RFC info
36 | id: modified-rfc
37 | shell: bash
38 | run: |
39 | changed_file=`echo "${{ steps.rfcs.outputs.all_changed_files }}" | jq '.[0]'`
40 | echo "path=$changed_file" >> $GITHUB_OUTPUT
41 |
--------------------------------------------------------------------------------
/text/0092-blueprint-remove-old-files.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: accepted # FIXME: This may be a further stage
3 | start-date: 2016-12-17T00:00:00.000Z
4 | release-date: # FIXME
5 | release-versions: # FIXME
6 | teams:
7 | - cli
8 | prs:
9 | accepted: https://github.com/ember-cli/rfcs/pull/92
10 | project-link:
11 | ---
12 |
13 | # Summary
14 |
15 | Give blueprint generators the ability to clean up old files.
16 |
17 | # Motivation
18 |
19 | We want to eliminate the noise of having old files laying after updating
20 | ember-cli using `ember init`.
21 |
22 | # Detailed design
23 |
24 | We'd like an API for blueprints to delete files instead of only
25 | create. It would be essentially syntactic sugar for removing the file yourself
26 | in an `afterInstall` hook. It would be a returned array on the blueprint's `index.js`.
27 |
28 | ```js
29 | // ember-cli/bluprints/blah/index.js
30 | module.exports = {
31 | // ...
32 |
33 | get oldFilesToRemove() {
34 | return [
35 | 'brocfile.js',
36 | 'LICENSE.MD',
37 | 'testem.json'
38 | ];
39 | }
40 | };
41 | ```
42 |
43 | # How We Teach This
44 |
45 | The guides could use this addition in the blueprints section, but I envision it
46 | being used by mostly power users.
47 |
48 | A changelog entry should be sufficient to teach this.
49 |
50 | # Drawbacks
51 |
52 | The only reason to not do this is to hold out for a large blueprint reworking.
53 | We would be locked into this API.
54 |
55 | # Alternatives
56 |
57 | The key name can be bikeshed. I chose `oldFilesToRemove` to be verbose and
58 | explicit, but it can be changed.
59 |
--------------------------------------------------------------------------------
/text/0114-add-template-lint-addon.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: discontinued # FIXME: Is this correct? We don't quite do what is specified here
3 | start-date: 2018-01-04T00:00:00.000Z
4 | release-date: # FIXME
5 | release-versions: # FIXME
6 | teams:
7 | - cli
8 | prs:
9 | accepted: https://github.com/ember-cli/rfcs/pull/114
10 | project-link:
11 | ---
12 |
13 | # Summary
14 |
15 | Add https://github.com/rwjblue/ember-cli-template-lint as a default addon for the app and addon blueprints using the recommended rules.
16 |
17 | # Motivation
18 |
19 | Linting and security in templates would help not only individual developers write better apps with better accessibility and security, but would also help teams to be on the same page and stick to a handful of standards.
20 |
21 | # Detailed design
22 |
23 | 1. Move ember-cli-template-lint to the ember-cli org (better for contributing and getting work off one person, @rwjblue)
24 | 2. Add the dependency to the app blueprint here: https://github.com/ember-cli/ember-cli/blob/master/blueprints/app/files/package.json#L19
25 | 3. Also add it to the addon blueprint, like the eslint addon here: https://github.com/ember-cli/ember-cli/blob/master/blueprints/addon/index.js#L66
26 |
27 | # How We Teach This
28 |
29 | The same way that we teach ESLint being on by default.
30 |
31 | # Drawbacks
32 |
33 | - More chatter in the terminal.
34 | - An additional dependency.
35 | - Recommended rules might not be good for everyone.. but that same issue probably exists with ESLint.
36 |
37 | # Alternatives
38 |
39 | Do nothing and have people write sub par template code.
40 |
41 | # Unresolved questions
42 |
43 | None
44 |
--------------------------------------------------------------------------------
/text/0194-deprecate-custom-event-manager.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2016-12-24T00:00:00.000Z
4 | release-date: 2018-02-13T00:00:00.000Z
5 | release-versions:
6 | ember-source: v3.0.0
7 |
8 | teams:
9 | - framework
10 | prs:
11 | accepted: https://github.com/emberjs/rfcs/pull/194
12 | project-link:
13 | meta:
14 | ember-issue: https://github.com/emberjs/ember.js/issues/14754
15 | ---
16 |
17 | # Summary
18 |
19 | Support for component `eventManger`s is a seldom used feature and should
20 | be deprecated.
21 |
22 | # Motivation
23 |
24 | We should strive to simplify the Ember API and source code where possible. As
25 | the custom `eventManager` feature is rarely used in apps, we should deprecate
26 | it.
27 |
28 | # Detailed design
29 |
30 | We'll introduce a deprecation warning which will be displayed when a component
31 | defines an `eventManager` property or when `canDispatchToEventManager` is set to
32 | true on `EventDispatcher`. The warning will have a target version of `3.0`.
33 |
34 | If required, we can create an addon which extends the `EventDispatcher` allowing
35 | for opt-in custom `eventManager`s in Ember apps.
36 |
37 | # How We Teach This
38 |
39 | As this is a seldom used feature, we can simply note the deprecation in a
40 | future release blog post.
41 |
42 | # Drawbacks
43 |
44 | This adds a little more churn for apps that rely on this feature.
45 |
46 | # Alternatives
47 |
48 | This feature was [recently made pay-as-you-go](https://github.com/emberjs/ember.js/pull/14756),
49 | so the immediate performance concerns have been addressed. We could decide to
50 | leave this in the framework as an opt-in feature.
51 |
--------------------------------------------------------------------------------
/.github/workflows/trigger-opening-advancement-pr.yml:
--------------------------------------------------------------------------------
1 | name: Trigger the opening of a PR to advance an RFC to the next stage
2 |
3 | on:
4 | workflow_dispatch:
5 | inputs:
6 | rfc-path:
7 | type: string
8 | required: true
9 | description: Path to the RFC to open PR for advancement to the next stage
10 |
11 | jobs:
12 | gather-rfc-info:
13 | name: 'Gather RFC info'
14 | runs-on: ubuntu-latest
15 | outputs:
16 | new-stage: ${{ steps.new-stage.outputs.value }}
17 | rfc-number: ${{ steps.rfc.outputs.rfc-number }}
18 |
19 | steps:
20 | - uses: actions/checkout@v3
21 |
22 | - name: Setup RFCs tooling
23 | uses: ./.github/actions/setup-rfcs-tooling
24 |
25 | - name: Find RFC Number
26 | id: rfc
27 | run: |
28 | rfc=${{ inputs.rfc-path }}
29 | rfc_number="${rfc//[!0-9]/}"
30 | echo "RFC Number: $rfc_number"
31 | echo "rfc-number=$rfc_number" >> $GITHUB_OUTPUT
32 |
33 | - name: Find new stage
34 | id: new-stage
35 | run: |
36 | new_stage=`node rfcs-tooling/scripts/find-next-stage.mjs ${{ inputs.rfc-path }}`
37 | echo "New Stage: $new_stage"
38 | echo "value=$new_stage" >> $GITHUB_OUTPUT
39 |
40 |
41 | advance-rfc:
42 | uses: ./.github/workflows/open-advancement-pr.yml
43 | needs: [ gather-rfc-info ]
44 | if: needs.gather-rfc-info.outputs.new-stage
45 | with:
46 | rfc-path: ${{ inputs.rfc-path }}
47 | rfc-number: ${{ needs.gather-rfc-info.outputs.rfc-number }}
48 | new-stage: ${{ needs.gather-rfc-info.outputs.new-stage }}
49 | secrets:
50 | personal-access-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
51 |
--------------------------------------------------------------------------------
/text/1117-deprecate-classic-classes.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: accepted
3 | start-date: 2025-06-20T00:00:00.000Z
4 | release-date:
5 | release-versions:
6 | teams: # delete teams that aren't relevant
7 | - cli
8 | - data
9 | - framework
10 | - learning
11 | - steering
12 | - typescript
13 | prs:
14 | accepted: https://github.com/emberjs/rfcs/pull/1117
15 | project-link:
16 | ---
17 |
18 | # Deprecate Classic Classes
19 |
20 | ## Summary
21 |
22 | Deprecate the Classic Class system.
23 |
24 | ## Motivation
25 |
26 | For quite a while now, Ember has recommended the use of Native Classes over the Classic Class
27 | system. The one remaining sticking point has been Mixins. If we
28 | [Deprecate Mixins](https://github.com/emberjs/rfcs/pull/1116), then we can deprecate the Classic Class system.
29 |
30 | ## Transition Path
31 |
32 | All uses of Classic Classes should be converted to Native Classes. Anything that cannot be converted will be deprecated first, such as [Mixins](https://github.com/emberjs/rfcs/pull/1116) and the [`observer` helper function](https://github.com/emberjs/rfcs/pull/1115).
33 |
34 | The `@classic` decorator (and any other APIs or patterns used to enable classic class interop) will also be deprecated as part of this transition. All code should migrate to native class syntax and patterns.
35 |
36 | ## Exploration
37 |
38 | To validate this deprecation, I've tried removing all of the Classic Class system in this PR:
39 | https://github.com/emberjs/ember.js/pull/20923
40 |
41 | ## How We Teach This
42 |
43 | We should remove all references from the guides.
44 |
45 | ## Drawbacks
46 |
47 | Other than it being a lot of work, there are no drawbacks.
48 |
49 | ## Alternatives
50 |
51 | None
52 |
53 | ## Unresolved questions
54 |
55 | Should we keep `EmberObject` around as a home for some utility methods and sugar or remove it entirely?
--------------------------------------------------------------------------------
/text/1114-deprecate-ember-array.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: accepted
3 | start-date: 2025-06-13T00:00:00.000Z
4 | release-date:
5 | release-versions:
6 | teams: # delete teams that aren't relevant
7 | - cli
8 | - data
9 | - framework
10 | - learning
11 | - typescript
12 | prs:
13 | accepted: https://github.com/emberjs/rfcs/pull/1114
14 | project-link:
15 | ---
16 |
17 | # Deprecating Ember Array
18 |
19 | ## Summary
20 |
21 | Deprecate `Ember.Array`, `Ember.MutableArray`, `Ember.ArrayProxy`, `Ember.NativeArray`, `Ember.A`,
22 | `Ember.Enumerable` and Array computed macros.
23 |
24 | ## Motivation
25 |
26 | Now that Ember has a proper tracking system and the availability of `tracked-built-ins` we no longer
27 | need our own custom arrays. In addition, much of the internal implementation relies upon Mixins which
28 | we also hope to deprecate in the future.
29 |
30 | ## Transition Path
31 |
32 | All uses of custom Arrays should be replaced with native Arrays and `tracked-built-ins`.
33 | Additionally, computed macros should be updated to use tracked getters.
34 |
35 | Given how estabished these patterns are, we probably want to provide an addon that brings
36 | back at least some of the functionality to aid migration.
37 |
38 | ## Exploration
39 |
40 | To validate this deprecation, I've tried removing EmberArray in this PR:
41 | https://github.com/emberjs/ember.js/pull/20921
42 |
43 | ## How We Teach This
44 |
45 | We should replace any references in the guides with native arrays or `TrackedArray`.
46 |
47 | ## Drawbacks
48 |
49 | This functionality is old and very well established, removing it will not be without pain
50 | to many users.
51 |
52 | ## Alternatives
53 |
54 | Deprecate just `Ember.A`: #864
55 |
56 | ## Unresolved questions
57 |
58 | None
59 |
60 | ## Notes
61 |
62 | This overlaps with #1112 which also seeks to deprecate `Ember.ArrayProxy`.
63 |
--------------------------------------------------------------------------------
/text/0020-sri-default.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2015-07-10T00:00:00.000Z
4 | release-date: 2015-07-29T00:00:00.000Z
5 | release-versions:
6 | ember-cli: v1.13.5
7 |
8 | teams:
9 | - cli
10 | prs:
11 | accepted: https://github.com/ember-cli/rfcs/pull/20
12 | project-link:
13 | ---
14 |
15 | # Summary
16 |
17 | Enable [Subresource Integrity [SRI]](http://www.w3.org/TR/SRI/) checks by default.
18 |
19 | # Motivation
20 |
21 | To promote the use of SRI in Ember apps as a safe default. Applications should be built with integrity attributes when it is safe to do so. (Unfortunately the main advantage won't be met by default, however confirming one attribute will)
22 |
23 | This solves having poisoned CDN content: [An introduction to JavaScript-based DDoS](https://blog.cloudflare.com/an-introduction-to-javascript-based-ddos/)
24 |
25 |
26 | # Detailed design
27 |
28 | Install [ember-cli-sri](https://www.npmjs.com/package/ember-cli-sri) by default.
29 |
30 | - Applications with relative paths will get SRI.
31 | - Applications with `SRI.crossorigin` will get SRI on `fingerprint.prepend` assets
32 | - Applications with `fingerprint.prepend` and `origin` specified and matching get a `SRI.crossorigin` of anonymous on `fingerprint.prepend` assets
33 |
34 | By default development environments wont run SRI for performance reasons.
35 |
36 | Further explanation available in: [ember-cli-sri](https://www.npmjs.com/package/ember-cli-sri)
37 |
38 | # Drawbacks
39 |
40 | - SRI won't always be on for sites with prepend due to SRI requiring CORS.
41 | - CORS requirement adds a barrier to entry to some users.
42 | - Broken SRI attrs would break the application.
43 |
44 | # Alternatives
45 |
46 | No other alternatives appear suitable.
47 |
48 | # Unresolved questions
49 |
50 | - Adding origin attribute to add a safe same-origin check that doesn't need CORS.
51 | - Could users be warned until they explicitly set `SRI.enabled = false` or `SRI.crossorigin = `?
52 |
--------------------------------------------------------------------------------
/text/1116-deprecate-mixins.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: accepted
3 | start-date: 2025-06-20T00:00:00.000Z
4 | release-date:
5 | release-versions:
6 | teams: # delete teams that aren't relevant
7 | - cli
8 | - framework
9 | - learning
10 | - typescript
11 | prs:
12 | accepted: https://github.com/emberjs/rfcs/pull/1116
13 | project-link:
14 | ---
15 |
16 | # Deprecating Mixin Support
17 |
18 | ## Summary
19 |
20 | Deprecate all Mixin support.
21 |
22 | ## Motivation
23 |
24 | For a while now, Ember has not recommended the use of Mixins. We should actually fully
25 | deprecate this.
26 |
27 | ## Transition Path
28 |
29 | All existing public Ember mixins will be deprecated:
30 |
31 | - [Ember.Mixin](https://github.com/emberjs/rfcs/pull/1111) (from `@ember/object/mixin`)
32 | - [Ember.PromiseProxyMixin](https://github.com/emberjs/rfcs/pull/1112) (from `@ember/object/promise-proxy-mixin`)
33 | - [Ember.Comparable](https://github.com/emberjs/rfcs/pull/1113) (from `@ember/object/comparable`)
34 | - [Ember.Enumerable](https://github.com/emberjs/rfcs/pull/1114) (from `@ember/object/enumerable`)
35 | - [Ember.Observable](https://github.com/emberjs/rfcs/pull/1115) (from `@ember/object/observable`)
36 |
37 | For users that still want mixin-like functionality, we should recommend class
38 | decorators. If this feels less ergonimic that we would desire, we can consider
39 | providing an addon that adds some sugar around this.
40 |
41 | ## Exploration
42 |
43 | To validate this deprecation, I've tried removing all Mixins in this PR: https://github.com/emberjs/ember.js/pull/20923
44 |
45 | ## How We Teach This
46 |
47 | We should remove all references from the guides and provide a [deprecation guide](https://github.com/ember-learn/deprecation-app/pull/1408).
48 |
49 | ## Drawbacks
50 |
51 | Some users probably rely on this functionality. However, it's almost certainly
52 | something that we don't need to keep in Ember itself.
53 |
54 | ## Alternatives
55 |
56 | None
57 |
58 | ## Unresolved questions
59 |
60 | None
--------------------------------------------------------------------------------
/text/0743-ember-data-deprecate-legacy-imports.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2021-04-23T00:00:00.000Z
4 | release-date: 2023-09-18T00:00:00.000Z
5 | release-versions:
6 | ember-data: v5.3.0
7 | teams:
8 | - data
9 | prs:
10 | accepted: 'https://github.com/emberjs/rfcs/pull/743'
11 | ready-for-release: 'https://github.com/emberjs/rfcs/pull/947'
12 | released: 'https://github.com/emberjs/rfcs/pull/969'
13 | recommended: 'https://github.com/emberjs/rfcs/pull/979'
14 | ---
15 |
16 | # EmberData | Deprecate Legacy Imports
17 |
18 | ## Summary
19 |
20 | Deprecates `import DS from "ember-data";` and individual imports within the `ember-data`
21 | package in favor of the imports provided by [RFC#395 packages](https://github.com/emberjs/rfcs/blob/master/text/0395-ember-data-packages.md)
22 |
23 | ## Motivation
24 |
25 | These imports are just a legacy remnant we no longer need.
26 |
27 | ## Detailed design
28 |
29 | Lint rules and a codemod already exist to migrate users to using packages, and have been
30 | available now for over a year.
31 |
32 | The ember-data-packages plugin for ember-cli-babel would be updated so that users would
33 | receive a deprecation when importing from the legacy paths. If required for legacy global
34 | or DS import a runtime deprecation would be added as well.
35 |
36 | To resolve, users would need only to run the codemod to convert to using packages.
37 |
38 | The deprecation would target `5.0` and would become `enabled` no-sooner than `4.1` (although
39 | it may be made `available` before then).
40 |
41 | ## How we teach this
42 |
43 | Users have already been encouraged to migrate, documentation has already been updated to reflect
44 | the package based imports, and lint rules and codemods already exist. Deprecating and removal at
45 | this point is just a formality as the last stage of fading out the old world.
46 |
47 | ## Drawbacks
48 |
49 | Someone somewhere probably is doing something bad.
50 |
51 | ## Alternatives
52 |
53 | Leave them to waste away.
54 |
--------------------------------------------------------------------------------
/text/0690-deprecate-attrs-in-templates.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2020-12-22T00:00:00.000Z
4 | release-date: 2021-03-22T00:00:00.000Z
5 | release-versions:
6 | ember-source: v3.26.0
7 |
8 | teams:
9 | - framework
10 | prs:
11 | accepted: https://github.com/emberjs/rfcs/pull/690
12 | project-link:
13 | ---
14 |
15 | # Deprecate using `{{attrs}}` in templates
16 |
17 | ## Summary
18 |
19 | The `{{attrs}}` object in templates is an alternative way for users to reference
20 | named arguments directly in a template.
21 |
22 | ```hbs
23 | {{attrs.foo}}
24 |
25 | {{! is equivalent to }}
26 | {{@foo}}
27 | ```
28 |
29 | It was a legacy API that existed prior to named arguments being introduced in
30 | Ember, and has continued to be supported via a template transform for some time.
31 | This RFC proposes that we deprecate this functionality in favor of directly
32 | using named arguments.
33 |
34 | ## Motivation
35 |
36 | The `{{attrs}}` syntax was from a previous iteration of the concepts that
37 | eventually became named argument syntax. Now that named arguments exist in the
38 | framework, and are considered the best practice, there is no reason to continue
39 | supporting this syntax.
40 |
41 | ## Transition Path
42 |
43 | Users who currently rely on referencing `{{attrs}}` can convert their references
44 | to named arguments. This should be highly codemoddable, and we will attempt to
45 | make a codemod to help out with the transition.
46 |
47 | ## How We Teach This
48 |
49 | ### Deprecation Guide
50 |
51 | The `{{attrs}}` object was an alternative way to reference named arguments in
52 | templates that was introduced prior to named arguments syntax being finalized.
53 | References to properties on `{{attrs}}` can be converted directly to named
54 | argument syntax.
55 |
56 | Before:
57 |
58 | ```hbs
59 | {{attrs.foo}}
60 | {{this.attrs.foo.bar}}
61 | {{deeply (nested attrs.foobar.baz)}}
62 | ```
63 |
64 | After:
65 |
66 | ```hbs
67 | {{@foo}}
68 | {{@foo.bar}}
69 | {{deeply (nested @foobar.baz)}}
70 | ```
71 |
72 | ## Drawbacks
73 |
74 | - None
75 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE/advance-to-released.md:
--------------------------------------------------------------------------------
1 | # Advance #__RFC_NUMBER__ to the [Released Stage](https://github.com/emberjs/rfcs#released)
2 |
3 | ## [Rendered](__RFC_RENDERED_URL__)
4 |
5 | ## Summary
6 |
7 | This pull request is advancing the RFC to the [Released Stage](https://github.com/emberjs/rfcs#released).
8 |
9 | - PR to Accepted Stage: #__RFC_NUMBER__
10 | - [PR to Ready For Release Stage](__READY_FOR_RELEASE_PR__)
11 |
12 | Upon merging this PR, automation will open a draft PR for this RFC to move to the [Recommended Stage](https://github.com/emberjs/rfcs#recommended).
13 |
14 |
15 | Released Stage Summary
16 |
17 | The work is published. If it is codebase-related work, it is in a stable version of the relevant package(s). If there are any critical deviations from the original RFC, they are briefly noted at the top of the RFC.
18 |
19 | If the work for an RFC is spread across multiple releases of Ember or other packages, the RFC is considered to be in the Released stage when all features are available in stable releases and those packages and versions are noted in the RFC frontmatter.
20 |
21 | Ember's RFC process can be used for process and work plans that are not about code. Some examples include Roadmap RFCs, changes to the RFC process itself, and changes to learning resources. When such an RFC is a candidate for Released, the work should be shipped as described, and the result should presented to the team with the intent of gathering feedback about whether anything is missing. If there is agreement that the work is complete, the RFC may be marked "Released" and a date is provided instead of a version.
22 |
23 | An RFC is moved into "Released" when the above is verified by consensus of the relevant team(s) via a PR to update the stage.
24 |
25 |
26 | ## Checklist to move to Released
27 |
28 | - [ ] The work is published in stable versions of the relevant package(s), with any feature flags toggled on.
29 | - [ ] Deviations from the original RFC are noted in the RFC
30 | - [ ] Release packages and dates are updated in the RFC frontmatter
31 |
--------------------------------------------------------------------------------
/text/0011-improved-cp-syntax.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: discontinued
3 | start-date: 2014-09-30T00:00:00.000Z
4 | release-date: 2014-10-28T00:00:00.000Z
5 | release-versions:
6 | ember-source: v1.8.0
7 |
8 | teams:
9 | - framework
10 | prs:
11 | accepted: https://github.com/emberjs/rfcs/pull/11
12 | project-link:
13 | meta:
14 | ember-issue: https://github.com/emberjs/ember.js/pull/9527
15 | ---
16 |
17 | # Summary
18 |
19 | Improve computed property syntax
20 |
21 | # Motivation
22 |
23 | Today, the setter variant of CP's is both confusing, and looks scary as sin.
24 | (Too many concepts must be taught and it is too easy to screw it up.)
25 |
26 | # Detailed design
27 |
28 | today:
29 | ------
30 |
31 | ```js
32 | fullName: Ember.computed('firstName', 'lastName', function(key, value) {
33 | if (arguments.length > 1) {
34 | var names = value.split(' ');
35 | this.setProperties({
36 | firstName: names[0],
37 | lastName: names[1]
38 | });
39 | return value;
40 | }
41 |
42 | return this.get('firstName') + ' ' + this.get('lastName');
43 | });
44 | ```
45 |
46 | Tomorrow:
47 | ---------
48 |
49 | ```js
50 | fullName: Ember.computed('firstName', 'lastName', {
51 | get: function(keyName) {
52 | return this.get('firstName') + ' ' + this.get('lastName');
53 | },
54 |
55 | set: function(keyName, fullName, oldValue) {
56 | var names = fullName.split(' ');
57 |
58 | this.setProperties({
59 | firstName: names[0],
60 | lastName: names[1]
61 | });
62 |
63 | return fullName;
64 | }
65 | });
66 | ```
67 |
68 |
69 | Notes:
70 | ------
71 |
72 | * we should keep `Ember.computed(fn);` as shorthand for getter only
73 | * `get` xor `set` variants would also be possible.
74 | * `{ get() { } }` is es6 syntax for `{ get: function() { } )`
75 |
76 | Migration
77 | ---------
78 |
79 | * 1.x support both, detect new behaviour by testing if the last arg is not null and typeof object
80 | * 1.x+1 deprecate if last arg is a function and its arity is greater than 1
81 |
82 |
83 | # Drawbacks
84 |
85 | N/A
86 |
87 | # Alternatives
88 |
89 | N/A
90 |
91 | # Unresolved questions
92 |
93 | None
94 |
--------------------------------------------------------------------------------
/text/0029-addon-black-and-whitelist-for-apps.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: accepted # FIXME: This may be a further stage or Discontinued since we now have allowlist and blocklist.
3 | start-date: 2015-11-11T00:00:00.000Z
4 | release-date: # FIXME
5 | release-versions: # FIXME
6 | teams:
7 | - cli
8 | prs:
9 | accepted: https://github.com/ember-cli/rfcs/pull/29
10 | project-link:
11 | ---
12 |
13 | # Summary
14 |
15 | It should be possible to white- and/or blacklist addons in `EmberApp`.
16 |
17 | # Motivation
18 |
19 | If there are two (or more) `EmberApp`s, it's very likely that not all applications need all addons.
20 | E.g. if there is a main page application and one application for embeddable widgets, the main page might need all sorts of addons like `ember-modal-dialog` which adds completely useless bytes to widgets javascript and css files for the widgets. Other addons may add useless initializers or other things that have runtime performance penalties for no benefit.
21 |
22 | # Detailed design
23 |
24 | When EmberApp ctor gets passed a blacklist like this
25 |
26 | ```javascript
27 | EmberApp({
28 | addonBlacklist: ['ember-modal-dialog']
29 | });
30 | ```
31 |
32 | it won't add addons whose `name` matches `ember-modal-dialog` to the list of addons for this app, just as if the addon's `isEnabled()` hook returned `false`.
33 |
34 | C.f. https://github.com/ember-cli/ember-cli/blob/master/lib/broccoli/ember-app.js#L344, this is also were I would add this check.
35 |
36 | Whitelist could work analogously.
37 |
38 | # Drawbacks
39 |
40 | - It adds a bit of API surface while you (possibly) don't care for the multiple app use case of ember-cli.
41 |
42 | - It kinda makes the `name` of an addon public api, so people might change it, not noticing they are breaking people's build (and people might not notice it either). Some addons have names like `Ember CLI ic-ajax` which seems awkward to use as an identifier.
43 |
44 | # Alternatives
45 |
46 | - Add a unified way to enable/disable an addon via normal config
47 | - if that is added one day, the white/blacklist could still be an abstraction for that
48 |
49 | # Unresolved questions
50 |
51 | None.
52 |
--------------------------------------------------------------------------------
/text/1112-deprecate-proxy.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: accepted
3 | start-date: 2025-06-13T00:00:00.000Z
4 | release-date:
5 | release-versions:
6 | teams: # delete teams that aren't relevant
7 | - cli
8 | - data
9 | - framework
10 | - learning
11 | - steering
12 | - typescript
13 | prs:
14 | accepted: https://github.com/emberjs/rfcs/pull/1112
15 | project-link:
16 | ---
17 |
18 |
30 |
31 | # Deprecating Ember Proxies
32 |
33 | ## Summary
34 |
35 | Now that Native Proxy is available in all supported environments, we can deprecate
36 | Ember's custom Proxy handling provided by `ArrayProxy`, `ObjectProxy`, and `PromiseProxyMixin`.
37 |
38 | ## Motivation
39 |
40 | These patterns were introduce to Ember prior to the availability of Native Proxy. Since
41 | Native Proxy is now available in all supported environments, we can deprecate these
42 | patterns in favor of the native Proxy API.
43 |
44 | Additionally, we would like to deprecate Mixins in the future necessitating that we first
45 | deprecate `PromiseProxyMixin`.
46 |
47 | ## Transition Path
48 |
49 | There is no direct migration path for these. Code that relies upon this behavior will have to be rewritten.
50 |
51 | See the deprecation guide (PR'd here: https://github.com/ember-learn/deprecation-app/pull/1405 )
52 |
53 | ## Exploration
54 |
55 | To validate this deprecation, I've tried removing the assocaited functionality in this PR:
56 | https://github.com/emberjs/ember.js/pull/20918
57 |
58 | ## How We Teach This
59 |
60 | We should remove references to these patterns from the guides.
61 |
62 | ## Drawbacks
63 |
64 | By not providing a direct replacement some users may have difficulty migrating.
65 |
66 | ## Alternatives
67 |
68 | None
69 |
70 | ## Unresolved questions
71 |
72 | None
73 |
--------------------------------------------------------------------------------
/text/0750-deprecate-ember-assign.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2021-05-26T00:00:00.000Z
4 | release-date: 2021-11-15T00:00:00.000Z
5 | release-versions:
6 | ember-source: v4.0.0
7 |
8 | teams:
9 | - framework
10 | prs:
11 | accepted: https://github.com/emberjs/rfcs/pull/750
12 | project-link:
13 | ---
14 |
15 |
25 |
26 | # Deprecate Ember.assign
27 |
28 | ## Summary
29 |
30 | Now that Ember is dropping support for IE11, we no longer need `Ember.assign` as a polyfill since `Object.assign`
31 | is available in all browsers that Ember v4.x supports ([CanIUse](https://caniuse.com/mdn-javascript_builtins_object_assign), [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign#browser_compatibility)).
32 |
33 | ## Motivation
34 |
35 | The polyfill is no longer necessary, as well as being another Emberism that can be removed. Apps and addons can use `Object.assign` or object destructuring depending on their browser support targets.
36 |
37 | ## Transition Path
38 |
39 | The transition path is relatively simple: apps that use Ember 4.x will replace `Ember.assign` with `Object.assign`, and apps and addons that use or support Ember 3.x can continue to use the polyfill if needed.
40 |
41 | ex:
42 | ```
43 | import { assign as emberAssign } from '@ember/polyfills';
44 |
45 | const assign = Object.assign || emberAssign;
46 | ```
47 |
48 | ## How We Teach This
49 |
50 | A descriptive deprecation message alerting a developer that `Ember.assign` is deprecated and can be replaced with `Object.assign`.
51 |
52 | ## Drawbacks
53 |
54 | The only drawback is replacing the polyfill assign with the native assign, but there is minimal effort to do this.
55 |
56 | ## Alternatives
57 |
58 | Doing nothing.
59 |
60 | ## Unresolved questions
61 |
62 | None.
63 |
--------------------------------------------------------------------------------
/text/0794-ember-data-schema-definition-service-simplify.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: accepted # FIXME: This may be a further stage
3 | start-date: 2022-02-12T00:00:00.000Z
4 | release-date:
5 | release-versions:
6 | teams:
7 | - data
8 | prs:
9 | accepted: https://github.com/emberjs/rfcs/pull/794
10 | project-link:
11 | ---
12 |
13 | # Simplify Schema Definition Service methods in Ember Data
14 |
15 | ## Summary
16 |
17 | This RFC is an amendment to the Custom Model Classes RFC (https://github.com/emberjs/rfcs/pull/487).
18 | Based on implementation feedback, we discovered we could simplify the arguments to
19 | `attributesDefinitionFor` and `relationshipsDefinitionFor` to drop the string argument and always
20 | pass in an object.
21 |
22 |
23 | ## Motivation
24 |
25 | When implementing a schema service, code ends up easier and cleaner if it does not have to deal with
26 | both a raw string and an object.
27 |
28 | ## Detailed design
29 |
30 | The original RFC proposed the following interface:
31 |
32 | ```typescript
33 | interface SchemaDefinitionService {
34 | // Following the existing RD implementation
35 | attributesDefinitionFor(identifier: RecordIdentifier | type: string): AttributesDefinition
36 |
37 | // Following the existing RD implementation
38 | relationshipsDefinitionFor(identifier: RecordIdentifier | type: string): RelationshipsDefinition
39 | doesTypeExist(type: string): boolean
40 | }
41 | ```
42 |
43 | We can simplify `attributesDefinitionFor` and `relationshipsDefinitionFor` methods to always accept an object.
44 |
45 | ```typescript
46 | interface SchemaDefinitionService {
47 | // Following the existing RD implementation
48 | attributesDefinitionFor(identifier: RecordIdentifier | { type: string }): AttributesDefinition
49 |
50 | // Following the existing RD implementation
51 | relationshipsDefinitionFor(identifier: RecordIdentifier | { type: string }): RelationshipsDefinition
52 |
53 | doesTypeExist(type: string): boolean
54 | }
55 | ```
56 |
57 | ## How we teach this
58 |
59 | It simplifies the types passed in, so should be easier to teach.
60 |
61 |
62 | ## Drawbacks
63 |
64 |
65 | ## Alternatives
66 |
67 | Keeping the existing design per the original RFC.
68 |
--------------------------------------------------------------------------------
/text/0742-ember-data-deprecate-helper-functions.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: accepted
3 | start-date: 2021-04-23T00:00:00.000Z
4 | release-date:
5 | release-versions:
6 | teams:
7 | - data
8 | prs:
9 | accepted: https://github.com/emberjs/rfcs/pull/742
10 | project-link:
11 | ---
12 |
13 | # EmberData | Deprecate Helper Functions
14 |
15 | ## Summary
16 |
17 | Deprecates the exported util functions `errorsHashToArray` `errorsArrayToHash`
18 | and `normalizeModelName` that were recommended for deprecation by the [RFC#395 packages](https://github.com/emberjs/rfcs/blob/master/text/0395-ember-data-packages.md)
19 |
20 | ## Motivation
21 |
22 | These utils are a legacy remnant of when parts of the codebase were shared with each other
23 | by a `DS` global. Over time their utility has shrunk and today they no longer align with
24 | the direction of [error management](https://github.com/emberjs/rfcs/blob/master/text/0465-record-data-errors.md) or [type constraints](https://github.com/emberjs/rfcs/pull/740).
25 |
26 | ## Detailed design
27 |
28 | Users would receive a build-time deprecation when importing these methods using the paths
29 | specified in [RFC#395 packages](https://github.com/emberjs/rfcs/blob/master/text/0395-ember-data-packages.md).
30 |
31 | They would receive a run-time deprecation when using these methods via the `DS` global.
32 |
33 | The deprecation would target `5.0` and would become `enabled` no-sooner than `4.1` (although
34 | it may be made `available` before then).
35 |
36 | Users making use of these methods can trivially copy them into their own codebase to continue
37 | using them, though we recommend refactoring to a more direct conversion into the expected errors
38 | format. For refactoring `normalizeModelName` we also recommend following [RFC#740 Deprecate Non-Strict Types](https://github.com/emberjs/rfcs/pull/740).
39 |
40 | ## How we teach this
41 |
42 | Generally usage has not been widely observed and these are not methods commonly shown in
43 | examples or docs. We should make sure to audit for usages and remove them if they exist.
44 |
45 | ## Drawbacks
46 |
47 | A trivial amount of churn for users that did utilize them.
48 |
49 | ## Alternatives
50 |
51 | Leave them to waste away.
52 |
--------------------------------------------------------------------------------
/text/0237-deprecation-ember-map.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2017-07-20T00:00:00.000Z
4 | release-date: 2018-07-16T00:00:00.000Z
5 | release-versions:
6 | ember-source: v3.3.0
7 |
8 | teams:
9 | - framework
10 | prs:
11 | accepted: https://github.com/emberjs/rfcs/pull/237
12 | project-link:
13 | ---
14 |
15 | # Summary
16 |
17 | This RFC proposes the deprecation of the following classes:
18 |
19 | - `Ember.OrderedSet`
20 | - `Ember.Map`
21 | - `Ember.MapWithDefault`
22 |
23 | These classes need to be moved to an external addon given they are private classes and unused in Ember.js itself.
24 |
25 | # Motivation
26 |
27 | These classes have not been used in Ember itself for a while now. They have always been private but they are used in a few addons, and in particular Ember Data is using them.
28 |
29 | # Transition Path
30 |
31 | `Ember.Map` and `Ember.MapWithDefault` will be deprecated and not extracted, but not before the fix mentioned in the following paragraph is landed in Ember Data. There is already an addon with `Ember.OrderedSet` extracted ([@ember/ordered-set](https://github.com/emberjs/ember-ordered-set)).
32 |
33 | Ember Data is quite likely the biggest project using these classes. There is already a PR that needs merging before deprecating `Ember.Map` and `Ember.MapWithDefault` https://github.com/emberjs/data/pull/5255. Ember Data still needs to migrate to `@ember/ordered-set` to its relationship logic.
34 |
35 | Once Ember Data is updated to not use the classes from Ember, and that fix is released, the `Ember.Map` and `Ember.MapWithDefault` can be deprecated in Ember itself.
36 |
37 | # How We Teach This
38 |
39 | These classes being private would make this simple than other deprecations. People were not supposed to be using a private API and the few that were, would just need to use a new addon.
40 |
41 | This should not impact many codebases.
42 |
43 | # Drawbacks
44 |
45 | This requires cooperation with Ember Data, the main user of these classes. It would be nice to have moved Ember Data to using the addon before releasing Ember with the deprecation so the average user does not see any deprecation warning.
46 |
47 | # Alternatives
48 |
49 | Other option would be moving these classes to Ember Data itself or leaving things as they are now.
50 |
51 | # Unresolved questions
52 |
--------------------------------------------------------------------------------
/text/0105-addons-optionalDependencies.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: accepted # FIXME: This may be a further stage
3 | start-date: 2017-04-23T00:00:00.000Z
4 | release-date: # FIXME
5 | release-versions: # FIXME
6 | teams:
7 | - cli
8 | prs:
9 | accepted: https://github.com/ember-cli/rfcs/pull/105
10 | project-link:
11 | ---
12 |
13 | # Summary
14 |
15 | It should be possible to specify packages/addons in `optionalDependencies` of the `package.json` of an `ember-cli project`, and ember-cli should scan for packages/addons mentioned in optionalDependencies while processing the build so that such packages/addons could also be included into the consuming application.
16 |
17 | The build need not fail asserting "missing dependency" if any of the dependencies specified in optionalDependencies is missing/absent.
18 |
19 | # Motivation
20 |
21 | In general, the current ember-cli build process will scan for the packages specified in the `dependencies` hash and `devDependencies hash` from the downloaded packages in the node_modules folder, discovers and then includes them into the consuming application. The build is designed to fail if any of the packages specified in these two dependencies hash is missing in the `node_modules` folder. But this procedure may not be sufficient for a variety of cases.
22 |
23 | So there could be an option for the developer to specify packages in optionalDependencies and ember-cli can lookup optionalDependencies while processing the build. The Build need not fail if there is any package specified in optionalDependencies is missing, since it is only optional and moreover may only be required for developmental purposes. This way the developer can have more control over the choice of packages he wishes to use for development and skip for production by giving appropriate commands like `npm install --no-optional`, thereby preventing the installation of packages itself rather than blacklisting in `ember-cli-build.js` which suggests preventing the installed addons sepcifed in the `blacklist` array from being included into the consuming application.
24 |
25 | # Detailed design
26 | We can tweak ember-cli addon/package discovery process to lookup for optionalDependencies as well and if the package is missing, we can make ember-cli proceed the build without terminating.
27 |
28 | # How We Teach This
29 |
30 | This functionality can simply be documented in ember-cli guides to teach.
31 |
32 | # Alternatives
33 |
34 | None.
35 |
--------------------------------------------------------------------------------
/text/0318-array-helper.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2018-03-24T00:00:00.000Z
4 | release-date: 2019-04-01T00:00:00.000Z
5 | release-versions:
6 | ember-source: v3.9.0
7 |
8 | teams:
9 | - framework
10 | prs:
11 | accepted: https://github.com/emberjs/rfcs/pull/318
12 | project-link:
13 | meta:
14 | tracking: https://github.com/emberjs/rfc-tracking/issues/23
15 | ---
16 |
17 | # `array` helper
18 |
19 | ## Summary
20 |
21 | This RFC proposes to add an `array` template helper for creating arrays in templates.
22 |
23 | The helper would be invoked as `(array arg1 ... argN)` and return the value `[arg1, ..., argN]`. For example, `(array 'a' 'b' 'c')` would return the value `['a', 'b', 'c']`.
24 |
25 |
26 | ## Motivation
27 |
28 | Objects (or hashes) and arrays are the two main data structures in JavaScript. Ember already has a `hash` helper for building objects, so it makes sense to also include an `array` helper for building arrays.
29 |
30 | ## Detailed design
31 |
32 | The design is straightforward and mirrors the design of the `hash` helper. In particular, the important thing to note is that if any of the arguments to the `array` helper change then an entirely new array will be returned, rather than updating the existing array in place.
33 |
34 | The implementation would also mirror the [implementation of the `hash` helper](https://github.com/emberjs/ember.js/blob/ec9f4e5e5f4099a77a73bc5a9aa41916f0d15d6d/packages/ember-glimmer/lib/helpers/hash.ts#L49-L51) and would simply capture the positional arguments instead.
35 |
36 | ## How we teach this
37 |
38 | This helper is not an important part of the programming model and can just be mentioned in the [API docs](https://emberjs.com/api/ember/release/classes/Ember.Templates.helpers) like its sibling the `hash` helper.
39 |
40 | ## Drawbacks
41 |
42 | As usual, adding new helpers increases the surface area of the API and file size but in this case it is justified because the file size change is extremely small and its actually filling an existing hole in the API.
43 |
44 | ## Alternatives
45 |
46 | This helper could be left to addons, and indeed there are addons that include this helper. It's also trivial to generate
47 | your own `array` helper with `ember generate helper array`. Humorously, the default helper blueprint generates a helper that already acts like the `array` helper ;)
48 |
49 | Nevertheless, I believe it's preferable to include this helper in Ember to fill the hole in Ember's API.
50 |
--------------------------------------------------------------------------------
/text/0999-make-hash-built-in.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: accepted
3 | start-date: 2023-12-22T00:00:00.000Z
4 | release-date: # In format YYYY-MM-DDT00:00:00.000Z
5 | release-versions:
6 | teams: # delete teams that aren't relevant
7 | - framework
8 | - learning
9 | - typescript
10 | prs:
11 | accepted: https://github.com/emberjs/rfcs/pull/0999
12 | project-link:
13 | suite:
14 | ---
15 |
16 |
29 |
30 | # Make `(hash)` a built in helper
31 |
32 | ## Summary
33 |
34 | Today, when using gjs/gts/``, in order to make objects in a template, folks _must import_ the `(hash)` helper.
35 | Because creating objects is fairly commonplace, this is an annoyance for developers, especially as almost every other language has object literal syntax.
36 |
37 | This RFC proposes that `(hash)` be built in to `glimmer-vm` and not require importing.
38 |
39 | ## Motivation
40 |
41 | Arrays and Objects are not only very common to create, they are essential tools when yielding data out of components.
42 |
43 | There is alternate motivation to implement _literals_ for arrays and objects, but that is a bigger can of worms for another time.
44 |
45 | ## Detailed design
46 |
47 | This change would affect strict-mode only. This is so that today's existing code that imports `hash` from `@ember/helper` will still work due to how values defined locally in scope override globals.
48 |
49 | The behavior of `hash` would be the same as it is today, but defined by default in the `glimmer-vm`.
50 |
51 | Being built in can give folks confidence that each property in the hash is individually reactive.
52 |
53 | ## How we teach this
54 |
55 | Once implemented, the guides, if they say anything about gjs/gts/`` and `hash` by the time this would be implemented, would only remove the import.
56 |
57 | The guides should also detail which functions are built in to the framework and, therefore, do not need to be imported.
58 |
59 | ## Drawbacks
60 |
61 | People may not know where `hash` is defined.
62 | - counterpoint: do they need to?
63 |
64 | ## Alternatives
65 |
66 | n/a
67 |
68 | ## Unresolved questions
69 |
70 | n/a
71 |
--------------------------------------------------------------------------------
/text/1000-make-array-built-in.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: accepted
3 | start-date: 2023-12-22T00:00:00.000Z
4 | release-date: # In format YYYY-MM-DDT00:00:00.000Z
5 | release-versions:
6 | teams: # delete teams that aren't relevant
7 | - framework
8 | - learning
9 | - typescript
10 | prs:
11 | accepted: https://github.com/emberjs/rfcs/pull/1000
12 | project-link:
13 | suite:
14 | ---
15 |
16 |
29 |
30 | # Make `(array)` a built in helper
31 |
32 | ## Summary
33 |
34 | Today, when using gjs/gts/``, in order make arrays in templates, folks _must import_ the `(array)` helper.
35 | Because creating arrays is fairly commonplace, this is an annoyance for developers, in part, due to how almost every other language has array literal syntax.
36 |
37 | This RFC proposes that `(array)` be built in to `glimmer-vm` and not require importing.
38 |
39 | ## Motivation
40 |
41 | Arrays and Objects are not only very common to create, they are essential tools when yielding data out of components.
42 |
43 | There is alternate motivation to implement _literals_ for arrays and objects, but that is a bigger can of worms for another time.
44 |
45 | ## Detailed design
46 |
47 | This change would affect strict-mode only. This is so that today's existing code that imports `array` from `@ember/helper` will still work due to how values defined locally in scope override globals.
48 |
49 | The behavior of `array` would be the same as it is today, but defined by default in the `glimmer-vm`.
50 |
51 | Being built in can give folks confidence that each element in the array is individually reactive.
52 |
53 | ## How we teach this
54 |
55 | Once implemented, the guides, if they say anything about gjs/gts/`` and `array` by the time this would be implemented, would only remove the import.
56 |
57 | The guides should also detail which functions are built in to the framework and, therefore, do not need to be imported.
58 |
59 | ## Drawbacks
60 |
61 | People may not know where `array` is defined.
62 | - counterpoint: do they need to?
63 |
64 | ## Alternatives
65 |
66 | n/a
67 |
68 | ## Unresolved questions
69 |
70 | n/a
71 |
--------------------------------------------------------------------------------
/text/0324-deprecate-component-isvisible.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2018-03-28T00:00:00.000Z
4 | release-date: 2019-12-09T00:00:00.000Z
5 | release-versions:
6 | ember-source: v3.15.0
7 |
8 | teams:
9 | - framework
10 | prs:
11 | accepted: https://github.com/emberjs/rfcs/pull/324
12 | project-link:
13 | meta:
14 | tracking: https://github.com/emberjs/rfc-tracking/issues/22
15 | ---
16 |
17 | # Summary
18 |
19 | The aim of this RFC is to deprecate the component's `isVisible` property.
20 | It is not used by Ember internally and left undefined unless manually set.
21 | It's poorly documented and component visibility it better managed in
22 | template space rather than JS.
23 |
24 | # Motivation
25 |
26 | Setting the isVisible property on a component instance as a way to toggle
27 | the visibility of the component is confusing. The majority of its usage
28 | predates even Ember 1.0.0, and modern Ember applications already completely
29 | avoid using isVisible in favor of simpler conditionals in the template
30 | space.
31 |
32 | In addition, when `isVisible` is used today it often introduces subtle (and
33 | difficult to track down) bugs due to its interaction with the `style`
34 | attribute (toggling `isVisible` clobbers any existing content in `style`).
35 |
36 | Simply put, removing `isVisible` will reduce confusion amongst users.
37 |
38 | # Transition Path
39 |
40 | Whenever `isVisible` is used a deprecation will be issued with a link to
41 | the deprecation guide explaining the deprecation and how to refactor in order
42 | to avoid it.
43 |
44 | Given that `Component#isVisible` is a public API, deprecating now would
45 | schedule for removal in the next major version release (4.0).
46 |
47 | There are several options available to hiding elements
48 | such as ``(hidden is valid for all elements
49 | and is semantically correct) or wrapping the component in a template
50 | conditional `{{#if}}` statement. Components `classNames` and `classNameBindings`
51 | could also be used to add hidden classes.
52 |
53 | # How We Teach This
54 |
55 | The `isVisible` property is rarely used, the deprecation along with a mention
56 | in a future blog post would be sufficient.
57 |
58 | We should consider adding documentation on hiding components to the Ember
59 | guides with the conditional handlebar helper or via the widely supported `hidden`
60 | attribute.
61 |
62 | ```hbs
63 | {{#if showComponent}}
64 | {{component}}
65 | {{/if}}
66 |
67 | {{! or }}
68 |
69 | ```
70 |
71 | # Alternatives
72 |
73 | An alternative option would be to to keep `isVisible`.
74 |
--------------------------------------------------------------------------------
/text/0136-contains-to-includes.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended # FIXME: Should this be discontinued?
3 | start-date: 2016-04-16T00:00:00.000Z
4 | release-date: # FIXME
5 | release-versions: # FIXME
6 | teams:
7 | - framework
8 | prs:
9 | accepted: https://github.com/emberjs/rfcs/pull/136
10 | project-link:
11 | meta:
12 | ember-issue: https://github.com/emberjs/ember.js/pull/13553
13 | ---
14 |
15 | # Summary
16 |
17 | [`contains`](http://emberjs.com/api/classes/Ember.Array.html#method_contains) is
18 | implemented on `Ember.Array`, but [contains was renamed to includes in 2014]
19 | (https://github.com/tc39/Array.prototype.includes/commit/4b6b9534582cb7991daea3980c26a34af0e76c6c)
20 | - this proposal is for `contains` to be deprecated in favour of an `includes`
21 | method on `Ember.Array`
22 |
23 | # Motivation
24 |
25 | Motivation is to stay in line with web standards
26 |
27 | # Detailed design
28 |
29 | First, implement `includes` polyfill in compliance with `includes` spec. Polyfill
30 | sample from MDN is:
31 |
32 | ```js
33 | if (!Array.prototype.includes) {
34 | Array.prototype.includes = function(searchElement /*, fromIndex*/ ) {
35 | 'use strict';
36 | var O = Object(this);
37 | var len = parseInt(O.length) || 0;
38 | if (len === 0) {
39 | return false;
40 | }
41 | var n = parseInt(arguments[1]) || 0;
42 | var k;
43 | if (n >= 0) {
44 | k = n;
45 | } else {
46 | k = len + n;
47 | if (k < 0) {k = 0;}
48 | }
49 | var currentElement;
50 | while (k < len) {
51 | currentElement = O[k];
52 | if (searchElement === currentElement ||
53 | (searchElement !== searchElement && currentElement !== currentElement)) { // NaN !== NaN
54 | return true;
55 | }
56 | k++;
57 | }
58 | return false;
59 | };
60 | }
61 | ```
62 |
63 | Then, alias `contains` to `includes` with deprecation warning, deprecate in line with standard
64 | deprecation process. I don't believe that adding the additional parameter will
65 | have any affect on existing usage of `contains`.
66 |
67 | # How We Teach This
68 |
69 | * Update any references in docs and guides to `includes`
70 | * Write a deprecation guide, mentioning any edge cases where the new `includes` behaves differently to `contains`, and giving migration examples
71 | * Indicate in api docs that this is a polyfill
72 |
73 | # Drawbacks
74 |
75 | * May break existing apps
76 | * [Was considered before but was too early](https://github.com/emberjs/ember.js/issues/5670#issuecomment-64084814)
77 |
78 | # Alternatives
79 |
80 | Keep current methods
81 |
82 | # Unresolved questions
83 |
84 | None
85 |
--------------------------------------------------------------------------------
/text/0421-deprecate-application-controller-props.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2019-07-12T00:00:00.000Z
4 | release-date: # FIXME
5 | release-versions: # FIXME
6 | teams:
7 | - framework
8 | prs:
9 | accepted: https://github.com/emberjs/rfcs/pull/421
10 | project-link:
11 | meta:
12 | tracking: https://github.com/emberjs/rfc-tracking/issues/5
13 | ---
14 |
15 | # Deprecate Application Controller Router Properties
16 |
17 | ## Summary
18 |
19 | This RFC proposes the deprecation of `ApplicationController#currentPath` and `ApplicationController#currentRouteName`.
20 |
21 | ## Motivation
22 |
23 | These APIs are no longer needed as the `RouterService` now has `RouterService#currentPath` and `RouterService#currentRouteName`.
24 | These fields are only ever present on the application controller which is a weird special casing that we would like to remove.
25 | Additionally, it's likely that there are very few if any consumers of this API as it is not documented.
26 |
27 | ## Transition Path
28 |
29 | If you are reliant on `ApplicationController#currentPath` and `ApplicationController#currentRouteName` you can get the same functionality from the `RouterService` to migrate, inject the `RouterService` and read the `currentRouteName` or `currentPath` off of it.
30 |
31 | Before:
32 |
33 | ```js
34 | // app/controllers/application.js
35 | import Controller from '@ember/controller';
36 | import fetch from 'fetch';
37 |
38 | export default Controller.extend({
39 | store: service('store'),
40 |
41 | actions: {
42 | sendPayload() {
43 | fetch('/endpoint', {
44 | method: 'POST',
45 | body: JSON.stringify({
46 | route: this.currentRouteName
47 | })
48 | });
49 | }
50 | }
51 | })
52 | ```
53 |
54 | After:
55 |
56 | ```js
57 | // app/controllers/application.js
58 | import Controller from '@ember/controller';
59 | import fetch from 'fetch';
60 |
61 | export default Controller.extend({
62 | store: service('store'),
63 | router: service('router'),
64 |
65 | actions: {
66 | sendPayload() {
67 | fetch('/endpoint', {
68 | method: 'POST',
69 | body: JSON.stringify({
70 | route: this.router.currentRouteName
71 | })
72 | });
73 | }
74 | }
75 | })
76 | ```
77 |
78 | ## How We Teach This
79 |
80 | There is likely very few consumers of this functionality and migration path is covered by existing documentation.
81 |
82 | ## Drawbacks
83 |
84 | This may introduce churn that we are not aware of.
85 |
86 | ## Alternatives
87 |
88 | No real alternative other than keep setting the properties.
89 |
90 | ## Unresolved questions
91 |
92 | Optional, but suggested for first drafts. What parts of the design are still
93 | TBD?
94 |
--------------------------------------------------------------------------------
/text/0918-deprecate-travis-ci-support.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2023-03-25T00:00:00.000Z
4 | release-date: 2023-12-11T00:00:00.000Z
5 | release-versions:
6 | ember-cli: 5.5.0
7 | teams:
8 | - cli
9 | - learning
10 | prs:
11 | accepted: 'https://github.com/emberjs/rfcs/pull/918'
12 | ready-for-release: 'https://github.com/emberjs/rfcs/pull/954'
13 | released: 'https://github.com/emberjs/rfcs/pull/978'
14 | recommended: 'https://github.com/emberjs/rfcs/pull/994'
15 | project-link:
16 | ---
17 |
18 |
30 |
31 | # Deprecate Support for Travis CI
32 |
33 | ## Summary
34 |
35 | This RFC proposes to officially deprecate support for generating a Travis CI
36 | config file when creating a new app or addon.
37 |
38 | ## Motivation
39 |
40 | Since Travis CI announced the end of its unlimited support for open-source
41 | projects, most of the (the entire?) Ember community has switched over to using
42 | GitHub Actions instead. This basically leaves the `.travis.yml` files in the
43 | `app` and `addon` blueprints unused. Even though the maintenance cost of keeping
44 | these files around is pretty low, not having to maintain them would be even
45 | better. It would make [PRs like this](https://github.com/ember-cli/ember-cli/pull/10222)
46 | slightly less cumbersome. Also, since almost no one actually uses these files,
47 | it becomes harder to know/ensure they are up to date and follow the current best
48 | practices.
49 |
50 | ## Transition Path
51 |
52 | We should:
53 |
54 | - Show a deprecation warning when creating a new app or addon using the
55 | `--ci-provider=travis` option
56 | - Show a deprecation warning when picking the `Travis CI` option during the
57 | interactive new flow
58 | - Add a comment to the `.travis.yml` files in the `app` and `addon` blueprints
59 | mentioning that they are deprecated - Adding a comment is the easiest thing to
60 | do implementation wise and people who _do_ wish to continue using Travis CI, can
61 | simply remove the comment again
62 |
63 | ## How We Teach This
64 |
65 | I _think_ we would only need to remove all references to Travis CI from the
66 | learning materials.
67 |
68 | ## Drawbacks
69 |
70 | Can't think of any at the moment.
71 |
72 | ## Alternatives
73 |
74 | Continue supporting Travis CI.
75 |
76 | ## Unresolved questions
77 |
78 | None at the moment.
--------------------------------------------------------------------------------
/text/0121-remove-ember-cli-eslint.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2018-08-13T00:00:00.000Z
4 | release-date: # FIXME
5 | release-versions:
6 | ember-cli: v3.17.0
7 |
8 | teams:
9 | - cli
10 | prs:
11 | accepted: https://github.com/ember-cli/rfcs/pull/121
12 | project-link:
13 | ---
14 |
15 | # Summary
16 |
17 | Remove https://github.com/ember-cli/ember-cli-eslint from projects generated by
18 | `ember-cli`.
19 |
20 | [ember-cli-eslint](https://github.com/ember-cli/ember-cli-eslint) is an addon
21 | designed to show lint errors during test runs. Tooling around `eslint` has
22 | improved enough where this feature may no longer be necessary.
23 |
24 | To be clear, the proposal is _not_ to remove linting in tests. It is to follow
25 | the rest of JavaScript community and follow the standard tooling process.
26 |
27 | There are multiple ways to run `eslint`:
28 |
29 | 1. Integration with editors
30 | 2. Utilize precommit hooks with `eslint`
31 | 3. Support a standard way to run `eslint` (such as `yarn lint:js`)
32 |
33 | We can also discuss configuring `testem` to automatically run `eslint` as part
34 | of `yarn test`
35 |
36 | # Motivation
37 |
38 | 1. Improve our build speed
39 | 2. Simplicity. `eslint` is common among JS stack, and integrations with editors
40 | / precommit-hooks are ubiquitous. Removing this layer of abstraction will
41 | simplify how `eslint` is used throughout `ember-cli`. Most editors have
42 | plugins available for `eslint`, and as long as the `.eslint.rc` is not
43 | removed, we should still see the benefits of `eslint` in our Ember projects.
44 | 3. Hacks required to support features such as [PR #122
45 | broccoli-lint-eslint](https://github.com/ember-cli/broccoli-lint-eslint/pull/122#discussion-diff-153937455R28)
46 |
47 | # Detailed design
48 |
49 | 1. Change blueprint to pull in `eslint` as opposed to `ember-cli-eslint` under
50 | `devDependencies`.
51 | 2. Provide documentation on `eslint` and editor integration as well as precommit hooks
52 |
53 | Redefine `npm test` or `yarn test` (depending on whether the `--yarn` option was
54 | used to create project) to
55 |
56 | ```
57 | ember test && npm run lint:js && npm run lint:hbs
58 | ```
59 |
60 | and
61 |
62 | ```
63 | ember test && yarn lint:js && yarn lint:hbs
64 | ```
65 |
66 |
67 | # How We Teach This
68 |
69 | Providing documentation regarding how to run linting should suffice as well as
70 | documentation to editor integration.
71 |
72 | Deleting abstractions and going towards a explicit path, `eslint` within the
73 | `ember-cli` ecosystem becomes _easier_ to teach.
74 |
75 | # Drawbacks
76 |
77 | 1. No console warnings during builds
78 | 2. lint failures are no longer included in browser tests
79 |
80 | # Alternatives
81 |
82 | 1. Leave `ember-cli-eslint` alone
83 |
84 | # Unresolved questions
85 |
86 | N/A
87 |
--------------------------------------------------------------------------------
/text/0738-ember-data-deprecate-model-reopen.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: accepted # FIXME: This may be a further stage
3 | start-date: 2021-04-23T00:00:00.000Z
4 | release-date:
5 | release-versions:
6 | teams:
7 | - data
8 | prs:
9 | accepted: https://github.com/emberjs/rfcs/pull/738
10 | project-link:
11 | ---
12 |
13 | # EmberData | Deprecate Model Reopen
14 |
15 | ## Summary
16 |
17 | Deprecates using `reopen` to alter clases extending `@ember-data/model`.
18 |
19 | ## Motivation
20 |
21 | `reopen` restricts the ability of EmberData to design better primitives that maintain
22 | compatibility with `@ember-data/model`, and is a footgun that leads to confusing incorrect
23 | states for users that utilize it.
24 |
25 | ## Detailed design
26 |
27 | The static `reopen` method on `Model` will be overwritten to provide a deprecation which
28 | once resolved or after the deprecation lifecycle completes will result in `reopen` throwing
29 | an error when used in dev and silently no-oping in production. This deprecation will target
30 | `5.0` and not be `enabled` sooner than `4.1` though it may come available before that.
31 |
32 | ## How we teach this
33 |
34 | This is best taught through a deprecation guide. Users using `reopen` to test multiple
35 | configurations in their test suite should instead extend and register a new model each time.
36 |
37 | Users using `reopen` to modify a class immediately after creating it should also refactor
38 | to `extend` instead.
39 |
40 | Users using `reopen` to modify a class dynamically at runtime should refactor to either register
41 | new model types or (better) utilize a megamorphic solution such as ember-m3 to achieve their needs.
42 |
43 | In all cases, using `reopen` after a class instance for a record has already been created has *always*
44 | resulted in at least minor and potentially major errors in application state.
45 |
46 | ## Drawbacks
47 |
48 | Test suites, including EmberData's own, that make use of `reopen` are often "order dependent" in order
49 | for the test suite to pass, and refactoring them can sometimes be a difficult exercise in determining
50 | which tests had modified the class to achieve the model shape needed by another test. In general though
51 | the drawbacks here are small given the widespread adoption of class syntax and growing adoption of octane
52 | paradigms.
53 |
54 | ## Alternatives
55 |
56 | - Don't deprecate `reopen` and wait to replace `@ember-data/model` in it's entirety. This alternative would prevent us from providing custom decorators not extending from `computed` and limit potential build tools allowing users to optimize existing usage of EmberData.
57 |
58 | - Wait for `ember` to deprecate `reopen`. Because we cannot build custom decorators and support `reopen` without asking for `ember` to make available to use private APIs I do not think we should wait for Ember here. This RFC does not preclude or force Ember to deprecate reopen more broadly.
59 |
--------------------------------------------------------------------------------
/text/0631-refresh-method-for-router-service.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2020-05-23T00:00:00.000Z
4 | release-date: 2021-12-28T00:00:00.000Z
5 | release-versions:
6 | ember-source: v4.1.0
7 | teams:
8 | - framework
9 | prs:
10 | accepted: 'https://github.com/emberjs/rfcs/pull/631'
11 | recommended: 'https://github.com/emberjs/rfcs/pull/913'
12 | project-link:
13 | ---
14 |
15 | # RouterService#refresh
16 |
17 | ## Summary
18 |
19 | Add a refresh method to the router service that calls refresh on all currently active routes,
20 | or refreshes the descendents of the active route referred to by the pivot route name provided as an argument.
21 |
22 | ## Motivation
23 |
24 | We want to be able to call refresh on all currently active routes, or a subset of them,
25 | from a centralized service or from a component.
26 | As a side benefit, we will be able to do this without relying on the send api,
27 | which is being discussed as a possible deprecation in
28 | [RFC 632](https://github.com/emberjs/rfcs/pull/632).
29 | This enables us to get the latest data from the model hook.
30 |
31 | ## Detailed design
32 |
33 | The following pseudocode represents the overall technical design of this method.
34 | This code implementation is not normative.
35 |
36 | ```js
37 | class RouterService {
38 | refresh(pivotRouteName?: string): Transition {
39 | let pivotRoute = pivotRouteName && lookupRoute(pivotRouteName);
40 | assert("If an argument provided must be the name of an active route", !pivotRouteName || isActiveRoute(pivotRoute));
41 | return this._router._routerMicroLib.refresh(pivotRoute);
42 | }
43 | }
44 | ```
45 |
46 | where *lookupRoute* gets the route specified by the pivotRouteName,
47 | and *isActiveRoute* determines if the specified route is active.
48 | The method optionally takes the route name that will, along with its descendents, be refreshed.
49 | The method will return a promise that resolves when the refresh is complete.
50 |
51 | ## How we teach this
52 |
53 | The following documentation will be added to the method:
54 |
55 | ```js
56 | /**
57 | * Refreshes all currently active routes, doing a full transition.
58 | * If a pivotRouteName is provided and refers to a currently active route,
59 | * it will refresh only that route and its descendents.
60 | * Returns a promise that will be resolved once the refresh is complete.
61 | * All resetController, beforeModel, model, afterModel, redirect, and setupController
62 | * hooks will be called again. You will get new data from the model hook.
63 | *
64 | * @method refresh
65 | * @param {String} [pivotRouteName] the route to refresh (along with all child routes)
66 | * @return Transition
67 | * @public
68 | */
69 | ```
70 |
71 | ## Drawbacks
72 |
73 | This is a slight increase in API surface area.
74 |
75 | ## Alternatives
76 |
77 | We could provide a direct link to the current route via the router service. However,
78 | this would encourage people to use routes to store information and provide methods
79 | that should be idiomatically placed in a service.
80 |
--------------------------------------------------------------------------------
/text/0086-firefox-in-ci.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: discontinued
3 | start-date: 2016-12-04T00:00:00.000Z
4 | release-date: # FIXME
5 | release-versions: # FIXME
6 | teams:
7 | - cli
8 | prs:
9 | accepted: https://github.com/ember-cli/rfcs/pull/86
10 | project-link:
11 | ---
12 |
13 | # Summary
14 |
15 | Replace PhantomJS with Firefox as the default browser for continuous integration testing.
16 |
17 | # Motivation
18 |
19 | We want to provide the best possible out-of-the-box continuous integration testing experience for Ember apps. Today that means shipping with configurations for testem and TravisCI. Those configurations use PhantomJS.
20 |
21 | But PhantomJS is a weird environment. Users must often fix Phantom-specific browser bugs, which is wasted effort since real users never run your app in Phantom. And "how to debug in Phantom" is an entire extra skill people are forced to learn.
22 |
23 | A user-targeted, standards-compliant, modern browser makes a better default choice. Firefox is a good candidate because it's 100% open source, well-supported by Testem on all major operating system, and built-in to TravisCI. Debugging in Firefox has a dramatically nicer learner curve than PhantomJS.
24 |
25 | # Detailed design
26 |
27 | This is a proposed change to the blueprints for new apps and addons. Existing apps and addons would only be affected when they re-run `ember init` as part of an upgrade and choose to take the updated configuration.
28 |
29 | ## Changes in testem.js
30 |
31 | Replace `PhantomJS` with `Firefox`.
32 |
33 | ## Changes in travis.yml
34 |
35 | Add the following new section to start up a virtual display:
36 |
37 | ```
38 | before_script:
39 | - export DISPLAY=:99; sh -e /etc/init.d/xvfb start; sleep 3
40 | ```
41 |
42 | # How We Teach This
43 |
44 | In the guides, replace instructions for installing PhantomJS with instructions for installing Firefox. Since Firefox is a consumer-facing browser with widely-understood installers and behavior, this is one less intimidating thing for newbies to learn.
45 |
46 | # Drawbacks
47 |
48 | PhantomJS has two primary benefits over other browsers: being headless and being scriptable.
49 |
50 | ## Headlessness
51 |
52 | Firefox is not headless, so it needs to render to a display. That is why the Travis configuration needs xvfb.
53 |
54 | ## Scriptability
55 |
56 | PhantomJS is scriptable, but we don't rely on that functionality anyway. We want cross-browser test suites, so Phantom's scriptability is not particularly useful.
57 |
58 | # Alternatives
59 |
60 | The default alternative is to do nothing and keep PhantomJS.
61 |
62 | Another alternative would be to pick Chrome, since it is a very popular browser. However, Chrome is not 100% open source, which complicates distribution. It's not built into Travis, and the popular methods of installing it there require users to opt into non-container-based images, which are heavier and slower to boot.
63 |
64 | Chromium is the fully-open-source parts of Chrome, but like PhantomJS it is an odd duck that's not really well-packaged for end users. It's also not installed by default in Travis.
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/text/0181-deprecate-ember-data-initializers.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2016-11-22T00:00:00.000Z
4 | release-date: # FIXME
5 | release-versions: # FIXME
6 | teams:
7 | - framework
8 | prs:
9 | accepted: https://github.com/emberjs/rfcs/pull/181
10 | project-link:
11 | ---
12 |
13 | # Summary
14 |
15 | The goal of this RFC is to remove the `data-adapter`, `injectStore`,
16 | `transforms`, and `store` Ember application initializers that Ember Data injects
17 | into apps. The `ember-data` initializer will not be changed and any code
18 | that previously depended on the ordering of these initializers (via
19 | the `before` or `after` properties on an initalizer) can be
20 | changed to use the `ember-data` initializers for ordering.
21 |
22 | # Motivation
23 |
24 | The initializers `data-adapter`, `injectStore`, `transforms`, and
25 | `store` have not been used by Ember Data since
26 | [Apr 8, 2014](https://github.com/emberjs/data/commit/d25e23f622a3677b8372db535b2ab824ad306a16). However,
27 | they are still injected into every Ember app that depends on Ember
28 | Data because existing apps may depend on these initializers
29 | for ordering their own initializers to run before or after Ember
30 | Data's setup code.
31 |
32 | Removing these initializers will help reduce the amount of code Ember
33 | Data needs to support.
34 |
35 | Since these initializers are noop functions that run after the
36 | `ember-data` initializer, any initializers that depends on one of the
37 | deprecated initializers listed in this rfc can easly be replaced by
38 | depending on the `ember-data` initializer instead.
39 |
40 | # Detailed design
41 |
42 | Ember Data's instance initializer will start checking for any
43 | initializers whose `before` or `after` properties depend on one of
44 | these deprecated initalizer. If it finds an initalizer that references
45 | one of the deprecated initalizers, Ember Data will then log a
46 | deprecation message that states the name of the offending initalizers
47 | and suggest changing the `before` or `after` property (the deprecation
48 | message will refer to the correct property dynamically) to depend on
49 | Ember Data instead.
50 |
51 | This deprecation message will continue to appear until Ember Data
52 | 3.0.0 when these initalizers and the deprecation code will be finally
53 | removed.
54 |
55 |
56 | # How We Teach This
57 |
58 | This change should have no impact on how we teach Ember or Ember
59 | Data. The initalizers that will be removed have been unused for a long
60 | time and are not mentioned anywhere in today's guides or API docs.
61 |
62 | Users who need to run initalizer code before or after Ember Data
63 | injects the store into routes should be taught to use `before:
64 | 'ember-data'`, or `after: 'ember-data'` on their initializers.
65 |
66 | # Drawbacks
67 |
68 | - This change will require users who depend on these deprecated initalizers to update their code.
69 |
70 | # Alternatives
71 |
72 | - We could leave the noop initalizers in Ember Data and continue to support them in Ember Data 3.0.0 and beyond.
73 |
74 | # Unresolved questions
75 |
76 | None
77 |
--------------------------------------------------------------------------------
/deprecation-template.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: accepted
3 | start-date:
4 | release-date:
5 | release-versions:
6 | teams: # delete teams that aren't relevant
7 | - cli
8 | - data
9 | - framework
10 | - learning
11 | - steering
12 | - typescript
13 | prs:
14 | accepted: # update this to the PR that you propose your RFC in
15 | project-link:
16 | ---
17 |
18 |
30 |
31 | <-- Replace "RFC title" with the title of your RFC -->
32 | # RFC Title
33 |
34 | ## Summary
35 |
36 | > One paragraph explanation of the deprecation.
37 |
38 | ## Motivation
39 |
40 | > Why are we doing this? What are the problems with the deprecated feature?
41 | What is the replacement functionality?
42 |
43 | ## Transition Path
44 |
45 | > This is the bulk of the RFC. Explain the use-cases that deprecated functionality
46 | covers, and for each use-case, describe the transition path.
47 | Describe it in enough detail for someone who uses the deprecated functionality
48 | to understand, for someone to write the deprecation guide, and for someone
49 | familiar with the implementation to implement.
50 |
51 | > It can be helpful to write the deprecation guide as part of this section. Published deprecation
52 | > guides can be found at https://deprecations.emberjs.com/.
53 |
54 | > Please keep in mind any implications within the Ember ecosystem, such as:
55 | > - Lint rules (ember-template-lint, eslint-plugin-ember) that should be added, modified or removed
56 | > - Features that are replaced or made obsolete by this feature and should eventually be deprecated
57 | > - Ember Inspector and debuggability
58 | > - Server-side Rendering
59 | > - Ember Engines
60 | > - The Addon Ecosystem
61 | > - IDE Support
62 | > - Blueprints that should be added or modified
63 |
64 | ## How We Teach This
65 |
66 | > Would the acceptance of this proposal mean the Ember guides must be
67 | re-organized or altered? Does it change how Ember is taught to new users
68 | at any level?
69 | Does it mean we need to put effort into highlighting the replacement
70 | functionality more? What should we do about documentation, in the guides
71 | related to this feature?
72 | How should this deprecation be introduced and explained to existing Ember
73 | users?
74 |
75 | > Keep in mind the variety of learning materials: API docs, guides, blog posts, tutorials, etc.
76 |
77 | ## Drawbacks
78 |
79 | > Why should we *not* do this? Please consider the impact on teaching Ember,
80 | on the integration of this feature with other existing and planned features,
81 | on the impact of the API churn on existing apps, etc.
82 | There are tradeoffs to choosing any path, please attempt to identify them here.
83 |
84 | ## Alternatives
85 |
86 | > What other designs have been considered? What is the impact of not doing this?
87 |
88 | ## Unresolved questions
89 |
90 | > Optional, but suggested for first drafts. What parts of the design are still
91 | TBD?
92 |
--------------------------------------------------------------------------------
/text/1055-vanilla-prettier-setup-in-blueprints.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2024-12-03T00:00:00.000Z
4 | release-date:
5 | release-versions:
6 | ember-cli: 6.3.0
7 | teams:
8 | - cli
9 | prs:
10 | accepted: 'https://github.com/emberjs/rfcs/pull/1055'
11 | ready-for-release: 'https://github.com/emberjs/rfcs/pull/1063'
12 | released: 'https://github.com/emberjs/rfcs/pull/1073'
13 | recommended: 'https://github.com/emberjs/rfcs/pull/1097'
14 | project-link:
15 | suite:
16 | ---
17 |
18 | # Vanilla Prettier Setup in Blueprints
19 |
20 | ## Summary
21 |
22 | This RFC proposes to migrate to a vanilla Prettier setup in the blueprints, instead of running Prettier via ESLint and Stylelint.
23 |
24 | ## Motivation
25 |
26 | 1. Because we run Prettier via ESLint and Stylelint, we only run the files these linters support through Prettier - Using a vanilla Prettier setup, would format all files Prettier supports, ensuring even more consistency in projects
27 | 2. Less dependencies in the blueprints - `eslint-plugin-prettier` and `stylelint-prettier` would not be needed anymore
28 | 3. The Prettier team recommends running Prettier directly, and not via linters:
29 | - Running Prettier directly is faster than running Prettier via ESLint and Stylelint
30 | - ESLint and Stylelint show red squiggly lines in editors (when using the corresponding extensions), while the idea behind Prettier is to make developers forget about formatting
31 |
32 | `3.` is mostly taken from [Integrating with Linters > Notes](https://prettier.io/docs/en/integrating-with-linters.html#notes)
33 |
34 | ## Detailed Design
35 |
36 | We would add the following scripts to the `package.json` file in the `app` blueprint:
37 |
38 | ```diff
39 | + "format": "prettier . --cache --write",
40 | + "lint:format": "prettier . --cache --check",
41 | ```
42 |
43 | - `lint:format` would check the formatting of _all_ files Prettier supports
44 | - `lint:format` would also run when running the `lint` script
45 | - `format` would format _all_ files Prettier supports
46 | - `format` would also run when running the `lint:fix` script
47 |
48 | > NOTE: We use `format` instead of `lint:format:fix`, because we don't want to run Prettier parallel to ESLint and Stylelint when fixing lint errors. The `lint:fix` script will be updated to always run `format` last.
49 |
50 | We would remove the following dependencies from the `package.json` file in the `app` blueprint:
51 |
52 | ```diff
53 | - "eslint-plugin-prettier": "*",
54 | - "stylelint-prettier": "*",
55 | ```
56 |
57 | As these would not be needed anymore.
58 |
59 | > NOTE: We will keep `eslint-config-prettier` installed, as we need this package to turn off the stylistic ESLint rules that might conflict with Prettier.
60 |
61 | We would update the `.prettierignore` file in the `app` blueprint:
62 |
63 | ```diff
64 | + /pnpm-lock.yaml
65 | ```
66 |
67 | To make sure Prettier does not format pnpm's lockfile.
68 |
69 | We would also need to make sure that every file generated by the `app` blueprint is formatted correctly.
70 |
71 | ## How We Teach This
72 |
73 | N/A
74 |
75 | ## Drawbacks
76 |
77 | - Some developers or teams prefer running Prettier via ESLint and Stylelint
78 |
79 | ## Alternatives
80 |
81 | N/A
82 |
83 | ## Unresolved Questions
84 |
85 | N/A
86 |
--------------------------------------------------------------------------------
/text/0340-deprecate-ember-merge.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2018-06-19T00:00:00.000Z
4 | release-date: 2018-12-06T00:00:00.000Z
5 | release-versions:
6 | ember-source: v3.6.0
7 |
8 | teams:
9 | - framework
10 | prs:
11 | accepted: https://github.com/emberjs/rfcs/pull/340
12 | project-link:
13 | ---
14 |
15 | # Deprecate Ember.merge in favor of Ember.assign
16 |
17 | ## Summary
18 |
19 | The goal of this RFC is to remove `Ember.merge` in favor of using `Ember.assign`.
20 |
21 | ## Motivation
22 |
23 | `Ember.assign` has been around quite awhile, and has the same functionality as `Ember.merge`.
24 | With that in mind, we should remove the old `Ember.merge`, in favor of just having a single function.
25 |
26 | ## Detailed design
27 |
28 | Ember will start logging deprecation messages that tell you to use `Ember.assign` instead of `Ember.merge`.
29 |
30 | The exact deprecation message will be decided later, but something along the lines of:
31 |
32 | ```
33 | Using `Ember.merge` is deprecated. Please use `Ember.assign` instead. If you are using a version of
34 | Ember <= 2.4 you can use [ember-assign-polyfill](https://github.com/shipshapecode/ember-assign-polyfill) to make `Ember.assign`
35 | available to you.
36 | ```
37 |
38 | ## How we teach this
39 |
40 | This should be a simple 1 to 1 conversion, and the deprecation message should be clear enough for all to
41 | understand what they need to do, and convert all usages of `Ember.merge` to `Ember.assign`.
42 |
43 | ### Deprecation Guide
44 |
45 | An entry to the [Deprecation Guides](https://emberjs.com/deprecations/) will be added outlining the conversion from
46 | `Ember.merge` to `Ember.assign`.
47 |
48 | `Ember.merge` predates `Ember.assign`, but since `Ember.assign` has been released, `Ember.merge` has been mostly unnecessary.
49 | To cut down on duplication, we are now recommending using `Ember.assign` instead of `Ember.merge`. If you are using a version of
50 | Ember <= 2.4 you can use [ember-assign-polyfill](https://github.com/shipshapecode/ember-assign-polyfill) to make `Ember.assign`
51 | available to you.
52 |
53 | Before:
54 | ```js
55 | import { merge } from '@ember/polyfills';
56 |
57 | var a = { first: 'Yehuda' };
58 | var b = { last: 'Katz' };
59 | merge(a, b); // a == { first: 'Yehuda', last: 'Katz' }, b == { last: 'Katz' }
60 |
61 | ```
62 |
63 | After:
64 | ```js
65 | import { assign } from '@ember/polyfills';
66 |
67 | var a = { first: 'Yehuda' };
68 | var b = { last: 'Katz' };
69 | assign(a, b); // a == { first: 'Yehuda', last: 'Katz' }, b == { last: 'Katz' }
70 | ```
71 |
72 | ### Codemod
73 |
74 | A codemod will be provided to allow automatic conversion of `Ember.merge` to `Ember.assign`.
75 |
76 | ## Drawbacks
77 |
78 | The only drawback, that I can think of, is people would need to convert `Ember.merge` to
79 | `Ember.assign`, but this would be a very easy change and could easily be done via codemod.
80 |
81 | ## Alternatives
82 |
83 | The impact of not doing this, is we continue to have two functions that do basically the same thing,
84 | which we need to maintain.
85 |
86 | Another alternative, could be to remove both `Ember.merge` and `Ember.assign`, in favor of `Object.assign`
87 | or something similar.
88 |
89 | ## Unresolved questions
90 |
91 | None, that I can think of.
92 |
--------------------------------------------------------------------------------
/0000-template.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: accepted
3 | start-date: # In format YYYY-MM-DDT00:00:00.000Z
4 | release-date: # In format YYYY-MM-DDT00:00:00.000Z
5 | release-versions:
6 | teams: # delete teams that aren't relevant
7 | - cli
8 | - data
9 | - framework
10 | - learning
11 | - steering
12 | - typescript
13 | prs:
14 | accepted: # Fill this in with the URL for the Proposal RFC PR
15 | project-link:
16 | suite:
17 | ---
18 |
19 |
32 |
33 |
34 |
35 | # RFC title
36 |
37 | ## Summary
38 |
39 | > One paragraph explanation of the feature.
40 |
41 | ## Motivation
42 |
43 | > Why are we doing this? What use cases does it support? What is the expected
44 | outcome?
45 |
46 | ## Detailed design
47 |
48 | > This is the bulk of the RFC.
49 |
50 | > Explain the design in enough detail for somebody
51 | familiar with the framework to understand, and for somebody familiar with the
52 | implementation to implement. This should get into specifics and corner-cases,
53 | and include examples of how the feature is used. Any new terminology should be
54 | defined here.
55 |
56 | > Please keep in mind any implications within the Ember ecosystem, such as:
57 | > - Lint rules (ember-template-lint, eslint-plugin-ember) that should be added, modified or removed
58 | > - Features that are replaced or made obsolete by this feature and should eventually be deprecated
59 | > - Ember Inspector and debuggability
60 | > - Server-side Rendering
61 | > - Ember Engines
62 | > - The Addon Ecosystem
63 | > - IDE Support
64 | > - Blueprints that should be added or modified
65 |
66 | ## How we teach this
67 |
68 | > What names and terminology work best for these concepts and why? How is this
69 | idea best presented? As a continuation of existing Ember patterns, or as a
70 | wholly new one?
71 |
72 | > Would the acceptance of this proposal mean the Ember guides must be
73 | re-organized or altered? Does it change how Ember is taught to new users
74 | at any level?
75 |
76 | > How should this feature be introduced and taught to existing Ember
77 | users?
78 |
79 | > Keep in mind the variety of learning materials: API docs, guides, blog posts, tutorials, etc.
80 |
81 | ## Drawbacks
82 |
83 | > Why should we *not* do this? Please consider the impact on teaching Ember,
84 | on the integration of this feature with other existing and planned features,
85 | on the impact of the API churn on existing apps, etc.
86 |
87 | > There are tradeoffs to choosing any path, please attempt to identify them here.
88 |
89 | ## Alternatives
90 |
91 | > What other designs have been considered? What is the impact of not doing this?
92 |
93 | > This section could also include prior art, that is, how other frameworks in the same domain have solved this problem.
94 |
95 | ## Unresolved questions
96 |
97 | > Optional, but suggested for first drafts. What parts of the design are still
98 | TBD?
99 |
--------------------------------------------------------------------------------
/text/0326-ember-data-filter-deprecation.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2018-04-18T00:00:00.000Z
4 | release-date: # FIXME
5 | release-versions: # FIXME
6 | teams:
7 | - data
8 | prs:
9 | accepted: https://github.com/emberjs/rfcs/pull/326
10 | project-link:
11 | ---
12 |
13 | # Ember Data Filter Deprecation
14 |
15 | ## Summary
16 |
17 | Deprecate the `store.filter` API. This API was previously gated
18 | behind a private `ENV` variable that was enabled by the addon
19 | [`ember-data-filter`](https://github.com/ember-data/ember-data-filter/tree/b62c992186c00dce8cc81f1fb0cf5e2e6fee0f6b#ember-data-filter).
20 |
21 | ## Motivation
22 |
23 | The `filter` API was a "memory leak by design". [Patterns exist](https://github.com/ember-data/ember-data-filter#recommended-refactor-guide)
24 | with no-worse ergonomics that have better performance and do not incur memory leak penalties.
25 |
26 | While the change in ergonomics for end consumers in minimal, the change to `ember-data` is substantial.
27 | The code for this feature required significant amounts of confusing internal plumbing to ensure that
28 | filters were rerun every time any form of mutation (update, addition, deletion) occurred to any record.
29 |
30 | In addition to maintenance costs, this plumbing negatively affects the performance of all `RecordArray`s,
31 | and slow any operations that count as mutations (such as pushing new records into the store).
32 |
33 | By removing this feature, we significantly simplify and streamline the core of `Ember Data`.
34 |
35 | ## Detailed design
36 |
37 | We will provide 3 new deprecations with links to a [guide on how to refactor](https://github.com/ember-data/ember-data-filter#recommended-refactor-guide).
38 | These deprecations will target `3.5`, meaning that the `ember-data-filter` addon will continue to
39 | work and be supported through the release of ember-data `3.4`.
40 |
41 | **Deprecation: ember-data-filter:filter**
42 |
43 | Deprecate the primary case (`store.filter('posts', filterFn)`).
44 | Instead, users can combine `store.peekAll` with a computed property.
45 |
46 | **Deprecation: ember-data-filter:query-for-filter**
47 |
48 | This deprecation is specific to folks providing a `query` to be requested the
49 | first time a filter is run. To do this better, users can separate their usage
50 | of `filter` from their usage of `query`.
51 |
52 | **Deprecation: ember-data-filter:empty-filter**
53 |
54 | In the case that users were creating a `filter` with no method for filtering by,
55 | a deprecation is printed letting them know that the easiest path forward is to
56 | use `peekAll`, which would return the same record result set.
57 |
58 | ## How we teach this
59 |
60 | The `filter` API is rarely used, having been discouraged for many years. A simple post
61 | alerting users to it's deprecation should be sufficient. The refactoring guide is
62 | sufficiently simple that teaching folks a better way should not be much of a hurdle.
63 |
64 | ## Drawbacks
65 |
66 | Minor churn for folks that did use this API; however, the end result will improve the
67 | performance of apps using filters more so than anyone else.
68 |
69 | ## Alternatives
70 |
71 | There's been some talk of an API for local querying; however, said alternative RFC
72 | would only result in deprecating this API as well.
73 |
74 | ## Unresolved questions
75 |
76 | None
77 |
--------------------------------------------------------------------------------
/text/0096-enable-yarn-usage.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2017-02-02T00:00:00.000Z
4 | release-date: 2017-04-29T00:00:00.000Z
5 | release-versions:
6 | ember-cli: v2.13.0
7 |
8 | teams:
9 | - cli
10 | prs:
11 | accepted: https://github.com/ember-cli/rfcs/pull/96
12 | project-link:
13 | ---
14 |
15 | # Summary
16 |
17 | Enable Ember CLI users to opt into using yarn for packagement management.
18 |
19 | # Motivation
20 |
21 | Ember CLI currently uses the npm command line tool to install dependencies when you run `ember install` or `ember new`/`ember addon`. However, several problems usually arise from npm's semantics.
22 | Dependency resolution and install times can be significant enough to disrupt workflows, as well as offline support, non-deterministic, non-flat dependency graphs.
23 |
24 | Yarn was introduced to the JavaScript community with the intent to provide a better developer experience in these areas:
25 | - Faster installs
26 | - Offline support
27 | - Deterministic dependency graphs
28 | - Lockfile semantics
29 |
30 | While Ember CLI users can currently use Yarn to manage their dependencies, Ember CLI will use the npm client internally when running the above mentioned commands. By allowing users to specify that Ember CLI should use Yarn for everything, we're hoping to provide a more consistent experience.
31 |
32 | # Detailed design
33 |
34 | Enabling Yarn is designed as opt-in to prevent disruptions to the developer's current workflow.
35 | We will address the two moments where this can happen.
36 |
37 | ## `ember install`
38 |
39 | There are two mechanisms through which to opt-in.
40 | The first one is the presence of a `yarn.lock` file in the project root.
41 |
42 | The `yarn.lock` file is generated by Yarn when you run `yarn install` (or the shorter `yarn`),
43 | so we assume that its presence means the developer intends to use Yarn to manage their dependencies.
44 |
45 | Alternatively you, you can force Ember CLI to use Yarn with the `--yarn` flag, and symmetrically,
46 | you can force Ember CLI to not use Yarn with the `--no-yarn` flag.
47 |
48 | To recap:
49 |
50 | - `ember install ember-cli-mirage` with `yarn.lock` present will use Yarn
51 | - `ember install ember-cli-mirage` without `yarn.lock` present will use npm
52 | - `ember install ember-cli-mirage --yarn` will use Yarn
53 | - `ember install ember-cli-mirage --no-yarn` will use npm
54 |
55 | ## `ember init`, `ember new`, `ember addon`
56 |
57 | Since this triad of commands is generally ran before a project is set up, there is no `yarn.lock` file presence to check.
58 | This means we are left with the `--yarn`/`--no-yarn` pair of flags, that will also be added to these commands:
59 |
60 | - `ember new my-app` will use npm
61 | - `ember new my-app --yarn` will use Yarn
62 |
63 | The above also applies to `ember addon` and `ember init`, noting that `ember init` doesn't receive any arguments.
64 |
65 | # How We Teach This
66 |
67 | Both the Ember.js Guides as well as the Ember CLI Guides will be updated to reflect the new flags,
68 | as well as the new semantics of `ember install` in the presence of `yarn.lock`.
69 |
70 | In addition, the built-in instructions for `ember help` will be updated to reflect this.
71 |
72 | # Drawbacks
73 |
74 | To be determined.
75 |
76 | # Alternatives
77 |
78 | Do nothing.
79 |
80 | # Unresolved questions
81 |
82 | To be determined.
83 |
--------------------------------------------------------------------------------
/text/0186-track-unique-history-location-state.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2016-12-05T00:00:00.000Z
4 | release-date: 2017-04-27T00:00:00.000Z
5 | release-versions:
6 | ember-source: v2.13.0
7 |
8 | teams:
9 | - framework
10 | prs:
11 | accepted: https://github.com/emberjs/rfcs/pull/186
12 | project-link:
13 | ---
14 |
15 | # Summary
16 |
17 | Track unique history location states
18 |
19 | # Motivation
20 |
21 | The path alone does not provide enough information. For example, if you
22 | visit page A, scroll down, then click on a link to page B, then click on
23 | a link back to page A. Your actual browser history stack is [A, B, A].
24 | Each of those nodes in the history should have their own unique scroll
25 | position. In order to record this position we need a UUID
26 | for each node in the history.
27 |
28 | This API will allow other libraries to reflect upon each location to
29 | determine unique state. For example,
30 | [ember-router-scroll](https://github.com/dollarshaveclub/ember-router-scroll)
31 | is making use of a [modified `Ember.HistoryLocation` object to get this
32 | behavior](https://github.com/dollarshaveclub/ember-router-scroll/blob/master/addon/locations/router-scroll.js).
33 |
34 | Tracking unique state is required when setting the scroll position
35 | properly based upon where you are in the history stack, as described in
36 | [Motivation](#motivation)
37 |
38 | # Detailed design
39 |
40 | Code: [PR#14011](https://github.com/emberjs/ember.js/pull/14011)
41 |
42 | We simply unique identifier (UUID) so we can track uniqueness on two
43 | dimensions. Both `path` and the generated `uuid`. A simple UUID
44 | generator such as
45 | https://gist.github.com/lukemelia/9daf074b1b2dfebc0bd87552d0f6a537
46 | should suffice.
47 |
48 | # How We Teach This
49 |
50 | We could describe what meta data is generated for each location in the
51 | history stack. For example, it could look like:
52 |
53 | ```js
54 | // visit page A
55 |
56 | [
57 | { path: '/', uuid: 1 }
58 | ]
59 |
60 | // visit page B
61 |
62 | [
63 | { path: '/about', uuid: 2 },
64 | { path: '/', uuid: 1 }
65 | ]
66 |
67 | // visit page A
68 |
69 | [
70 | { path: '/', uuid: 3 },
71 | { path: '/about', uuid: 2 },
72 | { path: '/', uuid: 1 }
73 | ]
74 |
75 | // click back button
76 |
77 | [
78 | { path: '/about', uuid: 2 },
79 | { path: '/', uuid: 1 }
80 | ]
81 | ```
82 |
83 | # Drawbacks
84 |
85 | * The property access is writable
86 |
87 | # Alternatives
88 |
89 | The purpose for this behavior is to enable scroll position libraries.
90 | There are two other solutions in the wild. One is in the guides that
91 | suggests resetting the scroll position to `(0, 0)` on each new route
92 | entry. The other is
93 | [ember-memory-scroll](https://github.com/ef4/memory-scroll) which I
94 | believe is better suited for tracking scroll positions for components
95 | rather than the current page.
96 |
97 | However, in both cases neither solution provides the experience that
98 | users have come to expect from server-rendered pages. The browser tracks
99 | scroll position and restores it when you revisit the page in the history
100 | stack. The scroll position is unique even if you have multiple instances
101 | of the same page in the stack.
102 |
103 | # Unresolved questions
104 |
105 | None at this time.
106 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE/advance-to-ready-for-release.md:
--------------------------------------------------------------------------------
1 | # Advance #__RFC_NUMBER__ to the [Ready For Release Stage](https://github.com/emberjs/rfcs#ready-for-release)
2 |
3 | ## [Rendered](__RFC_RENDERED_URL__)
4 |
5 | ## Summary
6 |
7 | This pull request is advancing the RFC to the [Ready For Release Stage](https://github.com/emberjs/rfcs#ready-for-release).
8 |
9 | - PR to Accepted Stage: #__RFC_NUMBER__
10 |
11 | **An FCP is required before merging this PR to advance.**
12 |
13 | Upon merging this PR, automation will open a draft PR for this RFC to move to the [Released Stage](https://github.com/emberjs/rfcs#released).
14 |
15 |
16 | Ready for Release Stage Description
17 |
18 | This stage is complete when the implementation is complete according to plan outlined in the RFC, and is in harmony with any changes in Ember that have occurred since the RFC was first written. This includes any necessary learning materials. At this stage, features or deprecations may be available for use behind a feature flag, or with an optional package, etc.
19 |
20 | For codebase changes, there are no open questions that are anticipated to require breaking changes; the Ember team is ready to commit to the stability of any interfaces exposed by the current implementation of the feature.
21 |
22 | This stage should include a list of criteria for determining when the proposal can be considered Recommended after being Released.
23 |
24 | An FCP is required to move into this stage.
25 |
26 | Each Ember core team will be requested as a reviewer on the PR to move into this stage. A representative of each team adds a review. If a team does not respond to the request, and after the conclusion of the FCP, it is assumed that the release may proceed.
27 |
28 |
29 | ## Checklist to move to Ready for Release
30 |
31 | - [ ] Implementation is complete according to plan outlined in the RFC, with any adjustments noted in the RFC
32 | - [ ] Any necessary learning materials have been updated
33 | - [ ] The Ember team is ready to commit to the stability of any interfaces exposed by the current implementation of the feature. This is the go/no go decision for any feature flags, but the flags should only be turned on when moving to Released.
34 | - [ ] The feature may not yet have support by the entire ecosystem (e.g. IDEs, addons, Ember Inspector, Engines, Lint Rules, Blueprints, etc), but it does not unintentionally break any existing functionality in those areas.
35 | - [ ] The Interactive Tutorial is not broken by this feature.
36 | - [ ] Criteria for moving to the Recommended Stage has been filled out
37 | - [ ] This PR has been converted from a draft to a regular PR and the `Final Comment Period` label has been added to start the FCP
38 | - [ ] Each [team](https://github.com/emberjs/rfcs#relevant-teams) has been added as a reviewer to the PR at the start of the FCP. Reviews are not required by the end of the FCP. This is a notification step.
39 | * Framework @emberjs/framework
40 | * Data @emberjs/ember-data-core
41 | * CLI @emberjs/cli
42 | * Learning @emberjs/learning-core
43 | * Typescript @emberjs/typescript-core
44 | * Steering @emberjs/steering
45 |
46 |
47 | ## Criteria for moving to Recommended (required)
48 |
49 | A set of criteria for moving this RFC to the Recommended Stage, following release:
50 |
51 | 1.
52 | 2.
53 |
54 | ## Track Implementation
55 |
56 | <-- Use this section to track implementation of the RFC -->
57 |
--------------------------------------------------------------------------------
/text/0741-ember-data-deprecate-model-static-field-access-without-lookup.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: accepted # FIXME: This may be a further stage
3 | start-date: 2021-04-23T00:00:00.000Z
4 | release-date:
5 | release-versions:
6 | teams:
7 | - data
8 | prs:
9 | accepted: https://github.com/emberjs/rfcs/pull/741
10 | project-link:
11 | ---
12 |
13 | # EmberData | Deprecate Accessing Static Fields On Model Prior To Lookup
14 |
15 | ## Summary
16 |
17 | Deprecates when a user directly imports a model extending `@ember-data/model` and
18 | attempts to access one of the static fields containing schema information about
19 | attributes or relationships.
20 |
21 | ## Motivation
22 |
23 | Schema descriptors on classes extending `@ember-data/model` require walking the prototype
24 | chain to collect inherited attributes and relationships. This isn't possible until an
25 | `EmberObject`'s private `proto` method has been invoked.
26 |
27 | Externally, we feel accessing schema information in this manner is a bad practice that should
28 | be avoided. Schema information is exposed at runtime via `store.modelFor` in pre-
29 | [custom-model-class](https://github.com/emberjs/rfcs/blob/master/text/0487-custom-model-classes.md#custom-model-class-rfc)
30 | versions and via the schema definition service and store-wrapper in post- custom-model-class
31 | versions (3.28+).
32 |
33 | Internally, the EmberData team wishes to explore removing our dependence on `computed`
34 | properties and `eachComputedProperty` which make use of invoking `proto` for defining
35 | schema (`attr|belongsTo|hasMany` currently utilize these APIs to build out the schema information).
36 |
37 | ## Detailed design
38 |
39 | If we detect that an access has been made on a class not provided by a factory (the result of
40 | calling `modelFor`) we would print a deprecation targeting `5.0` that would become `enabled`
41 | no-sooner than `4.1` (although it may be made `available` before then).
42 |
43 | Most usages of this pattern occur when a user imports a model for a unit test. In these cases
44 | the appropriate refactor to look it up via the store like so:
45 |
46 | ```js
47 | test('my test', async function(assert) {
48 | const UserSchema = this.owner.lookup('service:store').modelFor('user');
49 | let { attributes } = UserSchema; // access the map of attributes
50 | });
51 | ```
52 |
53 | Or if defining the model in the test file, first register the model like so:
54 |
55 | ```js
56 | test('my test', async function(assert) {
57 | class User extends Model {
58 | @attr name;
59 | }
60 | this.owner.register('model:user', User);
61 |
62 | const UserSchema = this.owner.lookup('service:store').modelFor('user');
63 | let { attributes } = UserSchema; // access the map of attributes
64 | });
65 | ```
66 |
67 | ## How we teach this
68 |
69 | Generally this pattern has not been widely observed, though we should make sure that api-docs,
70 | guides, and blueprints are all updated to show the preferred pattern.
71 |
72 | ## Drawbacks
73 |
74 | Potentially some churn if it turns out that lots of users rely on this sort of access, though
75 | generally this is just another clear step away from `EmberObject` and it better prepares these
76 | users for accessing schema on models not built off of `@ember-data/model`.
77 |
78 | ## Alternatives
79 |
80 | Ignore that this pattern exists, which seems risky given our momentum towards custom model
81 | classes and potentially a different default model than `@ember-data/model`.
82 |
--------------------------------------------------------------------------------
/text/0012-help-json-output.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: released
3 | start-date: 2015-05-16T00:00:00.000Z
4 | release-date:
5 | release-versions: # FIMXE: Prior to 3.0
6 | teams:
7 | - cli
8 | prs:
9 | accepted: https://github.com/ember-cli/rfcs/pull/12
10 | project-link:
11 | ---
12 |
13 | # Summary
14 |
15 | This has come up in [#3699](https://github.com/ember-cli/ember-cli/issues/3699) and [EmberTown/ember-hearth/#66](https://github.com/EmberTown/ember-hearth/issues/66).
16 |
17 | In short, it would be nice for tools that depend on Ember-CLI to be able to read the help output as JSON (for example `ember g --help --json`).
18 |
19 | # Motivation
20 |
21 | In our specific use case in [Ember Hearth](https://github.com/EmberTown/ember-hearth/) we would like to be able to render a dynamic GUI for some tasks, like generating blueprints. This way we could also include any blueprints added by addons. This will also apply to any other tools interfacing with Ember-CLI.
22 |
23 | # Detailed design
24 | We should probably make the internal help-functions (like `printBasicHelp` and `printDetailedHelp`) use JSON internally, and parse to human readable before printing (unless `--json` is specified).
25 |
26 | I'm imagining the json output would be something like this:
27 |
28 | ```json
29 | {
30 | "name":"generate",
31 | "description":"Generates new code from blueprints.",
32 | "aliases":["g"],
33 | "flags":[
34 | {
35 | "flag":"--verbose",
36 | "aliases":["-v"],
37 | "description":"Verbose output"
38 | }, {…}],
39 | "commands":[
40 | {
41 | "command":"template",
42 | "description":"Generates a template.",
43 | "arguments":["name"]
44 | },
45 | {
46 | "command":"model",
47 | "description":"Generate an ember-data model.",
48 | "arguments":[
49 | "name",
50 | {
51 | "argument":"attr:type",
52 | "description":"Add attributes to the model, e.g. 'name:String age:Number'",
53 | "multiple":true
54 | }]
55 | }, {…}]
56 | }
57 | ```
58 |
59 | Note that this output contains a bit more info than the current --help, specifically in the attr:type argument for the model command. This is something I feel is currently missing (I did not understand the model generator command without consulting a colleague, for example), and would be nice to add while we're at it.
60 |
61 | It should be pretty straight forward to generate a human readable output from this JSON. There are a few things missing: However: The generate help command specifically groups commands by addon. I'm not sure how this should be accomplished, and if this matches the other help outputs. Ideally, any tools reading the JSON should be able to rely on the format being the same for all commands. This would keep the internals cleaner as well, including the human readable parser.
62 |
63 | # Drawbacks
64 |
65 | * Requires rewrite of help methods, possibly also for some addons (unless we can provide backwards compatability)
66 | * Increases codebase size
67 |
68 | # Alternatives
69 |
70 | * We could standardize help output enough that it can be safely regexed by other tools
71 | * We could not do this, and require any tools to update whenever Ember-CLI changes any commands
72 |
73 | # Unresolved questions
74 |
75 | * Internal architecture specifics (rewrite printBasicHelp or create a new setup, etc)
76 | * Specifying JSON format details
77 | * List any dependencies, like docs, that will need to be updated with this change
78 |
--------------------------------------------------------------------------------
/text/0101-ember-data-friendly-errors.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2015-10-23T00:00:00.000Z
4 | release-date: 2016-02-29T00:00:00.000Z
5 | release-versions:
6 | ember-data: v2.4.0
7 |
8 | teams:
9 | - data
10 | prs:
11 | accepted: https://github.com/emberjs/rfcs/pull/101
12 | project-link:
13 | meta:
14 | ember-issue: https://github.com/emberjs/data/pull/3930
15 | ---
16 |
17 | # Summary
18 |
19 | Add more illustrative detail to the default Ember Data Adapter Errors.
20 |
21 | # Motivation
22 |
23 | With a production Ember project, it's common to have many errors of the form "Adapter Error",
24 | originating from deep in the Ember Data stack and carrying little context about what the
25 | original error cause was.
26 |
27 | The intent is to add the original request URL, the response code, and some payload information
28 | to the default Error message for `DS.AdapterError`s. From there Errors can be handled or
29 | tracked as normal.
30 |
31 | # Detailed design
32 |
33 | I've been using something similar to the following Adapter (`friendly-error-adapter.js`):
34 |
35 | ```js
36 | import ActiveModelAdapter from 'active-model-adapter';
37 |
38 | import DS from 'ember-data';
39 |
40 | export default ActiveModelAdapter.extend({
41 |
42 | ajax(url, method) {
43 | this.lastRequest = {
44 | url: url,
45 | method: method
46 | };
47 | return this._super(...arguments);
48 | },
49 |
50 | handleResponse: function (status, headers, payload) {
51 | let payloadContentType = headers["Content-Type"].split(";").get("firstObject");
52 | let shortenedPayload;
53 |
54 | if (payloadContentType === "text/html" && payload.length > 250) {
55 | shortenedPayload = "[omitted long blob of HTML]";
56 | } else {
57 | shortenedPayload = payload;
58 | }
59 |
60 | let errorMessage = `Ember Data Error (${this.lastRequest.method} ${this.lastRequest.url} returned a ${status}). \n Payload (${payloadContentType}): \n\n ${shortenedPayload}`;
61 |
62 | if (this.isSuccess(status, headers, payload)) {
63 | return payload;
64 | } else if (this.isInvalid(status, headers, payload)) {
65 | return new DS.InvalidError(payload.errors, errorMessage);
66 | }
67 |
68 | let errors = this.normalizeErrorResponse(status, headers, payload);
69 |
70 | return new DS.AdapterError(errors, errorMessage);
71 | }
72 | });
73 | ```
74 |
75 | (Note that the code inside the adapter could be MUCH simpler and cleaner, the above
76 | is a very quick hacked up example! :bomb:)
77 |
78 | The intent is to get an error message out of the form:
79 |
80 | 1. "Ember Data Error"
81 | 2. Request Method & URI
82 | 3. Response Status
83 | 4. Response Content Type
84 | 5. A sane representation of the Response payload
85 |
86 | # Drawbacks
87 |
88 | Adding complexity to an Error handler always runs the risk of generating errors inside
89 | the handler itself, which would not be overly friendly.
90 |
91 | # Alternatives
92 |
93 | There's probably quite a few different pieces of information that could be included
94 | in the message.
95 |
96 | We could also potentially look at attaching the extra information to other fields on
97 | the `AdapterError` (and its subclasses). The only drawback there would be that most
98 | error reporters would then not include that information by default.
99 |
100 | # Unresolved questions
101 |
102 | * Exact Error Message Format
103 |
--------------------------------------------------------------------------------
/.github/workflows/advance-rfc.yml:
--------------------------------------------------------------------------------
1 | name: Open PR to advance an RFC to the next stage
2 |
3 | on:
4 | push:
5 | branches: [ main, master ]
6 | paths:
7 | - 'text/*.md'
8 |
9 | jobs:
10 | check-rfcs:
11 | name: 'Did push advance the stage of an RFC?'
12 | runs-on: ubuntu-latest
13 | outputs:
14 | new-stage: ${{ steps.new-stage.outputs.value }}
15 | rfc-number: ${{ steps.modified-rfc.outputs.rfc-number }}
16 | modified-rfc: ${{ steps.rfcs.outputs.modified-rfc }}
17 |
18 | steps:
19 | - uses: actions/checkout@v3
20 | with:
21 | fetch-depth: 0
22 |
23 | - name: Setup RFCs tooling
24 | uses: ./.github/actions/setup-rfcs-tooling
25 |
26 | - name: RFCs Added or Changed
27 | id: rfcs
28 | uses: ./.github/actions/find-added-or-modified-rfcs
29 |
30 | - name: Fail if more than 1 RFC is added or modified
31 | if: steps.rfcs.outputs.modified-rfcs-count > 1
32 | run: |
33 | echo "## More than one RFC added or modified" >> $GITHUB_STEP_SUMMARY
34 | echo "This workflow is unable to determine if the stage of any of the added or modified RFCs have changed" >> $GITHUB_STEP_SUMMARY
35 | echo "If this DID NOT modify the stage of any RFC, this failure may be ok" >> $GITHUB_STEP_SUMMARY
36 | echo "::error::More than 1 RFC is added or modified in this PR; unable to automatically open PRs for advancement"
37 | exit 1
38 |
39 | - name: Find modified RFC Number
40 | id: modified-rfc
41 | run: |
42 | changed_file=${{ steps.rfcs.outputs.modified-rfc }}
43 | rfc_number="${changed_file//[!0-9]/}"
44 | echo "RFC Number: $rfc_number"
45 | echo "rfc-number=$rfc_number" >> $GITHUB_OUTPUT
46 |
47 | - name: Determine if stage has changed
48 | id: has-stage-changed
49 | continue-on-error: true
50 | run: |
51 | if [[ ${{ steps.rfcs.outputs.added-rfcs-count }} == 1 ]]; then
52 | echo "## Yes, added a new RFC" >> $GITHUB_STEP_SUMMARY
53 | echo "A new RFC was added"
54 | echo "value=true" >> $GITHUB_OUTPUT
55 | else
56 | node rfcs-tooling/scripts/has-stage-changed.mjs ${{ github.event.before }} ${{ steps.rfcs.outputs.modified-rfc }}
57 | if [[ $? == 0 ]]; then
58 | echo "## Yes, stage has changed" >> $GITHUB_STEP_SUMMARY
59 | echo "value=true" >> $GITHUB_OUTPUT
60 | else
61 | echo "## No, stage unchanged or at final stage" >> $GITHUB_STEP_SUMMARY
62 | echo "value=false" >> $GITHUB_OUTPUT
63 | fi
64 | fi
65 |
66 | - name: Find new stage
67 | if: steps.has-stage-changed.outputs.value == 'true'
68 | id: new-stage
69 | run: |
70 | new_stage=`node rfcs-tooling/scripts/find-next-stage.mjs ${{ steps.rfcs.outputs.modified-rfc }}`
71 | echo "New Stage: $new_stage"
72 | echo "value=$new_stage" >> $GITHUB_OUTPUT
73 |
74 | advance-rfc:
75 | uses: ./.github/workflows/open-advancement-pr.yml
76 | needs: [ check-rfcs ]
77 | if: needs.check-rfcs.outputs.new-stage
78 | with:
79 | rfc-path: ${{ needs.check-rfcs.outputs.modified-rfc }}
80 | rfc-number: ${{ needs.check-rfcs.outputs.rfc-number }}
81 | new-stage: ${{ needs.check-rfcs.outputs.new-stage }}
82 | secrets:
83 | personal-access-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
84 |
--------------------------------------------------------------------------------
/text/0752-inject-service.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2021-06-10T00:00:00.000Z
4 | release-date: 2021-12-28T00:00:00.000Z
5 | release-versions:
6 | ember-source: v4.1.0
7 |
8 | teams:
9 | - framework
10 | - learning
11 | prs:
12 | accepted: https://github.com/emberjs/rfcs/pull/752
13 | project-link:
14 | ---
15 |
16 |
26 |
27 | # Rename `inject` import to `service`
28 |
29 | ## Summary
30 |
31 | Currently, in order to use a service in any framework class you can do it like this:
32 |
33 | ```js
34 | import { inject } from '@ember/service';
35 |
36 | export class MyComponent extends Component {
37 | @inject router;
38 | }
39 | ```
40 |
41 | However, it is very common to actually alias this import to `service`, like this:
42 |
43 | ```js
44 | import { inject as service } from '@ember/service';
45 |
46 | export class MyComponent extends Component {
47 | @service router;
48 | }
49 | ```
50 |
51 | This RFC proposes to actually provide this as a `service` import directly.
52 |
53 |
54 | ## Motivation
55 |
56 | You cannot properly/easily use editor autocompletion to import `@service`.
57 |
58 | Even in the guides, `inject` is aliased to `service` (see: https://guides.emberjs.com/release/services/#toc_accessing-services)
59 |
60 | Finally, there is also an `inject` export from `@ember/controller`, which is also a possible source of confusion.
61 |
62 | By exporting this directly as `service`, this would be streamlined:
63 |
64 | ```js
65 | import { service } from '@ember/service';
66 |
67 | export class MyComponent extends Component {
68 | @service router;
69 | }
70 | ```
71 |
72 | ## Detailed design
73 |
74 | We add an export `service` from the `@ember/service` package with the semantics
75 | of `inject`.
76 |
77 | Import of `inject` itself will be deprecated targeting Ember 5.0 for removal,
78 | and the app blueprint will be updated as soon as possible to the new API.
79 |
80 | Addons will likely want to support the legacy API for a long time, especially
81 | if the legacy API is not deprecated in Ember 4.0.0. The addon blueprint and
82 | best practice should be to:
83 |
84 | ```js
85 | import * as ES from '@ember/service';
86 | const service = ES.service ?? ES.inject;
87 | ```
88 |
89 | Then use `service` for injections.
90 |
91 | ## How we teach this
92 |
93 | The docs should be updated to directly import `import { service } from '@ember/service';`.
94 |
95 | ## Drawbacks
96 |
97 | It might be considered churn. However, we could probably provide a codemod to
98 | automatically rename the imports, lessening the churn.
99 |
100 | Addons will need to live with a degraded injection API for a long time, if they
101 | want to support both versions.
102 |
103 | ## Alternatives
104 |
105 | We could leave the import as it is, continuing to suggest people rename the import to `service`.
106 |
107 | Or we could stop suggesting the import and push for the community to simply use `@inject myService`.
108 |
109 | We could also choose a different name for the import (e.g. `injectService` or something like this).
110 |
111 | ## Unresolved questions
112 |
--------------------------------------------------------------------------------
/text/0801-deprecate-blacklist-and-whitelist-build-options.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: accepted # FIXME: This may be a further stage
3 | start-date: 2022-02-25T00:00:00.000Z
4 | release-date:
5 | release-versions:
6 | teams:
7 | - cli
8 | prs:
9 | accepted: https://github.com/emberjs/rfcs/pull/801
10 | project-link:
11 | ---
12 |
13 | # Deprecate `blacklist` and `whitelist` build options
14 |
15 | ## Summary
16 |
17 | This RFC proposes to deprecate the `blacklist` and `whitelist` build options, in
18 | favour of the `exclude` and `include` build options.
19 |
20 | ## Motivation
21 |
22 | In [RFC 639](https://emberjs.github.io/rfcs/0639-replace-blacklist-whitelist.html),
23 | the `exclude` and `include` build options were introduced. These options provide
24 | exactly the same functionality as the `blacklist` and `whitelist` build options,
25 | but these new terms are more neutral.
26 |
27 | RFC 639 was implemented and released in [Ember CLI v4](https://github.com/ember-cli/ember-cli/blob/master/CHANGELOG.md#v400),
28 | which means we should be able to deprecate the old terms in favour of the new
29 | ones somewhere in the near future.
30 |
31 | ## Transition Path
32 |
33 | When either the `blacklist` or the `whitelist` build option is used, the
34 | following deprecation message will be triggered:
35 |
36 | ```
37 | Using the `addons.blacklist` or the `addons.whitelist` build option is deprecated.
38 | Please use `addons.exclude` or `addons.include` respectively instead.
39 | ```
40 |
41 | **Deprecation details:**
42 |
43 | | Key | Value |
44 | | ------- | ----------------------------------------------- |
45 | | `for` | `'ember-cli'` |
46 | | `id` | `'ember-cli.blacklist-whitelist-build-options'` |
47 | | `since` | `{ available: '4.X.X', enabled: '4.X.X' }` |
48 | | `until` | `'5.0.0'` |
49 |
50 | ## Deprecation Guide
51 |
52 | The `addons.blacklist` and the `addons.whitelist` build options are deprecated.
53 | Please use `addons.exclude` or `addons.include` respectively instead.
54 |
55 | ### Before
56 |
57 | ```js
58 | // ember-cli-build.js
59 |
60 | const EmberApp = require('ember-cli/lib/broccoli/ember-app');
61 |
62 | module.exports = function (defaults) {
63 | const app = new EmberApp(defaults, {
64 | addons: {
65 | blacklist: ['ember-freestyle'],
66 | },
67 | });
68 |
69 | return app.toTree();
70 | };
71 | ```
72 |
73 | ### After
74 |
75 | ```js
76 | // ember-cli-build.js
77 |
78 | const EmberApp = require('ember-cli/lib/broccoli/ember-app');
79 |
80 | module.exports = function (defaults) {
81 | const app = new EmberApp(defaults, {
82 | addons: {
83 | exclude: ['ember-freestyle'],
84 | },
85 | });
86 |
87 | return app.toTree();
88 | };
89 | ```
90 |
91 | ## How We Teach This
92 |
93 | At the moment, these options are not mentioned in the Ember CLI guides.
94 | This means, no documentation updates are required.
95 |
96 | ## Drawbacks
97 |
98 | - I cannot see any real drawbacks at the moment, the only user action that is
99 | required to resolve the deprecation is to rename one or two configuration keys
100 |
101 | ## Alternatives
102 |
103 | - I cannot think of any alternatives worth mentioning, keeping both sets of keys
104 | doesn't seem like a good idea, because they provide exactly the same functionality
105 |
106 | ## Unresolved questions
107 |
108 | - None at the moment
109 |
--------------------------------------------------------------------------------
/text/0050-cli-production-code-stripping.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2016-04-06T00:00:00.000Z
4 | release-date: # FIXME
5 | release-versions: # FIXME
6 | teams:
7 | - cli
8 | prs:
9 | accepted: https://github.com/ember-cli/rfcs/pull/50
10 | project-link:
11 | ---
12 |
13 | # Summary
14 |
15 | A number of Ember framework function calls are no-ops in production. Ember CLI should strip these no-op function invocations from production builds by default.
16 |
17 | # Motivation
18 |
19 | Removing code that isn't required in production results in smaller and faster applications.
20 |
21 | # Detailed design
22 |
23 | The following framework function calls will be removed from ember-cli production builds by default:
24 |
25 | * [`Ember.assert`](http://emberjs.com/api/#method_assert)
26 | * [`Ember.debug`](http://emberjs.com/api/#method_debug)
27 | * [`Ember.deprecate`](http://emberjs.com/api/#method_deprecate)
28 | * [`Ember.info`](http://emberjs.com/api/#method_info)
29 | * [`Ember.runInDebug`](http://emberjs.com/api/#method_runInDebug)
30 | * [`Ember.warn`](http://emberjs.com/api/#method_warn)
31 |
32 | The API documentation will be updated where necessary to indicate that these function calls will be stripped from production builds.
33 |
34 | A babel plugin will execute the removal of these function calls based on provided configuration. The plugin will affect the code of the current app or addon only and won't affect code in child or grandchild addons. As this change becomes part of the default ember-cli configuration, addons will adopt the code stripping as they upgrade to newer ember-cli versions.
35 |
36 | The plugin configuration will define an array of modules or global functions to remove. Here's an example of what this configuration might look like:
37 |
38 | ```js
39 | {
40 | removals: [
41 | {
42 | module: 'ember', //eg. import Em from 'ember';
43 | paths: [
44 | 'assert', //Em.assert will be removed
45 | 'debug', //Em.debug will be removed
46 | 'a.b.c' //Em.a.b.c will be removed
47 | ]
48 | }, {
49 | global: 'Ember',
50 | paths: [
51 | 'deprecate' //Ember.deprecate will be removed
52 | ]
53 | }, {
54 | paths: [
55 | 'console.log' //console.log will be removed
56 | ]
57 | }
58 | ]
59 | }
60 | ```
61 |
62 | The plugin will support removal of destructured and reassigned invocations of these functions and will support both Babel 5 and 6.
63 |
64 | An app or addon can disable the code removal by removing the babel plugin.
65 |
66 | # How We Teach This
67 |
68 | This change doesn't bring any new functionality. Other than updating the Ember API docs, we don't need to make guide or other documentation changes. At the time of releasing, we may want to point out the possible side effects in a release blog post (see the _Drawbacks_ section below).
69 |
70 | If we want to expose the configuration options so that application authors can customize the settings, we can include a new section in the Ember CLI docs.
71 |
72 | # Drawbacks
73 |
74 | This may introduce an unexpected change in production builds as arguments that have side effects will no longer be executed. For example:
75 |
76 | ```js
77 | Ember.assert('Some assertion', someSideEffect());
78 | ```
79 |
80 | Currently, the `someSideEffect` function will be executed in production. When this RFC lands, it won't.
81 |
82 | # Alternatives
83 |
84 | An Ember addon could provide opt-in function stripping for applications that want it. If this RFC isn't deemed a good default for Ember CLI, that option should be explored.
85 |
--------------------------------------------------------------------------------
/text/0003-cli-ember-doctor.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: accepted
3 | start-date: 2015-01-10T00:00:00.000Z
4 | release-date:
5 | release-versions:
6 | teams:
7 | - cli
8 | prs:
9 | accepted: https://github.com/ember-cli/rfcs/pull/3
10 | project-link:
11 | ---
12 |
13 | # Summary
14 |
15 | We need a way to run diagnostics on Ember CLI based projects to let developers know about potential system level incompatibilities. Developers should also be able to get a bill of health for their project for things like outdated dependencies. This bill of health should also be extensible. Output from running this command should be as consise and only ever log things that don't seem healthy.
16 |
17 | # Motivation
18 |
19 | The motivation behind this is 2 pronged:
20 |
21 | 1. Allows developers to submit system level information in pull requests, so that bugs can be filed and potentially replicated.
22 | 2. Gives developers the ability to know about the health of their project and to potentially help with stagnation.
23 |
24 | # Detailed design
25 |
26 | The design for this is rather simple. We would first introduce a command called `ember doctor` that would run some default checks. The default checks would do the following:
27 |
28 | - Run `ember v --verbose` and complain loudly for incompatible versions
29 | - Run `npm outdated --depth 0` to check on outdated modules
30 | - Run `bower list` and display out of date bower components
31 | - Run check to grab OS information
32 |
33 | These are what is considered default `checks`.
34 |
35 | In your project developers can setup their own Doctor `checks` that get merged in with the default checks. To allow for this Ember CLI will have `ember generate doctor check:service-health`.
36 |
37 | This command will generate the following directory structure in the root of the project:
38 |
39 | ```
40 | doctor/
41 | checks/
42 | service-health.js
43 | index.js
44 | ```
45 |
46 | When `ember doctor` is ran we simply will do a merge of the default checks and the ones provided by the application.
47 |
48 | There should also be a way of excluding checks to be ran. Developers should be able to simply pass flags for things they do not care to run e.g. `ember doctor --skip=npm,os`.
49 |
50 | # Addon Design
51 | Much like the project addons can add their own diagnostics as projects.
52 | In the addons main entry point there will be a hook much like
53 | `includedCommands` that allows Ember CLI to look up the diagnostics and
54 | role them into the consuming project.
55 |
56 | ```
57 | var checks = require('./checks');
58 | ...
59 | includedChecks: function() {
60 | return checks;
61 | }
62 | ...
63 | ```
64 |
65 | # Expected Output
66 | Output of running the doctor command should be as concise as possible.
67 | Unless there are any issues with the project that is being analyzed, the
68 | output should be something like the following:
69 |
70 | ```
71 | Success: All diagnostics checked out fine.
72 | ```
73 |
74 | In the event that there is an issue with the project that is being
75 | analyzed the output will look something like the following:
76 |
77 | ```
78 | Warning: NPM modules out of date. Below are the out of date modules.
79 | ╔══════╤═══════╤═════════╗
80 | ║ Name │ Yours │ Current ║
81 | ╟──────┼───────┼─────────╢
82 | ║ glob │ 1.1.2 │ 1.2.3 ║
83 | ╚══════╧═══════╧═════════╝
84 | ```
85 |
86 | # Drawbacks
87 |
88 | This adds "yet another thing" to the Ember CLI API surface. Doctor will be bound to a network connection such as checking outdated dependencies.
89 |
90 | # Alternatives
91 |
92 | There have been other other attempts to put checking for system level checking in various places. The BDFL's would like to consolidate this into an `ember doctor` command.
93 |
94 | # Unresolved questions
95 |
--------------------------------------------------------------------------------
/text/0706-deprecate-ember-global.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2021-02-01T00:00:00.000Z
4 | release-date: 2021-05-03T00:00:00.000Z
5 | release-versions:
6 | ember-source: v3.27.0
7 |
8 | teams:
9 | - framework
10 | prs:
11 | accepted: https://github.com/emberjs/rfcs/pull/706
12 | project-link:
13 | ---
14 |
15 | # Deprecate the Ember Global
16 |
17 | ## Summary
18 |
19 | Deprecate the Ember global, `window.Ember`, and replace it fully with
20 | `import Ember from 'ember';`
21 |
22 | ## Motivation
23 |
24 | The Ember global, available at `window.Ember` (or `globalThis.Ember` in all
25 | environments) is a mostly legacy API from before Ember adopted native ES
26 | modules. Modern Ember apps do not use the global, and in general it is mostly
27 | used by legacy code and occasionally in examples. However, it still exists and
28 | remains undeprecated.
29 |
30 | The primary motivation for deprecating the global object is for _tree shaking_
31 | purposes. Because the global object is assigned eagerly to `window.Ember`
32 | whenever Ember is loaded, it essentially means that every Ember application
33 | implicitly uses every single API that is exported on the global object. This
34 | means that we cannot tree shake any of those APIs, and we must in fact load them
35 | all eagerly and execute all of their code as soon as Ember is loaded.
36 |
37 | While it is tempting to remove the `Ember` object altogether, there are a number
38 | of undeprecated legacy and intimate APIs that are only available through this
39 | object, such os `Ember.meta`. This is why this RFC proposes only deprecating
40 | accessing `Ember` _via_ `window.Ember`/`globalThis.Ember`. Instead, users will
41 | have to import `Ember` using standard ES module syntax if they want to use it.
42 |
43 | ```js
44 | import Ember from 'ember';
45 | ```
46 |
47 | This ensures there is an _explicit_ dependency if it is used, and which will
48 | allow us to treeshake in the future if nothing imports `Ember`. In time, we will
49 | be able to deprecate the `Ember` object altogether.
50 |
51 | ## Transition Path
52 |
53 | When the `Ember` object is defined on the global, we will create a getter for it
54 | that also issues a deprecation. Users who currently use the global will have to
55 | add `import Ember from 'ember';` at the top of the files in which they use it.
56 |
57 | ## How we teach this
58 |
59 | ### Deprecation Guide
60 |
61 | Accessing Ember on the global context (e.g. `window.Ember`, `globalThis.Ember`,
62 | or just `Ember` without importing it) is no longer supported. Migrate to
63 | importing Ember explicitly instead.
64 |
65 | Before:
66 |
67 | ```js
68 | export default class MyComponent extends Ember.Component {
69 | // ...
70 | }
71 | ```
72 |
73 | After:
74 |
75 | ```js
76 | import Ember from 'ember';
77 |
78 | export default class MyComponent extends Ember.Component {
79 | // ...
80 | }
81 | ```
82 |
83 | Alternatively, consider converting to use the Ember modules API equivalent to
84 | the API you are using:
85 |
86 | ```js
87 | import Component from '@ember/component';
88 |
89 | export default class MyComponent extends Component {
90 | // ...
91 | }
92 | ```
93 |
94 | If there is no modules API equivalent, consider refactoring away from using that
95 | API.
96 |
97 | ## Drawbacks
98 |
99 | - Introduces churn in legacy codebases
100 |
101 | - Some polyfills and addons use `Ember` in places where the modules API is not
102 | available, such as in `vendor` files. These are advanced use cases in general,
103 | and there are possible workarounds (such as using the `require` global
104 | function), so this shouldn't block us from removing the global.
105 |
106 | ## Alternatives
107 |
108 | - Keep the global indefinitely.
109 |
--------------------------------------------------------------------------------
/text/0028-app-import-output-file.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2015-11-02T00:00:00.000Z
4 | release-date: 2017-01-23T00:00:00.000Z
5 | release-versions:
6 | ember-cli: v2.11.0
7 |
8 | teams:
9 | - cli
10 | prs:
11 | accepted: https://github.com/ember-cli/rfcs/pull/28
12 | project-link:
13 | ---
14 |
15 | # Summary
16 |
17 | Allow `app.import` to specify outputFIle of a given import.
18 | The default `app.import` would be considered to have an outputFile of
19 | `assets/vendor.js`
20 |
21 | # Motivation
22 |
23 | It is common for individuals to want control over the outputFile for a given
24 | dependency. For example, one may want to load some asm.js code independently
25 | rather then via the single vendor.js blob.
26 |
27 | It is also common for developers to want to group various dependencies
28 | together, and then lazy-load them in the routes they are required.
29 |
30 | Although not as automatic as we would like, it does provide a rather elegant
31 | escape valve. Further work will likely continue to explore automation.
32 |
33 | # Detailed design
34 |
35 | `outputFile:` option, specifies the target file for the given import. If
36 | multiple imports share an outputFile, they will be concatenated (regardless of
37 | type, css/images/videos/js/txt) in the order they where imported.
38 |
39 | `outputFile:` will default to `assets/vendor.js`
40 |
41 | ## Examples
42 |
43 |
44 | #### variation 0: the default
45 |
46 | ```js
47 | app.import('vendor/vim.js', { outputFile: 'assets/vendor.js'});
48 | ```
49 |
50 | #### variation 1: 1 file -> 1 outputFile
51 |
52 | ```js
53 | app.import('vendor/vim.js', { outputFile: 'assets/vim.js'});
54 | ```
55 |
56 | * `vendor/vim.js` becomes `assets/vim.js`
57 | * in prod it is:
58 | * uglified (unless using the uglify options it is excluded)
59 | * fingerprinted (unless it is excluded via the asset-rev options)
60 |
61 | #### variation 2, multiple files to same outputFile
62 |
63 | ```js
64 | app.import('vendor/dependency-1.js', { outputFile: 'assets/alternate-vendor.js'});
65 | app.import('vendor/dependency-2.js', { outputFile: 'assets/alternate-vendor.js'});
66 | ```
67 |
68 | * in-order of the corresponding `app.import` invocation, using sourceMap
69 | concat, the files are combined into `assets/alternate-vendor.js`
70 | * `vendor/dependency-1.js` + `vendor/dependency-2.js` >> `assets/alternative-vendor.js`
71 |
72 | #### variation n, multiple files to same outputFile
73 |
74 | ```js
75 | app.import('vendor/dependency-1.js', { outputFile: 'assets/alternate-vendor.js'});
76 | app.import('vendor/dependency-2.js', { outputFile: 'assets/alternate-vendor.js'});
77 | app.import('vendor/dependency-n.js', { outputFile: 'assets/alternate-vendor.js'});
78 | ```
79 |
80 | * resulting concat is:
81 | * `vendor/dependency-1.js` + `vendor/dependency-2.js` ... `vendor/dependency-n.js`>> `assets/alternative-vendor.js`
82 |
83 | # Drawbacks
84 |
85 | * potential overlap with @chadhietala's packager/linker work
86 | * does not offer additional build-pipeline hooks for these files
87 |
88 | # Alternatives
89 |
90 | Alternatives exist, such as adding support to the linker/packager
91 | effort, or instructing developers to drop down and use
92 | broccoli-funnel/source-map-concat.
93 |
94 | The linker/packager effort is still a ways off, and could be thought of as
95 | complementary.
96 |
97 | Dropping down to broccoli is a solution available today, but for this problem,
98 | it feels like a slightly too low level of abstraction.
99 |
100 | # Unresolved questions
101 |
102 | * how does this relate to `type` in `app.import(..., { type: ... })` ?
103 | * should additional build-steps be allowed for specific output files? (I
104 | suspect maybe, but a future RFC can likely explore)
105 |
--------------------------------------------------------------------------------
/text/0790-deprecate-ember-data-ajax.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: discontinued
3 | start-date: 2022-01-29T00:00:00.000Z
4 | release-date:
5 | release_versions:
6 | teams:
7 | - data
8 | prs:
9 | accepted: 'https://github.com/emberjs/rfcs/pull/790'
10 | discontinued: 'https://github.com/emberjs/rfcs/pull/887'
11 | project-link:
12 | suite:
13 | ---
14 |
15 | # EmberData | Deprecate ajax requests
16 |
17 | ## Summary
18 |
19 | Deprecates use of `ajax` methods in favor of `fetch` to request API data.
20 |
21 | ## Motivation
22 |
23 | Currently, `ember-data` maintains two methods for users to fetch data from their backend - fetching with `jQuery.ajax` and `fetch`. Confusion further exists in the adapters if users implement functionality to change out of the box behaviour. They can override [`ajax`](https://github.com/emberjs/data/blob/e076e0ae71ae6426ca53ad3c5501a0af7ceca883/packages/adapter/addon/rest.ts#L1091-L1126) methods but without a clean interface to operate with, what they really may be doing is overriding how fetch works.
24 |
25 | With Ember 4.0 dropping jQuery, we should take a hard stance on dropping the use of `ajax` in the next major release.
26 |
27 | ## Detailed design
28 |
29 | The first step is putting in place a deprecation if an adapter uses `ajax` to make a request. Since `ember-data` switched the default behaviour to use fetch in 4.0, this deprecation will only apply to those who have overrided the default with `useFetch = true` in their adapters.
30 |
31 | Second, we will expose fetch related methods on the adapters that are equivalent in use and flexibility as the current `ajax` options. Note the [`minimum-adapter-interface`](https://github.com/emberjs/data/blob/master/packages/store/addon/-private/ts-interfaces/minimum-adapter-interface.ts) does not assert the method by which a request is made. As a result, how we design and implement these methods should not have an effect on those users who have implemented their own adapter.
32 |
33 | In 5.0, all `ajax` methods and supporting infrastructure will be removed. The list of affected methods includes:
34 |
35 | - ajax
36 | - _ajaxRequest
37 | - _ajax
38 | - ajaxOptions
39 | - _ajaxUrl
40 |
41 | Moreover, we may rename methods not part of the minimum-adapter-interface. Moreover, we expect to implement the following methods with [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch), although could be changed in the actual implementation.
42 |
43 | - fetch
44 | - fetchOptions
45 | - fetchSuccess
46 | - fetchError
47 | - fetchUrl
48 |
49 | ## How we teach this
50 |
51 | This is best taught through a deprecation guide. Users using `ajax` will need to install `ember-fetch` or rely on the default global `fetch` API provided by the browser. This has some implications, for example, with how query params are serialized. Users will have to be careful to ensure the behaviour of their API changes with any changes that result from switching to fetch.
52 |
53 | ## Drawbacks
54 |
55 | Some user's technology stacks may be entirely dependent on `ajax` for requesting API data. This isn't necessarily an easy switch and may require multiple improvements to various layers to use `fetch`. For those users, we can document how they can still implement their own adapter to use `ajax`. This will involve overriding the existing `fetch` methods. For example, if your API still needs to be serviced with `ajax` to perhaps take advantage of [ajax options](https://api.jquery.com/jquery.ajax/#jQuery-ajax-url-settings) or [ajaxPrefilter](https://api.jquery.com/jquery.ajaxprefilter/), simply override the existing `fetch` methods. The goal of this refactor would be to ensure users who still need to use `ajax` has a happy path to doing so.
56 |
57 | ## Alternatives
58 |
59 | - Continue providing and exposing public-ish adapters methods as `ajax`.
60 | - Provide both `fetch` and `ajax` methods together in the adapters.
61 |
--------------------------------------------------------------------------------
/text/1026-ember-data-deprecate-store-extends-ember-object.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2024-05-11T00:00:00.000Z
4 | release-date:
5 | release-versions:
6 | ember-data: 5.3.0
7 | teams:
8 | - data
9 | prs:
10 | accepted: 'https://github.com/emberjs/rfcs/pull/1026'
11 | ready-for-release: 'https://github.com/emberjs/rfcs/pull/1035'
12 | released: 'https://github.com/emberjs/rfcs/pull/1047'
13 | recommended: 'https://github.com/emberjs/rfcs/pull/1051'
14 | project-link:
15 | suite:
16 | ---
17 |
18 | # EmberData | Deprecate Store extending EmberObject
19 |
20 | ## Summary
21 |
22 | This RFC deprecates the Store extending from EmberObject. All EmberObject specific
23 | APIs included.
24 |
25 | ## Motivation
26 |
27 | There are two motivations:
28 |
29 | First, extending EmberObject is vestigial. The Store makes no use of any EmberObject API,
30 | not even for use with Ember's container or service injection.
31 |
32 | Second, in order to support any Ember version, support any non-Ember framework, and support
33 | EmberData running in non-browser environments we want to remove unnecessary coupling to the Ember framework.
34 |
35 | ## Detailed design
36 |
37 | Instead of deprecating every EmberObject method, we will feature flag the Store extending
38 | EmberObject at the module level. This ensures the deprecation only prints once, and that
39 | once resolved the Store will no longer extend thereby making it feasible to utilize the
40 | benefits of not extending EmberObject immediately.
41 |
42 | To resolve the deprecation, users will need to confirm they are not using EmberObject APIs
43 | on the Store. Generally speaking, this has been limited to `.extend` e.g.
44 |
45 | ```ts
46 | const AppStore = Store.extend({});
47 | ```
48 |
49 | This pattern is now rare in the wild, but where it exists can be safely refactored to
50 |
51 | ```ts
52 | class AppStore extends Store {}
53 | ```
54 |
55 | Once confirmed (or in order to confirm) that the Store in an app no longer requires
56 | extending EmberObject, the deprecation config boolean may be used to both remove the
57 | deprecation AND the deprecated code.
58 |
59 | ```ts
60 | const app = new EmberApp(defaults, {
61 | emberData: {
62 | deprecations: {
63 | DEPRECATE_STORE_EXTENDS_EMBER_OBJECT: false
64 | }
65 | }
66 | });
67 | ```
68 |
69 | An upcoming shift in how EmberData manages configuration would mean that applications
70 | using the new configuration (not yet released) would do the following:
71 |
72 | ```ts
73 | 'use strict';
74 |
75 | const EmberApp = require('ember-cli/lib/broccoli/ember-app');
76 |
77 | module.exports = async function (defaults) {
78 | const { setConfig } = await import('@warp-drive/build-config');
79 |
80 | const app = new EmberApp(defaults, {});
81 |
82 | setConfig(app, __dirname, {
83 | deprecations: {
84 | DEPRECATE_STORE_EXTENDS_EMBER_OBJECT: false
85 | }
86 | });
87 |
88 | return app.toTree();
89 | };
90 | ```
91 |
92 | ## How we teach this
93 |
94 | Guides would be added for this deprecation to both the deprecation app and the API docs.
95 |
96 | Generally, folks do not tend to treat the Store as an EmberObject or utilize legacy EmberObject
97 | APIs with it, so both the teaching and the migration overhead are low.
98 |
99 | ## Drawbacks
100 |
101 | none
102 |
103 | ## Alternatives
104 |
105 | - deprecate every classic method to help folks find usage
106 | - not chosen as it's rare *and* setting the deprecation flag to `false` will cause any such locations to be findable via error
107 | - create a new package `@warp-drive/core` or `@warp-drive/store` and have users migrate by swapping import
108 | locations.
109 | - not chosen as this is too minimal a change
110 |
111 | ## Unresolved questions
112 |
113 | None
114 |
--------------------------------------------------------------------------------
/text/0001-transform-attribute-meta-parameter.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: released
3 | start-date: 2014-08-14T00:00:00.000Z
4 | release-date: 2016-05-03T00:00:00.000Z
5 | release-versions:
6 | ember-data: v2.5.0
7 |
8 | teams:
9 | - data
10 | prs:
11 | accepted: https://github.com/emberjs/rfcs/pull/1
12 | project-link:
13 | meta:
14 | ember-issue: https://github.com/emberjs/data/pull/4086
15 | ---
16 |
17 | # Summary
18 |
19 | For Ember Data. Pass through attribute meta data, which includes `parentType`, `options`, `name`, etc.,
20 | to the transform associated with that attribute. This will allow provide the following function signiture updates to `DS.Transform`:
21 |
22 | * `transform.serialize(deserialized, attributeMeta)`
23 | * `transform.deserialize(serialized, attributeMeta)`
24 |
25 | # Motivation
26 |
27 | The main use case is to be able to configure the transform
28 | on a per-model basis making more DRY code. So the transform can be aware of type and options on `DS.attr` can
29 | be useful to configure the transform for DRY use.
30 |
31 | # Detailed design
32 |
33 | ## Implementing
34 |
35 | The change will most likely start in [`eachTransformedAttribute`][1], which gets the attributes for that instance via `get(this, 'attributes')`. In the `forEach` the `name` will be used to get the specific attribute, e.g.
36 |
37 | ```js
38 | var attributeMeta = attributes.get(name);
39 | callback.call(binding, name, type, attributeMeta);
40 | ```
41 |
42 | The next change will be in [`applyTransforms`][2], where the `attributeMeta` parameter is added and passed to `transform.deserialize` as the second argument.
43 |
44 | You also have to handle the serialization part in [`serializeAttribute`][3], where you pass through the `attribute` parameter to `transform.serialize`.
45 |
46 | ## Using
47 |
48 | A convoluted example:
49 |
50 | ```js
51 | // Example based on https://github.com/chjj/marked library
52 | App.PostModel = DS.Model.extend({
53 | title: DS.attr('string'),
54 | markdown: DS.attr('markdown', {
55 | markdown: {
56 | gfm: false,
57 | sanitize: true
58 | }
59 | })
60 | });
61 |
62 | App.TechnicalPostModel = DS.Model.extend({
63 | title: DS.attr('string'),
64 | gistUrl: DS.attr('string'),
65 | markdown: DS.attr('markdown', {
66 | markdown: {
67 | gfm: true,
68 | tables: true,
69 | sanitize: false
70 | }
71 | })
72 | });
73 |
74 | App.MarkdownTransform = DS.Transform.extend({
75 | serialize: function (deserialized, attributeMeta) {
76 | return deserialized.raw;
77 | },
78 |
79 | deserialize: function (serialized, attributeMeta) {
80 | var options = attributeMeta.options.markdown || {};
81 |
82 | return marked(serialized, options);
83 | }
84 | });
85 | ```
86 |
87 | # Drawbacks
88 |
89 | Extra API surface area, although not much. This could also potentially introduce tight coupling between models and transforms if used improperly, e.g. not returning a default value if using type checking.
90 |
91 | # Alternatives
92 |
93 | 1. Passing the information from the server, which is a poor solution.
94 | 2. Writing a new transform for each model/attribute that needs a variation. Although this might be a good solution sometimes if you extend a base transform.
95 |
96 | # Unresolved questions
97 |
98 | Does the whole meta object need to be passed, or do we selectively pass in only the useful properties? Like
99 | `options` and `parentType` and `name`..
100 |
101 |
102 |
103 | [1]: https://github.com/emberjs/data/blob/master/packages/ember-data/lib/system/model/attributes.js#L193
104 | [2]: https://github.com/emberjs/data/blob/master/packages/ember-data/lib/serializers/json_serializer.js#L117
105 | [3]: https://github.com/emberjs/data/blob/master/packages/ember-data/lib/serializers/json_serializer.js#L528
106 |
--------------------------------------------------------------------------------
/text/0091-weakmap.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: discontinued
3 | start-date: 2015-09-11T00:00:00.000Z
4 | release-date: # FIXME
5 | release-versions: # FIXME
6 | teams:
7 | - framework
8 | prs:
9 | accepted: https://github.com/emberjs/rfcs/pull/91
10 | project-link:
11 | meta:
12 | ember-issue: https://github.com/emberjs/ember.js/pull/12224 / https://github.com/emberjs/ember.js/pull/12990 / https://github.com/emberjs/ember.js/pull/13688
13 | ---
14 |
15 | # Summary
16 |
17 | Introduce `Ember.WeakMap` (`@ember/weakmap`), an ES6 enspired WeakMap. A
18 | WeakMap provides a mechanism for storing and retriving private state. The
19 | WeakMap itself does not retain a reference to the state, allowing the state to
20 | be reclaimed when the key is reclaimed.
21 |
22 | A traditional WeakMap (and the one that will be part of the language) allows
23 | for weakness from key -> map, and also from map -> key. This allows either the
24 | Map, or the key being reclaimed to also release the state.
25 |
26 | Unforunately, this bi-directional weakness is problemative to polyfil. Luckily,
27 | uni-directional weakness, in either direction, "just works". A polyfil must
28 | just choose a direction.
29 |
30 | *Note: Just like ES2015 WeakMap, only non null Objects can be used as keys*
31 | *Note: `Ember.WeakMap` can be used interchangibly with the ES2015 WeakMap. This
32 | will allow us to eventually cut over entirely to the Native WeakMap.*
33 |
34 | # Motivation
35 |
36 | It is a common pattern to want to store private state about a specific object.
37 | When one stores this private state off-object, it can be tricky to understand
38 | when to release the state. When one stores this state on-object, it will be
39 | released when the object is released. Unfortunately, storing the state
40 | on-object without poluting the object itself is non-obvious.
41 |
42 | As it turns out, Ember's Meta already solves this problem for
43 | listeners/caches/chains/descriptors etc. Unfortunately today, there is no
44 | public API for apps or addons to utilize this. `Ember.WeakMap` aims to be
45 | exactly that API.
46 |
47 | Some examples:
48 |
49 | * https://github.com/offirgolan/ember-cp-validations/blob/master/addon/utils/cycle-breaker.js
50 | * https://github.com/stefanpenner/ember-state-services/ (will soon utilize the user-land polyfil of this) to prevent common leaks.
51 |
52 | # Detailed design
53 |
54 | ## Public API
55 |
56 | ```js
57 | import WeakMap from '@ember/weak-map'
58 |
59 | var private = new WeakMap();
60 | var object = {};
61 | var otherObject = {};
62 |
63 | private.set(object, {
64 | id: 1,
65 | name: 'My File',
66 | progress: 0
67 | }) === private;
68 |
69 | private.get(object) === {
70 | id: 1,
71 | name: 'My File',
72 | progress: 0
73 | });
74 |
75 |
76 | private.has(object) === true;
77 | private.has(otherObject) === false;
78 |
79 | private.delete(object) === private;
80 | private.has(object) === false;
81 | ```
82 |
83 | ## Implementation Details
84 |
85 | The backing store for `Ember.WeakMap` will reside in a lazy `ownMap` named
86 | `weak` on the key objects `__meta__` object.
87 |
88 | Each `WeakMap` has its own internal GUID, which will be the name of its slot,
89 | in the key objects meta weak bucket. This will allow one object to belong in
90 | multiple weakMaps without chance of collision.
91 |
92 | Concrete Implementation: https://github.com/emberjs/ember.js/pull/12224
93 | Polyfill: https://www.npmjs.com/package/ember-weakmap
94 |
95 | # Drawbacks
96 |
97 | * implementing bi-direction Weakness in userland is problematic.
98 | * Using WeakMap will insert a non-enumerable `meta` onto the key Object.
99 |
100 | # Alternatives
101 |
102 | * Weakness could be implemented in the other direction, but this has questionable utility.
103 |
104 | # Unresolved questions
105 |
106 | N/A
107 |
--------------------------------------------------------------------------------
/text/0272-deprecation-native-function-prototype-extensions.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2017-11-20T00:00:00.000Z
4 | release-date: 2019-03-11T00:00:00.000Z
5 | release-versions:
6 | ember-source: v3.11.0
7 |
8 | teams:
9 | - framework
10 | prs:
11 | accepted: https://github.com/emberjs/rfcs/pull/272
12 | project-link:
13 | meta:
14 | tracking: https://github.com/emberjs/rfc-tracking/issues/12
15 | ---
16 |
17 | # Deprecate Function.prototype.on, Function.prototype.observes and Function.prototype.property
18 |
19 | ## Summary
20 |
21 | This RFC proposes to deprecate `Function.prototype.on`,
22 | `Function.prototype.observes` and `Function.prototype.property`
23 |
24 | ## Motivation
25 |
26 | Ember has been moving away from extending native prototypes due to the confusion
27 | that this causes users: is it specifically part of Ember, or JavaScript?
28 |
29 | Continuing in that direction, we should consider recommending the usage of
30 | [`on` (`@ember/object/evented`)](https://emberjs.com/api/ember/2.18/classes/@ember%2Fobject%2Fevented/methods/on?anchor=on), [`observer` (`@ember/object`)](https://emberjs.com/api/ember/2.18/classes/@ember%2Fobject/methods/observer?anchor=observer) and [`computed` (`@ember/object`)](https://emberjs.com/api/ember/2.18/classes/@ember%2Fobject/methods/computed?anchor=computed) as opposed to their native
31 | prototype extension equivalents.
32 | We go from two ways to do something, to one.
33 |
34 | [`eslint-plugin-ember` already provides this as a rule](https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/no-function-prototype-extensions.md).
35 |
36 | ## Transition Path
37 |
38 | The replacement functionality already exists in the form of `on`, `observer`, and `computed`.
39 |
40 | We don't need to build anything new specifically, however, the bulk of the transition will be
41 | focused on deprecating the native prototype extensions.
42 |
43 | A codemod for this deprecation has to take into consideration that while `foo: function() { /* custom logic */ }.property('bar')` is a `Function.prototype` extension, `foo: observer(function () { /* some custom logic */ }).on('customEvent')` is not.
44 |
45 | ## How We Teach This
46 |
47 | On the deprecation guide, we can showcase the same example as above. We can explain why
48 | the proposal was necessary, followed by a set of examples highlighting the deprecated
49 | vs current style.
50 |
51 | Borrowing from the [ESLint plugin example](https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/no-function-prototype-extensions.md):
52 |
53 | ```js
54 | import { computed, observer } from '@ember/object';
55 | import { on } from '@ember/object/evented';
56 |
57 | export default Component.extend({
58 | // deprecated
59 | abc: function() { /* custom logic */ }.property('xyz'),
60 | def: function() { /* custom logic */ }.observe('xyz'),
61 | ghi: function() { /* custom logic */ }.on('didInsertElement'),
62 | jkl: function() { /* custom logic */ }.on('customEvent'),
63 |
64 | // current
65 | abc: computed('xyz', function() { /* custom logic */ }),
66 | def: observer('xyz', function() { /* custom logic */ }),
67 | didInsertElement() { /* custom logic */ }),
68 | jkl: on('customEvent', function() { /* custom logic */ }),
69 | });
70 | ```
71 |
72 | The official Guides currently [discourage the use of `Function.prototype` extensions](https://guides.emberjs.com/v2.17.0/configuring-ember/disabling-prototype-extensions/):
73 |
74 | > Function is extended with methods to annotate functions as computed properties,
75 | > via the property() method, and as observers, via the observes() method. Use of
76 | > these methods is now discouraged and not covered in recent versions of the Guides.
77 |
78 | After the deprecated code is removed from Ember, we need to remove the section
79 | about `Function` prototypes altogether.
80 |
81 | ## Alternatives
82 |
83 | None.
84 |
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 |
4 |
5 | # Propose {{RFC_NAME}}
6 |
7 |
10 |
11 | ## [Rendered](https://github.com/{{username}}/rfcs/blob/{{branch}}/text/{{rfc_number}}-{{rfc_slug}}.md)
12 |
13 | ## Summary
14 |
15 | This pull request is proposing a new RFC.
16 |
17 | To succeed, it will need to pass into the [Exploring Stage](https://github.com/emberjs/rfcs#exploring), followed by the [Accepted Stage](https://github.com/emberjs/rfcs#accepted).
18 |
19 | A Proposed or Exploring RFC may also move to the [Closed Stage](https://github.com/emberjs/rfcs#closed) if it is withdrawn by the author or if it is rejected by the Ember team. This requires an "FCP to Close" period.
20 |
21 | **An FCP is required before merging this PR to advance to Accepted.**
22 |
23 | Upon merging this PR, automation will open a draft PR for this RFC to move to the [Ready for Released Stage](https://github.com/emberjs/rfcs#ready-for-release).
24 |
25 |
26 | Exploring Stage Description
27 |
28 | This stage is entered when the Ember team believes the concept described in the RFC should be pursued, but the RFC may still need some more work, discussion, answers to open questions, and/or a champion before it can move to the next stage.
29 |
30 | An RFC is moved into Exploring with consensus of the relevant teams. The relevant team expects to spend time helping to refine the proposal. The RFC remains a PR and will have an `Exploring` label applied.
31 |
32 | An Exploring RFC that is successfully completed can move to [Accepted](https://github.com/emberjs/rfcs#accepted) with an FCP is required as in the existing process. It may also be moved to [Closed](https://github.com/emberjs/rfcs#closed) with an FCP.
33 |
34 |
35 |
36 | Accepted Stage Description
37 |
38 | To move into the "accepted stage" the RFC must have complete prose and have successfully passed through an "FCP to Accept" period in which the community has weighed in and consensus has been achieved on the direction. The relevant teams believe that the proposal is well-specified and ready for implementation. The RFC has a champion within one of the relevant teams.
39 |
40 | If there are unanswered questions, we have outlined them and expect that they will be answered before [Ready for Release](https://github.com/emberjs/rfcs#ready-for-release).
41 |
42 | When the RFC is accepted, the PR will be merged, and automation will open a new PR to move the RFC to the [Ready for Release](https://github.com/emberjs/rfcs#ready-for-release) stage. That PR should be used to track implementation progress and gain consensus to move to the next stage.
43 |
44 |
45 |
46 | ## Checklist to move to Exploring
47 |
48 | - [ ] The team believes the concepts described in the RFC should be pursued.
49 | - [ ] The label `S-Proposed` is removed from the PR and the label `S-Exploring` is added.
50 | - [ ] The Ember team is willing to work on the proposal to get it to Accepted
51 |
52 | ## Checklist to move to Accepted
53 |
54 | - [ ] This PR has had the `Final Comment Period` label has been added to start the FCP
55 | - [ ] The RFC is announced in #news-and-announcements in the Ember Discord.
56 | - [ ] The RFC has complete prose, is well-specified and ready for implementation.
57 | - [ ] All sections of the RFC are filled out.
58 | - [ ] Any unanswered questions are outlined and expected to be answered before Ready for Release.
59 | - [ ] "How we teach this?" is sufficiently filled out.
60 | - [ ] The RFC has a champion within one of the relevant teams.
61 | - [ ] The RFC has consensus after the FCP period.
62 |
--------------------------------------------------------------------------------
/text/0491-deprecate-disconnect-outlet.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2019-05-20T00:00:00.000Z
4 | release-date: 2021-05-03T00:00:00.000Z
5 | release-versions:
6 | ember-source: v3.27.0
7 |
8 | teams:
9 | - framework
10 | - learning
11 | prs:
12 | accepted: https://github.com/emberjs/rfcs/pull/491
13 | project-link:
14 | ---
15 |
16 | # Deprecate `disconnectOutlet`
17 |
18 | ## Summary
19 |
20 | This RFC deprecates `Route#disconnectOutlet` because it has no use case given [#418](https://github.com/emberjs/rfcs/pull/418).
21 |
22 | ## Motivation
23 |
24 | `Route#disconnectOutlet` is intended to be used in conjunction with `Route#render`. When we wrote [#418](https://github.com/emberjs/rfcs/pull/418) we should have also deprecated `Route#disconnectOutlet` because it is primarily used to teardown named outlets setup by `Route#render`. For all intensive this is just an addendum to #418.
25 |
26 | ## Transition Path
27 |
28 | The transition path is the same to the one outlined in [#418](https://github.com/emberjs/rfcs/blob/master/text/0418-deprecate-route-render-methods.md#transition-path). Since the migration path for the named outlets is to use components, a developer would need to wrap the component in a conditional if they want to control the destruction.
29 |
30 | Given:
31 |
32 | ```js
33 | // app/routes/checkout.js
34 |
35 | class CheckoutRoute extends Route {
36 | // ...
37 |
38 | @action
39 | showModal() {
40 | this.render('modal', {
41 | outlet: 'modal',
42 | into: 'application'
43 | });
44 | }
45 |
46 | @action
47 | hideModal() {
48 | this.disconnectOutlet('modal');
49 | }
50 | }
51 | ```
52 |
53 | ```hbs
54 | {{! app/templates/checkout.hbs}}
55 |
56 |
57 |
58 | ```
59 |
60 | ```hbs
61 | {{! app/templates/application.hbs}}
62 | {{outlet "modal"}}
63 |
64 |
65 | {{outlet}}
66 |
67 | ```
68 |
69 | This can transitioned to:
70 |
71 | ```js
72 | // app/controller/checkout.js
73 |
74 | class CheckoutController extends Controller {
75 | // ...
76 | @tracked isModalOpen = false;
77 |
78 | init() {
79 | super.init();
80 | this.modalElement = document.getElementById('modal');
81 | }
82 |
83 | @action
84 | showModal() {
85 | this.isModalOpen = true;
86 | }
87 |
88 | @action
89 | closeModal() {
90 | this.isModalOpen = false;
91 | }
92 | }
93 | ```
94 |
95 | ```hbs
96 | {{! app/templates/checkout.hbs}}
97 |
98 |
99 |
100 |
101 | {{#if this.isModalOpen}}
102 | {{#in-element this.modalElement}}
103 |
104 | {{/in-element}}
105 | {{/if}}
106 | ```
107 |
108 | ```hbs
109 | {{! app/templates/application.hbs}}
110 |
111 |
112 |
113 | {{outlet}}
114 |
115 | ```
116 |
117 | The above example will conditionally append the modal component into `div#modal` whenever the user toggles the modal.
118 |
119 | ## How We Teach This
120 |
121 | Once deprecated, developers will be presented with the following deprecation warning:
122 |
123 | ```
124 | "disconnectOutlet" has been deprecated for disconnecting outlets.
125 | ```
126 |
127 | This deprecation message will also link to the transition guide. The transition guide will cover how to migrate named outlets to components. In addition, the guides should be updated to remove any usage of these APIs.
128 |
129 | ## Drawbacks
130 |
131 | N/A. This addendum to [#418](https://github.com/emberjs/rfcs/pull/418).
132 |
133 | ## Alternatives
134 |
135 | N/A. This addendum to [#418](https://github.com/emberjs/rfcs/pull/418).
136 |
137 | ## Unresolved questions
138 |
139 | > Optional, but suggested for first drafts. What parts of the design are still
140 | TBD?
141 |
--------------------------------------------------------------------------------
/text/0329-deprecated-ember-evented-in-ember-data.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2018-05-01T00:00:00.000Z
4 | release-date: 2019-09-20T00:00:00.000Z
5 | release-versions:
6 | ember-data: v3.13.0
7 |
8 | teams:
9 | - data
10 | prs:
11 | accepted: https://github.com/emberjs/rfcs/pull/329
12 | project-link:
13 | meta:
14 | tracking: https://github.com/emberjs/rfc-tracking/issues/21
15 | ---
16 |
17 | # Deprecate Usage of Ember Evented in Ember Data
18 |
19 | ## Summary
20 |
21 | `Ember.Evented` functionality on `DS.Model`, `DS.ManyArray`,
22 | `DS.Errors`, `DS.RecordArray`, and `DS.PromiseManyArray` will be
23 | deprecated and eventually removed in a future release. This includes
24 | the following methods from the
25 | [Ember.Evented](https://www.emberjs.com/api/ember/2.15/classes/Ember.Evented/methods/on?anchor=off)
26 | class: `has`, `off`, `on`, `one`, and `trigger`. Additionally the
27 | following lifecycle methods on `DS.Model` will also be deprecated:
28 | `becameError`, `becameInvalid`, `didCreate`, `didDelete`, `didLoad`,
29 | `didUpdate`, `ready`, `rolledBack`.
30 |
31 | ## Motivation
32 |
33 | The use of `Ember.Evented` is mostly a legacy from the pre 1.0 days of
34 | Ember Data when events were a core part of the Ember Data programming
35 | model. Today there are better ways to do everything that once needed
36 | events. Removing the usage of the `Ember.Evented` mixin will make it
37 | easier for Ember Data to eventually transition to using native ES2015
38 | JavaScript classes and will reduce the surface area of APIs that Ember
39 | Data must support in the long term.
40 |
41 | ## Detailed design
42 |
43 | `Ember.Evented` mixin will be scheduled to be removed from the
44 | following classes in a future Ember Data release: `DS.Model`,
45 | `DS.ManyArray`, `DS.Errors`, `DS.RecordArray`, and
46 | `DS.PromiseManyArray`.
47 |
48 | The `has`, `off`, `on`, `one`, and `trigger` methods will be trigger a
49 | deprecation warning when called and will be completly in a future
50 | Ember Data release.
51 |
52 | A special deprecation will be logged when users of a
53 | `DS.adapterPopulatedRecordArray` attempt to listen to the `didLoad`
54 | event. This depecations will prompt users to use a computed property
55 | instead of the `didLoad` event.
56 |
57 | `DS.Model` will also recieve deprecation warnings when a model is
58 | defined with the following methods: `becameError`, `becameInvalid`,
59 | `didCreate`, `didDelete`, `didLoad`, `didUpdate`, `ready`,
60 | `rolledBack`.
61 |
62 | When a model is instantiated for the first time with any of these
63 | methods a deprecation warning will be logged notifiying the user that
64 | this method will be deprecated and the user should use an computed or
65 | overide the model's init method instead.
66 |
67 | ## How we teach this
68 |
69 | Today we do not teach the use of any of the Ember Data lifecycle
70 | events in the guides. They are referenced in the API docs but they
71 | will be updated to mark the APIs as deprecated and show alternative
72 | examples of how to achieve the same functionality using a non event
73 | pattern.
74 |
75 | The deprecation guide app will be updated with examples showing how to
76 | migrate away from an evented pattern to using a computed or imperative
77 | method to achieve the same results.
78 |
79 | ## Drawbacks
80 |
81 | The drawback to making this change is existing code that takes
82 | advantage of the Ember Data lifecycle events will need to be updated
83 | to use a different pattern.
84 |
85 | ## Alternatives
86 |
87 | We could leave the `Ember.Evented` mixin on all of the Ember Data
88 | objects that currently support it and continue to support this
89 | interface for the foreseeable future. However, Ember Data itself
90 | doesn't require these events internally. There is only one place in
91 | the `DS.Error` code that takes advantage of the `Ember.Evented` system
92 | and that code can be easilly re-written to avoid `Ember.Evented` APIs.
93 |
94 | ## Unresolved questions
95 |
96 | None
97 |
--------------------------------------------------------------------------------
/text/0463-record-data-state.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: accepted # FIXME: This may be a further stage
3 | start-date: 2019-03-13T00:00:00.000Z
4 | release-date:
5 | release-versions:
6 | teams:
7 | - data
8 | prs:
9 | accepted: https://github.com/emberjs/rfcs/pull/463
10 | project-link:
11 | meta:
12 | tracking: https://github.com/emberjs/rfc-tracking/issues/47
13 | ---
14 |
15 | # Record State on Record Data RFC
16 |
17 |
18 | ## Summary
19 |
20 | This RFC is a follow-up RFC for #293 RecordData.
21 |
22 | Add `isNew` , `isDeleted` and `isDeletionPersisted` methods on Record Data that expose information about newly created and deleted states on the record
23 |
24 | ## Motivation
25 |
26 | RecordData handles managing local and server state for records. While the current API surface of RecordData handles most data wrangling needs, as we have used RD internally in ED and in addons we have repeatedly run into the need of knowing whether a record is in a new or a deleted state. The initial version of Record Data made the choice to not expose state information in order to limit the scope of the RFC and to give us time to come up with a design.
27 |
28 | ## Detailed design
29 |
30 | Add the following methods on the RecordData interface:
31 |
32 | ```ts
33 | interface RecordData {
34 |
35 | // To be added in this RFC
36 | isNew(identifier: RecordIdentifier): boolean
37 |
38 | isDeleted(identifier: RecordIdentifier): boolean
39 |
40 | isDeletionCommitted(identifier: RecordIdentifier): boolean
41 |
42 | setIsDeleted(identifier: RecordIdentifier, boolean: isDeleted): void
43 | }
44 | ```
45 |
46 | `isNew` should return true if and only if the record with the given identifier was created on the client side (via clientDidCreate) and not successfully committed on the server, otherwise false.
47 |
48 | `isDeleted` should return true if and only if the record has been marked for deletion on the client side, otherwise false
49 |
50 | `isDeletionPersisted` should return true if and only if the record had been marked for deletion and that deletion has been successfully persisted, otherwise false.
51 |
52 | The TS interface for the all of Record Data with the new methods can be be found [here](https://github.com/emberjs/data/blob/igor/record-data-state-interface/packages/store/addon/-private/ts-interfaces/record-data.ts#L13).
53 |
54 | In order to notify changes to the state flags we would also add a notification method to the store wrapper which is passed to RecordData:
55 |
56 | ```ts
57 | interface RecordDataStoreWrapper {
58 | notifyStateChange(identifier: RecordIdentifier, key: 'isNew' | 'isDeleted' | 'isDeletionPersisted');
59 | }
60 | ```
61 |
62 | Which would bring Record Data Store Wrapper to look like:
63 |
64 | ```ts
65 | export interface RecordDataStoreWrapper {
66 | // This rfc
67 | notifyStateChange(identifier: RecordIdentifier, key: 'isNew' | 'isDeleted' | 'isDeletionPersisted');
68 |
69 | // Existing
70 | notifyAttributeChange(identifier: RecordIdentifier, key: string);
71 | notifyRelationshipChange(identifier: RecordIdentifier, key: string);
72 | notifyErrorsChange(identifier: RecordIdentifier, key: string);
73 |
74 | relationshipsDefinitionFor(identifier: RecordIdentifier): RelationshipsSchema
75 | attributesDefinitionFor(identifier: RecordIdentifier): AttributesSchema
76 | setRecordId(identifier: RecordIdentifier, id: string);
77 | disconnectRecord(identifier: RecordIdentifier);
78 | isRecordInUse(identifier: RecordIdentifier): boolean;
79 | }
80 | ```
81 |
82 | Currently calling `rollbackAttributes` rolls back `isDeleted` to a non deleted state. This logic would be the responsibility of Record Data to implement.
83 |
84 | ## How we teach this
85 | We currently do not have a comprehensive way to teach RecordData api. This RFC will be tought alongisde the rest of upcoming Record Data docs.
86 |
87 |
88 | ## Alternatives
89 |
90 | Instead of separate methods, have a single methods, somehting like `getState` that returns a POJO with keys like
91 |
92 | { isDeleted: true, isNew: false }
93 |
--------------------------------------------------------------------------------
/text/0139-isHtmlSafe.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2016-04-18T00:00:00.000Z
4 | release-date: 2016-09-08T00:00:00.000Z
5 | release-versions:
6 | ember-source: v2.8.0
7 |
8 | teams:
9 | - framework
10 | prs:
11 | accepted: https://github.com/emberjs/rfcs/pull/139
12 | project-link:
13 | meta:
14 | ember-issue: https://github.com/emberjs/ember.js/pull/13666
15 | ---
16 |
17 | # Summary
18 |
19 | Introduce `Ember.String.isHtmlSafe()` to provide a reliable way to determine if an object is an "html safe string", i.e. was it created with `Ember.String.htmlSafe()`.
20 |
21 |
22 | # Motivation
23 |
24 | Using `new Ember.Handlebars.SafeString()` is slated for deprecation. Many people are currently using the following snippet as
25 | a mechanism of type checking: `value instanceof Ember.Handlebars.SafeString`. Providing `isHtmlSafe` offers a
26 | cleaner method of detection. Beyond that, the aforementioned test is a bit leaky. It requires the developer to understand
27 | `htmlSafe` returns a `Ember.Handlerbars.SafeString` instance and thus limits Ember's ability to change
28 | `htmlSafe` without further breaking it's API.
29 |
30 | Based on our app at Batterii and some research on Github, I see two valid use cases for introducing this API.
31 |
32 | First, and most commonly, is to make it possible to test addon helpers that are expected to return a safe string. I believe this test on ember-i18n says it all: ["returns HTML-safe string"](https://github.com/jamesarosen/ember-i18n/blob/master/tests/unit/utils/i18n/default-compiler-test.js#L56-L59).
33 |
34 | The second use case is to do type checking. In our app, we have an `isString` utility that is effectively:
35 |
36 | ```javascript
37 | import Ember from 'ember';
38 |
39 | export default function(value) {
40 | return typeof value === 'string' || value instanceof Ember.Handlebars.SafeString;
41 | }
42 | ```
43 |
44 | Newer versions of ember-i18n, doing `this.get('i18n').t('someTranslatedValue')` will return a safe string. Thus our `isString` utility has to consider that.
45 |
46 |
47 | # Detailed design
48 |
49 | `isHtmlSafe` will be added to the `Ember.String` module. The implementation will basically be:
50 |
51 | ```javascript
52 | function isHtmlSafe(str) {
53 | return str && typeof str.toHTML === 'function';
54 | }
55 | ```
56 |
57 | It will be used as follows:
58 |
59 | ```javascript
60 | if (Ember.String.isHtmlSafe(str)) {
61 | str = str.toString();
62 | }
63 | ```
64 |
65 |
66 | # Transition Path
67 |
68 | As part of landing `isHtmlSafe` we will simultaneously re-deprecate `Ember.Handlebars.SafeString`. This deprecation will
69 | take care to ensure that `str instanceof Ember.Handlebars.SafeString` still passes so that we can continue to
70 | maintain backwards compatibility.
71 |
72 | Additionally, a polyfill will be implemented to help provide forward compatibility for addon maintainers and others
73 | looking to get a head while still on older versions of Ember. Similar to [ember-getowner-polyfill](https://github.com/rwjblue/ember-getowner-polyfill).
74 |
75 |
76 | # How We Teach This
77 |
78 | I think we'll continue to refer to these strings as "html safe strings". This RFC does not
79 | introduce any new concepts, rather it builds on an existing concept.
80 |
81 | I don't believe this feature will require guide discussion. I think API Docs will suffice.
82 |
83 | The concept of type checking is a pretty common programming idiom. It should be relatively self
84 | explanatory.
85 |
86 |
87 | # Drawbacks
88 |
89 | The only drawback I see is that it expands the surface of the API and it takes a step
90 | towards prompting "html safe string" as a thing.
91 |
92 |
93 | # Alternatives
94 |
95 | An alternative would be to expose `Ember.Handlerbars.SafeString` publicly once again. Users
96 | could revert back to using `instanceof` as their type checking mechanism.
97 |
98 |
99 | # Unresolved questions
100 |
101 | There are no unresolved questions at this time.
102 |
--------------------------------------------------------------------------------
/text/0702-eslint-plugin-qunit.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2021-01-09T00:00:00.000Z
4 | release-date: 2021-06-25T00:00:00.000Z
5 | release-versions:
6 | ember-cli: v3.27.0
7 |
8 | teams:
9 | - cli
10 | prs:
11 | accepted: https://github.com/emberjs/rfcs/pull/702
12 | project-link:
13 | ---
14 |
15 | # Add eslint-plugin-qunit to ember-cli blueprint
16 |
17 | ## Summary
18 |
19 | This RFC proposes adding [eslint-plugin-qunit](https://github.com/platinumazure/eslint-plugin-qunit) to the blueprints
20 | that back `ember new` and `ember addon`.
21 |
22 | ## Motivation
23 |
24 | Ember apps and addons already come with a number of linting plugins targeting various areas of the code:
25 |
26 | * ember-template-lint - handlebars best practices
27 | * eslint - general JavaScript best practices
28 | * eslint-plugin-ember - Ember best practices
29 | * eslint-plugin-node - Node best practices
30 | * prettier - automatic styling (as a result of a recent [RFC](https://github.com/emberjs/rfcs/blob/master/text/0628-prettier.md))
31 |
32 | But there's an important aspect of Ember apps that is not yet targeted by specialized linting: testing. Test code can easily make up half of the code in an Ember app, and well-written tests are of course critical to application quality.
33 |
34 | [QUnit](https://qunitjs.com/) is the default testing framework used by Ember apps and the good news is that a popular and mature QUnit linting plugin is available for it: eslint-plugin-qunit. This plugin has been around for five years and is used in thousands of applications including many Ember applications. It has over 30 rules for enforcing best testing practices and detecting broken or incorrectly-written tests.
35 |
36 | ## Detailed design
37 |
38 | The general idea is that we will update the `app` and `addon` blueprints to add the eslint-plugin-qunit package to the `package.json`, and update the linting configuration to extend the new presets.
39 |
40 | ### Packages
41 |
42 | The following packages will be added to the `package.json` of both `app` and `addon` blueprints:
43 |
44 | * [eslint-plugin-qunit](https://www.npmjs.com/package/eslint-plugin-qunit)
45 |
46 | ### Configuration Changes
47 |
48 | The `.eslintrc.js` that is generated will be updated to extend the `qunit` linting configurations.
49 |
50 | This change will be limited to test files only using an override, similar to how Node linting is limited to Node files only with an override. Using an override to scope linting to specific files provides additional protection against unwanted impacts (i.e. false positives or performance hits).
51 |
52 | ```js
53 | {
54 | overrides: [
55 | ...,
56 | {
57 | files: ['tests/**/*'],
58 | extends: ['plugin:qunit/recommended', 'plugin:qunit/two'],
59 | },
60 | ],
61 | }
62 | ```
63 |
64 | ## How we teach this
65 |
66 | We do not currently discuss linting in either guides.emberjs.com or cli.emberjs.com.
67 |
68 | Users will be able to find documentation for the new rules on the [eslint-plugin-qunit](https://github.com/platinumazure/eslint-plugin-qunit) GitHub page. Many IDEs will provide a link directly to the rule documentation on highlighted lint violations.
69 |
70 | Any violations of the new rules will be detected by `yarn lint` and in some cases autofixed by `yarn lint:fix`.
71 |
72 | ## Drawbacks
73 |
74 | For those introducing eslint-plugin-qunit to an existing codebase, the largest drawback is generally the initial cost of fixing linting violations. This can be mitigated by individually disabling noisy lint rules and working to fix violations overtime. But note that this RFC is more likely to impact newly-generated applications where there will be no existing lint violations to fix as opposed to existing applications.
75 |
76 | In rare cases, users may be using an alternative testing framework like Mocha or Jest, and they can safely ignore or remove eslint-plugin-qunit.
77 |
78 | ## Alternatives
79 |
80 | The implementation is straightforward and there are no known alternative implementations for adding more test-oriented linting.
81 |
--------------------------------------------------------------------------------
/text/0645-add-ember-page-title-addon.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2020-06-24T00:00:00.000Z
4 | release-date: 2021-01-05T00:00:00.000Z
5 | release-versions:
6 | ember-cli: v3.24.0
7 |
8 | teams:
9 | - cli
10 | prs:
11 | accepted: https://github.com/emberjs/rfcs/pull/645
12 | project-link:
13 | meta:
14 | authors: Benjamin Jegard, Melanie Sumner, Ricardo Mendes
15 | ---
16 |
17 | # Add ember-page-title to the app blueprint
18 |
19 | ## Summary
20 |
21 | Add [`ember-page-title`](https://github.com/adopted-ember-addons/ember-page-title) to the default blueprint for new Ember apps as a way to provide improved out-of-the-box (OOB) accessibility for Ember applications.
22 |
23 | ## Motivation
24 |
25 | This RFC is part of the work made by the Ember.js Accessibility Strike Team to ensure that newly created ember apps have no accessibility issues.
26 |
27 | Users with assistive technology rely on the page title to know if they are on the correct page of a website.
28 | Adding this addon will provide developers a simple solution to achieve the [WCAG Success Criterion 2.4.2: Page Titled](https://www.w3.org/WAI/WCAG21/Understanding/page-titled.html).
29 |
30 | While there're other addons that provide the same capabilities it has been decided to go with [`ember-page-title`](https://github.com/adopted-ember-addons/ember-page-title) because it's the most aligned with the current and future direction taken Ember, which is the template-based solution.
31 |
32 | ## Detailed design
33 |
34 | 1. Make [`ember-page-title`](https://github.com/adopted-ember-addons/ember-page-title) an official Ember addon by transferring `ember-page-title` repo to the [Ember CLI org](https://github.com/ember-cli) (it's currently in the [Adopted Ember Addons org](https://github.com/adopted-ember-addons))
35 | 2. Add the dependency to the app blueprint here: https://github.com/ember-cli/ember-cli/blob/master/blueprints/app/files/package.json#L19
36 | 4. Update route blueprint to include `{{page-title RouteName}}` at the top of the route [template.hbs](https://github.com/emberjs/ember.js/blob/master/blueprints/route/native-files/__root__/__templatepath__/__templatename__.hbs) (this [template.hbs](https://github.com/emberjs/ember.js/blob/master/blueprints/route/files/__root__/__templatepath__/__templatename__.hbs) too) where `RouteName` is the name of the route provided to the `ember generate route` command
37 |
38 | ## How we teach this
39 |
40 | - Update the "Page Title" section in [Page Template Considerations](https://guides.emberjs.com/release/accessibility/page-template-considerations) to use `ember-page-title`.
41 | - Update code examples in [Building Pages](https://guides.emberjs.com/release/tutorial/part-1/building-pages/) to include uses of `{{page-title}}`. Also explain that updating the page title with the current page name will help users with assistive technology locate themself on the website.
42 | - Update [ember-welcome-page](https://github.com/ember-cli/ember-welcome-page) addon and [WelcomePage](https://github.com/ember-cli/ember-welcome-page/blob/master/addon/templates/components/welcome-page.hbs) component to explain the contents of the fresh project a bit better. The component should explain the presence of `{{page-title}}` and link to the "Page Title" section in [Page Template Considerations](https://guides.emberjs.com/release/accessibility/page-template-considerations)
43 |
44 | ## Drawbacks
45 |
46 | - An additional dependency to new projects. But, no noticeable size differences it's only all +10kb of js for production builds (not gzipped, ~2kb js gzipped)
47 | - Add an extra helper `{{page-title}}` (possible name clashing)
48 | - Slightly increases the learning curve. Increases the amount of code in a first-starter project, which could become overwhelming.
49 | - The addon will have to be maintained by the [Ember CLI org](https://github.com/ember-cli)
50 |
51 | ## Alternatives
52 |
53 | N/A
54 |
55 | ## Unresolved questions
56 |
57 | None
58 |
59 | ## References
60 |
61 | - [WCAG Success Criterion 2.4.2: Page Titled](https://www.w3.org/WAI/WCAG21/Understanding/page-titled.html)
62 |
--------------------------------------------------------------------------------
/text/0796-ember-data-deprecate-rsvp.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: accepted
3 | start-date: 2022-02-20T00:00:00.000Z
4 | release-date:
5 | release-versions:
6 | teams:
7 | - data
8 | prs:
9 | accepted: https://github.com/emberjs/rfcs/pull/796
10 | project-link:
11 | ---
12 |
13 | # Deprecate `RSVP.Promise` for native Promise
14 |
15 | ## Summary
16 |
17 | All methods currently returning an `RSVP.Promise` will return a native Promise. In addition, all documentation will be updated accordingly.
18 |
19 | ## Motivation
20 |
21 | With the removal of IE11 from our build infrastructure and browser requirements, we can now safely remove `RSVP.Promise`. From the [docs](https://github.com/tildeio/rsvp.js/):
22 |
23 | > Specifically, it is a tiny implementation of Promises/A+. It works in node and the browser (IE9+, all the popular evergreen ones).
24 |
25 | RSVP was Ember's polyfill since an early v1.0.0 version during a time when native Promises didn't exist in any browser. In addition, Promises have been supported since Node 0.12.
26 |
27 | By removing `RSVP.Promise` in favor of native Promises, we can drop an unnecessary dependency for both client side and server side fetching of data.
28 |
29 | According to [bundlephobia](https://bundlephobia.com/package/rsvp@4.8.5), this would allow us to remove a significant chunk of dependency weight.
30 |
31 | ## Detailed design
32 |
33 | Two steps will be required to fulfill deprecating `RSVP.Promise`.
34 |
35 | First, we will issue a deprecation `DEPRECATE_RSVP_PROMISE` to async callbacks that might be relying on a convenient feature of `RSVP.Promise`. Namely, an `RSVP.Promise` may still be hanging by the time the underlying model instance or store has been destroyed. This will help users surface instances where their test suite or code is dealing with dangling promises. After the removal of this deprecation, this will throw an Error.
36 |
37 | - `id: ember-data:rsvp-unresolved-async`
38 |
39 | Second, we will also utilize the deprecation to replace all instances of `RSVP.Promise` with native Promises.
40 |
41 | The final implementation will look something like:
42 |
43 | ```js
44 | ajax(options) {
45 | if (DEPRECATE_RSVP_PROMISE) {
46 | return new Promise((resolve, reject) => {
47 | ...
48 | });
49 | } else {
50 | return new RSVPPromise((resolve, reject) => {
51 | ...
52 | });
53 | }
54 | },
55 | ```
56 |
57 | ## How we teach this
58 |
59 | We do not believe this requires any update to the Ember curriculum. API documentation may be needed to remove traces of `RSVP.Promise`.
60 |
61 | See the informal [docs](https://github.com/emberjs/data/blob/fa18fd148e9881a860343eabf0ba15b6f048c3ea/packages/private-build-infra/addon/current-deprecations.ts) on how to configure your compatibility with ember-data deprecations.
62 |
63 | ## Drawbacks
64 |
65 | For users relying on `RSVP.onerror`, they will have to either refactor their code to set the global Promise to RSVP or configure [onunhandledrejection](https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onunhandledrejection) appropriately.
66 |
67 | If users continue to use `rsvp` after it is dropped from ember-data, users can add `rsvp` to their package.json explicitly if they were depending on it transitively.
68 |
69 | Lastly, RSVP gives meaningful labels so that the promise can be debugged easily. We may need to take this into account with a native Promise wrapper, especially how it interacts with the Ember Inspector.
70 |
71 | ## Alternatives
72 |
73 | Continue resolving async paths with `RSVP.Promise` will allowing users a convenient override to use native Promises.
74 |
75 | ## Unresolved questions
76 |
77 | - What level of an abstraction should we provide over native Promise. Derived state for `isPending`, `isResolved`, and `isRejected` seem like probable derived state we want to expose to users to avoid significant churn in their codebase.
78 | - Consideration of Ember's continued use of RSVP.
79 | - After scanning the codebase, the non native equivalent methods we use from RSVP is `defer` in test files. This is an implementation detail that doesn't need to be flushed out here.
80 |
--------------------------------------------------------------------------------
/text/0392-deprecate-component-manager-string-lookup.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: accepted # FIXME: This may be a further stage
3 | start-date: 2018-10-23T00:00:00.000Z
4 | release-date: # FIXME
5 | release-versions: # FIXME
6 | teams:
7 | - framework
8 | prs:
9 | accepted: https://github.com/emberjs/rfcs/pull/392
10 | project-link:
11 | ---
12 |
13 | # Summary
14 |
15 | This deprecates the string-based lookup API for associating a custom component manager with a corresponding base class.
16 |
17 | ```js
18 | import EmberObject from '@ember/object';
19 | import { setComponentManager } from '@ember/component';
20 |
21 | export default setComponentManager('basic', EmberObject.extend({
22 | //...
23 | }))
24 | ```
25 |
26 | Instead, you must pass a factory function that produces an instance of the custom manager:
27 |
28 | ```js
29 | import EmberObject from '@ember/object';
30 | import { createManager } from './basic-manager';
31 | import { setComponentManager } from '@ember/modifier';
32 |
33 | export default setComponentManager(createManager, EmberObject.extend({
34 | // ...
35 | }));
36 | ```
37 |
38 | Where `createManager` is:
39 |
40 | ```js
41 | export function createManager(owner) {
42 | return new BasicManager(owner);
43 | }
44 | ```
45 |
46 | # Motivation
47 |
48 | There are several motivators:
49 |
50 | - A string-based API is not friendly when it comes to tree shaking. It would force us into creating a compiler to turn the string into a symbol that build tools like Rollup and Webpack could analyze.
51 | - This API expands the namespacing problems associated with module unification. Specifically, an addon author would have to associate the package name with the string, similar to how [RFC#367](https://github.com/mixonic/rfcs/blob/mu-packages/text/0000-module-unification-packages.md#explicit-packages-for-service-injections) proposes changes to services.
52 | - `setModifierManager` as introduced by [RFC#373](https://github.com/emberjs/rfcs/blob/89349d30ade24303a06448bc121b8fd810cbe58d/text/0373-Element-Modifier-Managers.md#determining-which-modifier-manager-to-use) uses a factory style API. This RFC intends to align these to function signatures.
53 | - We want to make sure this API is compatible with the binary AoT compilation work we did in the Glimmer-VM.
54 |
55 | # Transition Path
56 |
57 | We can transition away by producing a factory function in the internals of `setupComponentManager`. The implementation would look something like:
58 |
59 | ```js
60 | export function setComponentManager(stringOrFunction, obj: any) {
61 | let factory;
62 | if (typeof stringOrFunction === 'string') {
63 | deprecate(
64 | `Passing the name of the component manager to 'setupComponentManager' is deprecated. Please pass a function that produces an instance of the manager.`,
65 | {
66 | id: 'deprecate-string-based-component-manager',
67 | unil: '4.0.0'
68 | }
69 | );
70 | factory = function(owner: Owner) {
71 | return owner.lookup(`component-manager:${stringOrFunction}`);
72 | };
73 | } else {
74 | factory = stringOrFunction;
75 | }
76 |
77 | // ...
78 | }
79 |
80 | ```
81 |
82 | # How We Teach This
83 |
84 | From our understanding this API has very limited usage as it is a low-level API. We should update that docs accordingly.
85 |
86 | # Drawbacks
87 |
88 | Historically, Ember has given developers base classes that the developer would extend from and Ember would create instances on your behalf. This allows the framework to know that the interface of the object is complete. With this approach we are relying more on the addon author to construct the object and ensure it conforms to the correct interface.
89 |
90 | Generally speaking this a good practice of OOP but due to the fact that JavaScript does not have first-class interfaces, Ember has taken the concretion approach.
91 |
92 | # Alternatives
93 |
94 | Instead of passing a factory function we could pass the class itself. This option does have the issue of Ember needing to know how to construct the class and does not allow for the addon author to perform any dependency injections.
95 |
96 | # Unresolved questions
97 |
98 | TBD?
99 |
--------------------------------------------------------------------------------
/text/0449-deprecate-partials.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2019-02-17T00:00:00.000Z
4 | release-date: 2019-12-09T00:00:00.000Z
5 | release-versions:
6 | ember-source: v3.15.0
7 |
8 | teams:
9 | - framework
10 | - learning
11 | prs:
12 | accepted: https://github.com/emberjs/rfcs/pull/449
13 | project-link:
14 | meta:
15 | tracking: https://github.com/emberjs/rfc-tracking/issues/38
16 | ---
17 |
18 | # Deprecate `{{partial}}`
19 |
20 | ## Summary
21 |
22 | Partials are an old Ember construct that have no benefits and many downsides when compared to modern Ember components. We should deprecate them in favor of components.
23 |
24 | ## Motivation
25 |
26 | Partials have a number of downsides when compared with components:
27 |
28 | - They are hard to reason about as they inherit the scope of the calling template
29 | - They perform poorly in comparison to components
30 |
31 | Partials should have no place in modern Ember applications, components should always be preferred.
32 |
33 | Once removed, Ember's API will become smaller and more consistent.
34 |
35 | ## Detailed design
36 |
37 | We'll create an AST transform in [`packages/ember-template-compiler`](https://github.com/emberjs/ember.js/tree/master/packages/ember-template-compiler) which will emit a deprecation warning for all uses of `{{partial}}`. The deprecation warning will be:
38 |
39 | ```
40 | Using `{{partial}}` is deprecated, please use a component instead.
41 | ```
42 |
43 | This message will link to the following deprecation details which aim to give clear guidance on how to migrate to component:
44 |
45 | ---
46 |
47 | The use of `{{partial}}` has been deprecated, you should replace the partial with a component as follows:
48 |
49 | Let's consider a simple example of a `partials/quick-tip` partial being invoked from the `application.hbs` template:
50 |
51 | `app/templates/application.hbs`
52 |
53 | ```hbs
54 | {{#let (hash title="Don't use partials" body="Components are always better") as |tip|}}
55 | {{partial "partials/quick-tip"}}
56 | {{/let}}
57 | ```
58 |
59 | `app/templates/partials/quick-tip.hbs`
60 |
61 | ```hbs
62 |
Tip: {{tip.title}}
63 |
{{tip.body}}
64 |
65 | ```
66 |
67 | Here's the same template code after migrating the `partials/quick-tip` partial to be a component.
68 |
69 | `app/templates/application.hbs`
70 |
71 | ```hbs
72 | {{#let (hash title="Don't use partials" body="Components are always better") as |tip|}}
73 |
74 | {{/let}}
75 | ```
76 |
77 | `app/templates/components/quick-tip.hbs`
78 |
79 | ```hbs
80 |
Tip: {{@tip.title}}
81 |
{{@tip.body}}
82 |
83 | ```
84 |
85 | ---
86 |
87 | A codemod, while not necessary for this RFC to land, would greatly simplify the migration of partials to components. We should endeavor to create this codemod as part of efforts to implement this RFC. The codemod might work as follows:
88 |
89 | * Examine each partial template to recognize which properties originate from the caller scope
90 | * Generate a component to replace each partial
91 | * Replace each `{{partial "foo-bar"}}` invocation with a component invocation, passing arguments as required
92 | * Delete the partial handlebars files
93 |
94 | If we do implement a codemod, we should mention it in the deprecation details above.
95 |
96 | ## How we teach this
97 |
98 | We'll mentiton the deprecation in an Ember point release blog post.
99 |
100 | The deprecation message will contain a link to clear guidelines on how to migrate from a `{{partial}}` to a component. See the section above beginning with "The use of `{{partial}}` has been deprecated..." for the content.
101 |
102 | There are no changes to make to the Ember.js guides, since mentions of `{{partial}}` were removed in 2.x guides.
103 |
104 | ## Drawbacks
105 |
106 | This adds a little churn to Ember's API.
107 |
108 | ## Alternatives
109 |
110 | We could do nothing and leave things as is.
111 |
112 | ## Unresolved questions
113 |
114 | None
115 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE/advance-to-recommended.md:
--------------------------------------------------------------------------------
1 | # Advance #__RFC_NUMBER__ to the [Recommended Stage](https://github.com/emberjs/rfcs#recommended)
2 |
3 | ## [Rendered](__RFC_RENDERED_URL__)
4 |
5 | ## Summary
6 |
7 | This pull request is advancing the RFC to the [Recommended Stage](https://github.com/emberjs/rfcs#recommended).
8 |
9 | - PR to Accepted Stage: #__RFC_NUMBER__
10 | - [PR to Ready For Release Stage](__READY_FOR_RELEASE_PR__)
11 | - [PR to Released Stage](__RELEASED_PR__)
12 |
13 | **An FCP is required before merging this PR to advance.**
14 |
15 |
16 |
17 | Recommended Stage Summary
18 |
19 | The "Recommended" stage is the final milestone for an RFC. It provides a signal to the wider community to indicate that a feature has been put through its ecosystem paces and is ready to use.
20 |
21 | To reach the "Recommended" stage, the following should be true:
22 |
23 | If appropriate, the feature is integrated into the tutorial and the guides prose. API documentation is polished and updates are carried through to other areas of API docs that may not directly pertain to the feature.
24 |
25 | If the proposal replaces an existing feature, the addon ecosystem has largely updated to work with both old and new features.
26 |
27 | If the proposal updates or replaces an existing feature, high-quality codemods are available.
28 |
29 | If needed, Ember debugging tools as well as popular IDE support have been updated to support the feature.
30 |
31 | If the feature is part of a suite of features that were designed to work together for best ergonomics, the other features are also ready to be "Recommended".
32 |
33 | Any criteria for "Recommended" for this proposal that were established in the Ready For Release stage have been met.
34 |
35 | An FCP is required to enter this stage. Multiple RFCs may be moved as a batch into "Recommended" with the same PR.
36 |
37 |
38 | ## Checklist to move to Recommended
39 |
40 | - [ ] **Criteria specific to this feature:** Any additional criteria for "Recommended" for this proposal that were established in the Ready For Release stage have been met.
41 | - [ ] **Tutorial:** If appropriate, the feature is integrated into the tutorial.
42 | - [ ] **Guides:** If appropriate, the feature is integrated into the guides prose.
43 | - [ ] **API Docs:** API documentation is polished and updates are carried through to other areas of API docs that may not directly pertain to the feature.
44 | - [ ] **Addon Ecosystem:** If the proposal replaces an existing feature, the addon ecosystem has largely updated to work with both old and new features.
45 | - [ ] **Codemods:** If the proposal updates or replaces an existing feature, high-quality codemods are available.
46 | - [ ] **Debugging Tools:** If needed, Ember debugging tools (e.g. Ember Inspector, Deprecation Workflow) have been updated to support the feature.
47 | - [ ] **IDE Support:** If needed, popular IDE support has been updated to support the feature.
48 | - [ ] **Engines, SSR:** If needed, ecosystem feature such as Ember Engines, SSR support have been updated to support the feature.
49 | - [ ] **Blueprints:** Blueprints have been updated to support the feature and to reflect the new best practices implied by this feature.
50 | - [ ] **Linting:** Lint rules have been updated or added or removed to support the feature and to reflect the new best practices implied by this feature.
51 | - [ ] **Deprecations:** If this feature implies that other features are no longer best practice, RFCs have been created to deprecate those features.
52 | - [ ] **Blog Post:** Consider if a blog post should be written to introduce this feature to the community.
53 | - [ ] **Feature Suite:** If the feature is part of a suite of features that were designed to work together for best ergonomics, the other features are also ready to be "Recommended".
54 | - [ ] **FCP to Recommended:** This PR has been converted from a draft to a regular PR and the `Final Comment Period` label has been added to start the FCP.
55 |
56 | ## Criteria for moving to Recommended (required)
57 |
58 | <-- Copy and paste the criteria for "Recommended" from the Ready For Release stage here -->
59 |
60 | A set of criteria for moving this RFC to the Recommended Stage, following release:
61 |
62 | 1.
63 | 2.
64 |
--------------------------------------------------------------------------------
/text/0521-find-by-identifier.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: released # FIXME: This may actually be recommended
3 | start-date: 2019-08-29T00:00:00.000Z
4 | release-date: 2021-12-11T00:00:00.000Z
5 | release-versions:
6 | ember-data: v4.0.0
7 |
8 | teams:
9 | - data
10 | prs:
11 | accepted: https://github.com/emberjs/rfcs/pull/521
12 | project-link:
13 | ---
14 |
15 | # [DATA] findRecord/peekRecord via Identifier
16 |
17 | ## Summary
18 |
19 | Users should be able to peek or find records based on `lid`.
20 |
21 | ## Motivation
22 |
23 | Apps and Addons making use of [Identifiers](https://github.com/emberjs/rfcs/pull/403)
24 | may wish to peek or find the record for a known `identifier`. This
25 | RFC would allow them to do so.
26 |
27 | ## Detailed design
28 |
29 | A new method signature would be added to `findRecord`
30 | `peekRecord` and `getReference`. The existing signatures would not be
31 | deprecated at this time.
32 |
33 | For the case where calling `findRecord` would result in a request
34 | being necessary but either no `type` or `id` information being known
35 | we would error.
36 |
37 | This is because there is no meaningful way for the store to create a
38 | network request for a record that does not exist yet (a
39 | `NewResourceIdentifierObject`), or for one for which the only thing
40 | we know is a locally assigned id (`Identifier`).
41 |
42 | ```ts
43 | interface Identifier {
44 | lid: string;
45 | }
46 |
47 | export interface ExistingResourceIdentifierObject {
48 | id: string;
49 | type: string;
50 | lid?: string;
51 | }
52 |
53 | export interface NewResourceIdentifierObject {
54 | id: string | null;
55 | type: string;
56 | lid: string;
57 | }
58 |
59 | export type Peekable =
60 | | Identifier
61 | | ExistingResourceIdentifierObject
62 | | NewResourceIdentifierObject;
63 |
64 | class Store {
65 | peekRecord(type: string, id: string | number): Record | null {}
66 | peekRecord(identifier: Peekable): Record | null {}
67 |
68 | findRecord(type: string, id: string | number, options?: any): PromiseRecord {}
69 | findRecord(identifier: Peekable, options?: any): PromiseRecord {}
70 |
71 | getReference(modelName: string, id: string | number): RecordReference {}
72 | getReference(identifier: Peekable): RecordReference {}
73 | }
74 | ```
75 |
76 | ## How we teach this
77 |
78 | For existing usage of these methods no migration or changes are necessary. For folks wishing to use the new
79 | APIs an example route is below that both peeks a record and makes a findRecord request.
80 |
81 | **current style**
82 |
83 | ```ts
84 | {
85 | @service('store') store;
86 |
87 | model({ user_id, post_id }) {
88 | let user = this.store.peekRecord('user', user_id);
89 |
90 | return hash({
91 | user,
92 | post: this.store.findRecord('post', post_id)
93 | });
94 | }
95 | }
96 | ```
97 |
98 | **using RecordIdentifiers instead**
99 |
100 | ```ts
101 | {
102 | @service('store') store;
103 |
104 | model({ user_id, post_id }) {
105 | let user = this.store.peekRecord({ type: 'user', id: user_id });
106 |
107 | return hash({
108 | user,
109 | post: this.store.findRecord({ type: 'post', id: post_id })
110 | });
111 | }
112 | }
113 | ```
114 |
115 | If an `lid` is known the `RecordIdentifier` passed to these methods can provide it
116 | in addition to or in place of `id`.
117 |
118 | ## Drawbacks
119 |
120 | - It requires the user to create an object as an argument when seeking to use identifiers.
121 | However if the user does not do so we still do ourselves almost immediately, here we are
122 | shaping the object sooner.
123 |
124 | ## Alternatives
125 |
126 | - `peekRecord(null, null, lid)` rejected for clumsy ergonomics
127 | - `findRecord(identifier)` attempting to request with just an lid,
128 | rejected until reconsideration at such time as our request fulfillment doesn't rely heavily on per-type adapters
129 | - `peekRecord(identifier)` but no `findRecord(identifier)` rejected because of the utility in these APIs mirroring each other, especially for relationships.
130 | - `store.recordForIdentifier(identifier)` instead of these changes, rejected because we already have a `peek` API.
131 |
--------------------------------------------------------------------------------
/text/0639-replace-blacklist-whitelist.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2020-06-15T00:00:00.000Z
4 | release-date: 2022-07-11T00:00:00.000Z
5 | release-versions:
6 | ember-cli: v4.5.0
7 |
8 | teams:
9 | - cli
10 | - learning
11 | prs:
12 | accepted: https://github.com/emberjs/rfcs/pull/639
13 | project-link:
14 | ---
15 |
16 | # Replace terms blacklist & whitelist in Ember CLI
17 |
18 | ## Summary
19 |
20 | Ember.js prides itself (rightly) on being an inclusive framework. To further improve on this, we should remove the terms "blacklist" and "whitelist" with more neutral replacements.
21 |
22 | ## Motivation
23 |
24 | The terms "blacklist" and "whitelist" can be considered racially insenstive. While the origin of these terms in this context is not in itself racially motivated, the fact that in todays context it _can be considered racially insensitive_ has been discussed frequently - see for example [here](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6148600/), [here](https://bugs.chromium.org/p/chromium/issues/detail?id=981129#c16) or [here](https://www.zdnet.com/article/uk-ncsc-to-stop-using-whitelist-and-blacklist-due-to-racial-stereotyping/).
25 |
26 | Other projects have already taken similar steps, for example [Go](https://go-review.googlesource.com/c/go/+/236857/), [Android](), [curl](https://github.com/curl/curl/pull/5546) or [PHPUnit](https://github.com/sebastianbergmann/phpunit/issues/4275).
27 |
28 | These terms are used in Ember CLI for rather advanced functionality, which should make providing a better alternative naming and deprecating the current one rather easy.
29 |
30 | ## Detailed design
31 |
32 | You can use `blacklist` and `whitelist` to include/exclude certain addons from your build:
33 |
34 | https://ember-cli.com/user-guide/#whitelisting-and-blacklisting-assets
35 |
36 | We should replace these with `exclude` or `include`:
37 |
38 | ```js
39 | // Before
40 | let app = new EmberApp(defaults, {
41 | addons: {
42 | blacklist: ["fastboot-app-server"],
43 | },
44 | });
45 |
46 | // After
47 | let app = new EmberApp(defaults, {
48 | addons: {
49 | exclude: ["fastboot-app-server"],
50 | },
51 | });
52 |
53 | // Before
54 | let app = new EmberApp(defaults, {
55 | addons: {
56 | whitelist: ["ember-cli-sass"],
57 | },
58 | });
59 |
60 | // After
61 | let app = new EmberApp(defaults, {
62 | addons: {
63 | include: ["ember-cli-sass"],
64 | },
65 | });
66 | ```
67 |
68 | The old keys (`blacklist` and `whitelist`) should be aliased to the new ones. Functionally, they behave the same.
69 |
70 | If both keys are used at the same time (so either `blacklist` AND `exclude` or `whitelist` AND `include`), an error is thrown.
71 |
72 | The old keys should be removed at some point - there should be a dedicated deprecation RFC for this (at a later point), ideally in time for them to be removed in the next major release.
73 |
74 | ## How we teach this
75 |
76 | We should update the Ember CLI API docs with the new terms.
77 |
78 | ## Drawbacks
79 |
80 | This might be considered "churn" by some. However, it is a small enough change to not really impact anybody meaningfully, while ensuring that Ember.js feels inclusive to everybody.
81 |
82 | ## Alternatives
83 |
84 | There are also other possible terms that could be used to replace `blacklist` and `whitelist`. For example:
85 |
86 | - `allowlist` / `denylist`
87 | - `allowlist` / `disallowlist`
88 | - `allow` / `deny`
89 | - `allowed` / `disallowed`
90 | - `allowedlist` / `disallowedlist`
91 | - `safelist` / `blockedlist`
92 |
93 | For reference, this is how often these terms are used accross the Ember ecosystem according to Ember Observer - all searches done inside of index.js files for easier comparison:
94 |
95 | - blacklist: 16 addons
96 | - whitelist: 20 addons
97 | - allowlist, allowedlist, denylist, deniedlist, disallowlist, disallowedlist, blockedlist: 0 addons
98 | - blocklist: 2 addons
99 | - safelist: 1 addon
100 | - allow: 4 addons
101 | - deny: 1 addon
102 | - allowed: 18 addons
103 | - disallowed: 1 addon
104 | - include: 207 addons
105 | - exclude: 101 addons
106 |
107 | ## Unresolved questions
108 |
109 | - Should we use different replacements than `exclude`/`include`?
110 |
--------------------------------------------------------------------------------
/text/0522-default-serializers-and-adapters.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2019-07-27T00:00:00.000Z
4 | release-date: 2019-11-07T00:00:00.000Z
5 | release-versions:
6 | ember-data: v3.14.0
7 |
8 | teams:
9 | - data
10 | prs:
11 | accepted: https://github.com/emberjs/rfcs/pull/522
12 | project-link:
13 | ---
14 |
15 | # Deprecate default Adapter and Serializer fallbacks
16 |
17 | ## Summary
18 | As part of Project Trim, https://github.com/emberjs/data/issues/6166, this deprecates the fallback and default adapter and serializer across ember-data including:
19 | 1. deprecate -default serializer fallback in Store.serializerFor
20 | 2. deprecate `adapter.serializer` and `adapter.defaultSerializer` instance property fallbacks (which currently default to -json-api).
21 | 3. deprecate `store.defaultAdapter` instance property (which defaults to `-json-api`) and the `-json-api` adapter fallback behavior in `adapterFor`.
22 | 4. deprecate `record.toJSON` instance method since this relies on the `-json` serializer.
23 |
24 | ## Motivation
25 |
26 | The adapter and serializer packages provide reference implementations and base classes that are not required for applications that implement their own following the required interfaces for adapters and serializers as defined in their respective base classes. Deprecating them allows us to simplify the lookup pattern and remove automatic injection and registration of potentially unused classes.
27 |
28 | In addition to removing use of initializer injection, this takes a significant step toward simplifying the mental model for how to determine what adapter/serializer is in use. Removing the defaults forces app developers to be more cognizant about the type of application level concerns vs model-specific concerns; they will now need to explicitly define and use specific adapters/serializers. After this deprecation RFC lands, apps will always use an adapter/serializer explicitly put into your application and the rule will be "the adapter matching modelName falling back to application".
29 |
30 | ## Detailed design
31 | The injection of `-default` and `-json-api` serializers will be removed in the next major version (4.0). Since this changes some core assumptions we will deprecate the reliance on the existence of the defaults. All deprecation warnings will only be shown in Dev mode.
32 |
33 | ##### deprecate -default serializer fallback in store.serializerFor
34 | A deprecation warning will be shown when [no model, application or adapter serializer](https://github.com/emberjs/data/blob/67affb0eca7048a1a0edc856af46d1305cd1fc1d/packages/store/addon/-private/system/store.ts#L2909) has specified and the default must be used. We will recommend implementing an application serializer.
35 |
36 | ##### deprecate adapter.serializer and adapter.defaultSerializer fallbacks
37 | A deprecation warning will be shown when accessing the [adapter's defaultSerializer](https://github.com/emberjs/data/blob/67affb0eca7048a1a0edc856af46d1305cd1fc1d/packages/store/addon/-private/system/store.ts#L2896). This will be distinct from the warning about using the application level default. We will recommend implementing an application serializer.
38 |
39 | ##### deprecate store.defaultAdapter (-json-api) and the -json-api adapter fallback behavior
40 | A deprecation warning will be shown when the [defaultAdapter](https://github.com/emberjs/data/blob/b0cf3225662bfb806cd0c02b55b763e37a319b32/packages/store/addon/-private/system/store.ts#L309) is accessed. We will recommend implementing an application adapter.
41 |
42 | ##### deprecate record.toJSON
43 | A deprecation warning will be shown when toJSON is called since it uses a serializer to create a JSON representation of [the model](https://guides.emberjs.com/release/models/customizing-serializers/#toc_customizing-serializers). Users may call record.serialize() or implement their own toJSON instead.
44 |
45 | ## How we teach this
46 |
47 | Today we have extensive documentation about creating custom serializers, but we will need to update the guides to specify the desired serializer in [app/serializers/application.js](https://guides.emberjs.com/release/models/customizing-serializers/#toc_customizing-serializers)
48 |
49 | The deprecation guide app will be updated with examples showing how to
50 | migrate away from relying on the defaults.
51 |
52 | ## Drawbacks
53 |
54 | The drawback to making this change is that apps relying on the default serializer need to add some boilerplate to explicitly set the serializer.
55 |
56 | ## Alternatives
57 |
58 | We could not do this.
59 |
--------------------------------------------------------------------------------
/text/0003-block-params.md:
--------------------------------------------------------------------------------
1 | ---
2 | stage: recommended
3 | start-date: 2014-08-18T00:00:00.000Z
4 | release-date: 2015-02-07T00:00:00.000Z
5 | release-versions:
6 | ember-source: v1.10.0
7 |
8 | teams:
9 | - framework
10 | prs:
11 | accepted: https://github.com/emberjs/rfcs/pull/3
12 | project-link:
13 | meta:
14 | issues:
15 | Ember Stream support: emberjs/ember.js#5522
16 | Handlebars parser support: wycats/handlebars.js#906
17 | HTMLBars compiler support: tildeio/htmlbars#147
18 | ---
19 |
20 | # Summary
21 |
22 | Introduce block parameters to the Handlebars language to standardize context-preserving helpers, for example:
23 |
24 | ```handlebars
25 | {{#each people as |person|}}
26 | {{person.name}}
27 | {{/each}}
28 | ```
29 |
30 | # Motivation
31 |
32 | ### The Problem
33 |
34 | There is no idiomatic way to write a helper that preserves context and yields values to its template. This is particularly painful for components which have strict context-preserving semantics.
35 |
36 | ### Current workarounds
37 |
38 | - Don't write components that need to yield a value.
39 | - *Problem:* This may not be an option.
40 | - Invent a non-standard per-helper syntax (like `{{#with foo as bar}}` or `{{#each item in items}}`) that hook into the undocumented `keywords` to inject variables.
41 | - *Problems:* Custom syntaxes are not in the spirit of the Handlebars language and require the consumer to know the special incantation. Component authors must an non-trivial understanding of how `keywords` work.
42 |
43 | ### New possibilities
44 |
45 | ```handlebars
46 | {{#for-each obj as |key val|}}
47 | {{key}}: {{val}}
48 | {{/for-each}}
49 | ```
50 |
51 | ```handlebars
52 | {{#form-for post as |f|}}
53 | {{f.input "title"}}
54 | {{f.textarea "body"}}
55 | {{f.submit}}
56 | {{/form-for}}
57 | ```
58 |
59 |
60 | # Detailed design
61 |
62 | - Phase 1: Add block params to the Handlebars language
63 | - Phase 2: Rewrite Ember's helpers to accept streams
64 | - Phase 3: Add block param support to `{{each}}` and `{{with}}`
65 |
66 | ### Phase 1: Add block params to the Handlebars language
67 |
68 | The proposed syntax is `{{#x-foo a b w=x y=z as |param1 param2 ... paramN|}}` and is only available for block helpers.
69 |
70 | The names of the block parameters are compiled into the inner template, but are not known to the helper (`x-foo` in the example above). To call a template and populate its block params we use the arguments option:
71 |
72 |
73 | ```javascript
74 | var template = compile('{{person.name}}', {
75 | blockParams: [ 'person' ]
76 | });
77 |
78 | template({}, ..., [ personModel ]);
79 | ```
80 |
81 | More commonly, block params will be defined inside of the template.
82 |
83 | ```
84 | {{#with currentPost.author as |a|}}
85 | {{a.name}} {{a.email}}
86 | {{/with}}
87 | ```
88 |
89 | ```javascript
90 | registerHelper('with', function(object, options) {
91 | return options.fn(this, ..., [ object ]);
92 | });
93 | ```
94 |
95 | For compatibility reasons, the *number of block params* are passed to the helper so that the pre-block-params behaviour of the helper can be preserved. Example:
96 |
97 | ```javascript
98 | function eachHelper(..., options) {
99 | if (options.blockParamsLength > 0) { /* do new behaviour */ }
100 | else { /* do old behaviour */ }
101 | }
102 | ```
103 |
104 | ### Phase 2: Rewrite Ember's helpers to accept streams
105 |
106 | In the `with` example above, if the `currentPost` changes the `a` block param should update. This means it's not sufficient to pass only the initial value of the author in the arguments. Instead, we pass a stream which emits values whenever the observed property changes.
107 |
108 | In Handlebars, a block param can appear anywhere that an identifier can, for example `{{log a.name}}`. This means that all helpers would need to be modified to understand streams.
109 |
110 | ### Phase 3: Add block param support to `{{each}}` and `{{with}}`
111 |
112 | Deprecate context-changing and ad-hoc keyword flavors of `{{each}}` and `{{with}}` in favor of block params.
113 |
114 | # Drawbacks
115 |
116 | - Handlebars already has a similar notion of with `data` which can lead to confusion.
117 |
118 | # Alternatives
119 |
120 | To my knowledge, no other designs have been considered. Not implementing this feature would mean that components would continue to be difficult to compose.
121 |
122 | # Unresolved questions
123 |
124 | The associated HTML syntax for HTMLBars needs to be finalized.
125 |
--------------------------------------------------------------------------------