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

Scope variables in Custom PostCSS plugins to each file processed #745

Closed
MadLittleMods opened this issue May 31, 2022 · 0 comments · Fixed by #756 or #759
Closed

Scope variables in Custom PostCSS plugins to each file processed #745

MadLittleMods opened this issue May 31, 2022 · 0 comments · Fixed by #756 or #759
Assignees

Comments

@MadLittleMods
Copy link
Contributor

As discovered in #722 and suggested we should that we should still put some effort into fixing:

[...] could you still have a look to move the scope of those variables down? I think it's a good thing to do regardless of it not being an immediate problem anymore now.

-- @bwindels, #722 (comment)


Scope variables in Custom PostCSS plugins to each file processed instead of in the global plugin instance.

We should move the map variables inside the file processing (Once) scope so they aren't shared across plugin runs. [...] We should probably also pass them around directly to avoid concurrent parallel processing problems.

Example: https://github.com/vector-im/hydrogen-web/blob/480c5c1584c43c0f2d1ad82054e33b62a442a730/scripts/postcss/css-compile-variables.js#L136-L139

Currently, this doesn't cause any issues in the codebase. But this is a bit of technical debt that we should get to at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants