-
Notifications
You must be signed in to change notification settings - Fork 168
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
Extendable context references in config files #1055
Comments
I like the idea of proposed solution 1 more, because it'll open up more possibilities with using different context helpers in the future (for example, adding a |
I was just about to file an issue/help regarding this, example repository and all! Guess it's not necessary. For us this feature would be great, since we try to follow the atomic design principles, and try not to copy the properties belonging to the atoms all over the codebase. Of course there's the render helper with How about If that's impossible (like doing the .find after a load(), which is never triggered since the context would never be resolved), maybe add a hook to each loaded component? Something like Something like this below works, but is hackneyed at best, and malicious at worst. You could spend days figuring out why on some machines it compiles correctly, while on others it's not.
|
Normal config files with context references looks like:
The Problem I have in multiple projects is, that I couldn't extend the referenced object.
This wouldn't work:
const extendedTeaserContext = Object.assign('@molecules-teaser', { newVariable: 'lorem ipsum' })
I have two ideas to solve this problem.
Possible Solution 1: getContext Function
A function to convert a context reference into the object.
const extendedTeaserContext = Object.assign(getContext('@molecules-teaser'), { newVariable: 'lorem ipsum' })
Possible Solution 2: Post Context Generation Hook
A function to adjust the context after all references are resolved.
The text was updated successfully, but these errors were encountered: