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

Replace term whitelist with allowlist #817

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

kiwiupover
Copy link
Member

@kiwiupover kiwiupover commented Mar 25, 2021

I followed the RFC from awhile back that has since been merged, so
hopefully this can be changed here in ember-cli-fastboot as well.

This PR pushes @mcfiredrill work over the line #806

Closes #806

@mcfiredrill
Copy link

Thank you so much! Sorry I must have missed your previous comment.
#806 (comment)

Let me know if I can help with anything and feel free to close the previous PR #806

@bertdeblock
Copy link
Contributor

Is this in response to the Replace terms blacklist & whitelist in Ember CLI RFC? If so, I thought the settled upon terms were include and exclude? If not, please ignore me 😄.

Copy link
Member

@mansona mansona left a comment

Choose a reason for hiding this comment

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

First of all, thanks a million for doing all this work 🎉 this is amazing and really detailed!!

I'm looking at this and I can see that it's clearly a breaking change 🤔 I'm wondering if it would be better to implement some sort of deprecation around hostWhitelist so that we don't need to release this as a breaking change and we can give people a bit of time to update their system. What do you think?

@xg-wang
Copy link
Member

xg-wang commented Apr 6, 2021

fastboot has already released v3, as a minor bump we can have an alias for the old name (with deprecation would be even better); for ember-cli-fastboot it seems fine to include a breaking change, as the public interface in config is straight forward, i.e., test-packages/basic-app/config/environment.js
Do we want to include the change in https://github.com/ember-fastboot/ember-cli-fastboot/milestone/2?

@mansona
Copy link
Member

mansona commented Apr 12, 2021

@xg-wang I would feel quite strongly against releasing a breaking change for this in a major version that has never been deprecated once since that's not how we usually do things in Ember. I think it's totally fine for the alias and the deprecation to live for the entirety of the 3.x series 👍 especially since it won't be a massive code-path that needs to still hang around, as we can use the new name internally and just make sure that we are reading from the old name as a fallback

@kiwiupover kiwiupover force-pushed the change-whitelist-to-allow-list branch from 99df2e5 to 48e44c6 Compare June 10, 2021 05:09
     hostWhitelist -> hostAllowList
     moduleWhitelist -> moduleAllowlist

Adding a warning when a developer users `hostWhitelist`
@kiwiupover kiwiupover force-pushed the change-whitelist-to-allow-list branch from 48e44c6 to d61b516 Compare June 10, 2021 05:11
@kiwiupover
Copy link
Member Author

@mansona I have fixed the requested changes for this PR. Can you please review again.

Copy link
Contributor

@snewcomer snewcomer left a comment

Choose a reason for hiding this comment

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

This looks like a great PR! Are we concerned about making this breaking change while still in an alpha/beta 3.0? Especially with acceptable fallbacks and warnings to the end user?

As long as we agree on the approach of the PR, my preference is to move this forward given this is well documented (e.g. moduleAllowlist perhaps could be added to the README; CHANGELOG would need to clearly call this out).

README.md Outdated
@@ -273,23 +273,23 @@ module.exports = function(environment) {
},

fastboot: {
hostWhitelist: ['example.com', 'subdomain.example.com', /^localhost:\d+$/]
hostAllowlist: ['example.com', 'subdomain.example.com', /^localhost:\d+$/]
Copy link
Contributor

Choose a reason for hiding this comment

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

You might have a pending commit to standardize the casing

Copy link
Contributor

Choose a reason for hiding this comment

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

I wouldn't be opposed to just making this Allowlist (lower case l) to ensure ease of migration

@@ -83,15 +83,15 @@ function loadConfig(distPath) {
}

let sandboxRequire = buildWhitelistedRequire(
pkg.fastboot.moduleWhitelist,
pkg.fastboot.moduleAllowlist,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we might want to add a fallback + deprecation here as well?

@kiwiupover kiwiupover force-pushed the change-whitelist-to-allow-list branch from fe67e67 to c939b82 Compare June 11, 2021 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants