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

Fix option lazyLoad: false #154

Merged
merged 5 commits into from
Nov 28, 2019
Merged

Fix option lazyLoad: false #154

merged 5 commits into from
Nov 28, 2019

Conversation

dcyriller
Copy link
Contributor

Description

After #151, option lazyLoad: false is broken.

Changes

  • Remove the custom script injection for intlTelInput
  • Instead make sure the library is loaded (or load it) and then initialize the component

when option lazyLoad = false
before initalizing the componet internals
@dcyriller dcyriller added the bug Something isn't working label Nov 27, 2019
@Turbo87
Copy link
Contributor

Turbo87 commented Nov 27, 2019

so that essentially removes the lazyLoad option?! 🤔

@dcyriller
Copy link
Contributor Author

dcyriller commented Nov 27, 2019

No, it doesn't. The lazyLoading is done here now: https://github.com/qonto/ember-phone-input/blob/v3.1.0/addon/services/phone-input.js#L14

@dcyriller
Copy link
Contributor Author

dcyriller commented Nov 27, 2019

You mean: with that PR, the script would always be loaded? The answer to that question is: yes.

With the lazyLoad option set to false, users load the script in the init hook of the phoneInput service (meaning at app boot). Note that previously it was loaded from index.html file. Which is a small change.

If they specify lazyLoad: true. The script won't be loaded at app boot. Instead they will have to load it manually. If they don't, a fallback will load the script before doing the component setup.

Copy link
Member

@dbendaou dbendaou left a comment

Choose a reason for hiding this comment

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

LGTM

@dcyriller
Copy link
Contributor Author

@Turbo87 do you have time to review it? If not, I will merge it to release the fix.

@dcyriller dcyriller merged commit ffd9b3a into master Nov 28, 2019
@dcyriller dcyriller deleted the remove-js-script branch November 28, 2019 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants