code-corps / code-corps/code-corps-ember

Async load zxcvbn.js to use with ember-cli-password-strength

未关闭
#1,662 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
Difficulty: Medium Skill: JavaScript Time: 2 hours
主要语言
JavaScript
星标
120
派生
75
PR 合并指标
30 天内没有已合并 PR

描述

# Problem

ember-cli-password-strength, since 2.0.0, has support for asynchronous loading of the `zxcvbn.js` library.

Since the library is 400k gzipped, it would make sense for us to make use of this.

However, the addon does not provide a framework to actually include the library as part of the project. Instead, it assumes, if aync mode is on, that the library is locaded at `${config.rootUrl}/zxcvbn.js`

We need to find a way to deal with this and switch to async mode.

## Subtasks

- [ ] Turn on async mode for the addon as per instructions, by modifying the app's `ember-cli-build.js` and adding

```Javascript
let app = new EmberAddon(defaults, {
'ember-cli-password-strength': {
bundleZxcvbn: false
}
});
```
- [ ] Provide the library, either at the expected path, or, more likely at our own path, by providing custom async loading facilities, similar to what we do with `ember-stripe-elements`

https://github.com/code-corps/ember-stripe-elements/blob/master/addon/utils/load-script.js

贡献指南

打开贡献指南

调研方向

Start with ember-cli-build.js and the existing ember-stripe-elements addon/utils/load-script.js utility. Enable asynchronous loading for ember-cli-password-strength, then determine how the project should provide zxcvbn.js at a project-controlled path instead of the default root URL. Done means async mode is enabled and the library loads successfully without bundling it.

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript
领域
frontend
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
38/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。