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

Create a new env variable to turn off class minifying #261

Closed
luixxiul opened this issue Aug 1, 2017 · 2 comments
Closed

Create a new env variable to turn off class minifying #261

luixxiul opened this issue Aug 1, 2017 · 2 comments

Comments

@luixxiul
Copy link

luixxiul commented Aug 1, 2017

It would be nice to set up a new env variable to turn off class minifying.

Since it is enabled by default and not listed on CHANGELOG.md, it could cause an issue which is hard to detect. Please refer my comment here: #246 (comment)

@xymostech
Copy link
Contributor

Hello @luixxiul! Thanks for bringing this up. I followed the link to the error it looks like you are encountering, here: brave/browser-laptop#10029 (comment)

It looks like you're depending on the class names that Aphrodite is generating which we generally discourage and we earlier discussed explicitly not working to keep the format of the class names fixed: #229 (that is, the format of those class names might change in any release).

The way that we at Khan Academy get around this is by adding extra properties or class names onto the elements that you need to find to uniquely identify them without depending on the Aphrodite class names. For instance, to mark elements that we might interact with during end-to-end tests, we explicitly mark those elements with a data-test-id attribute like <div data-test-id="header-button" /> and then use css selectors like [data-test-id="header-button"] to find them in the DOM. You could do something similar, either by adding extra class names other than the ones Aphrodite is generating, or adding extra data- properties yourself.

Would that solve the problem you're having? We'd really like to not add features to modify the class names that are generated when we don't want people to be depending on them. Sorry we haven't been explicit about that, I've been busy and haven't gotten around to publishing those thoughts into a more concrete form.

@luixxiul
Copy link
Author

Closing as stale.

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

No branches or pull requests

2 participants