Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete deprecated old propagation model #511

Merged
merged 1 commit into from
Nov 21, 2021
Merged

Delete deprecated old propagation model #511

merged 1 commit into from
Nov 21, 2021

Conversation

SergeAstapov
Copy link
Contributor

Part of #116.

Follow up to #499.

@@ -6,15 +6,26 @@ module.exports = {
config(environment, appConfig) {
const addonConfig = appConfig['emberKeyboard'] || {};

if ('disableInputsInitializer' in addonConfig && !this.deprecationPrinted) {
if ('disableInputsInitializer' in addonConfig && !this.disableInputsInitializerDeprecationPrinted) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not super nice (sooo long) but does it's job.

// See tests/dummy/app/services/keyboard.js which extends addon service with old code.
// See tests/dummy/app/templates/priority.hbs when property is set usage.
if (this.oldPropagationModel) {
this.keyboard.isPropagationEnabled = false;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this allows us to keep documentation and interactive widgets/examples for 6.x

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see tests/dummy/app/services/keyboard.js for the usage

@@ -0,0 +1,5 @@
/* eslint-disable ember/no-mixins */
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created a new docs page as old one "priority" does not have any sense for 7.x, however I don't want to delete it and would really like to keep for 6.x users not yet ready for 7.x migration

@@ -0,0 +1,86 @@
import { action } from '@ember/object';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this allows us to keep documentation and interactive widgets/examples for 6.x

Basically deprecated/removed functionality for old propagation model/priority based responders moved from add-on code to dummy app for the purpose of interactive docs only.

@@ -2,7 +2,8 @@
<nav class="menu">
<LinkTo @route='index'>Overview</LinkTo>
<LinkTo @route='usage'>Usage</LinkTo>
<LinkTo @route='priority'>Priority</LinkTo>
<LinkTo @route='event-propagation'>Event propagation</LinkTo>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new docs page added to navigation

@@ -0,0 +1,17 @@
{{format-markdown "
Copy link
Contributor Author

@SergeAstapov SergeAstapov Nov 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New docs page is very similar to the existing "Priority" but without things removed in 7.x


@action
_respond(event) {
if (this.isPropagationEnabled) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the switch for "old code path" which may be initiated from tests/dummy/app/mixins/enterable.js

@@ -2,7 +2,8 @@
<nav class="menu">
<LinkTo @route='index'>Overview</LinkTo>
<LinkTo @route='usage'>Usage</LinkTo>
<LinkTo @route='priority'>Priority</LinkTo>
<LinkTo @route='event-propagation'>Event propagation</LinkTo>
<LinkTo @route='priority'>Priority (&lt;= 6.x)</LinkTo>
Copy link
Contributor Author

@SergeAstapov SergeAstapov Nov 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explicitly marked for which version it's focused on.

@@ -1,5 +1,5 @@
{{format-markdown "
## Priority
## Priority (6.x and below)
Copy link
Contributor Author

@SergeAstapov SergeAstapov Nov 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kept this page with documentation and interactive widgets/examples for 6.x

Basically deprecated/removed functionality for old propagation model/priority based responders moved from add-on code to dummy app for the purpose of interactive docs only.

@@ -26,4 +26,16 @@ and required the use of `code` identifiers, like `KeyT`, `Digit1`, etc. Be sure
[docs regarding `key` vs. `code` properties](usage) and be sure you are specifying the key
combo consistent with your intended behavior. You will likely find that you want to update some key
combos to the `key` equivalent. e.g. replace `ctrl+KeyT` with `ctrl+t`.

### Upgrading from ember-keyboard 6.x to 7.x
Copy link
Contributor Author

@SergeAstapov SergeAstapov Nov 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Started new section. Does not seem we need to be much more explicit for this specific removal

Copy link
Collaborator

@lukemelia lukemelia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic work! 🙌

@lukemelia lukemelia merged commit c2063b6 into adopted-ember-addons:master Nov 21, 2021
@SergeAstapov SergeAstapov deleted the delete-old-propagation-model branch November 21, 2021 00:43
leoeuclids pushed a commit to leoeuclids/ember-keyboard that referenced this pull request Dec 11, 2023
…/release-prep

Prep for Release (v5, Major)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants