Skip to content

Commit

Permalink
Merge pull request #552 from jpudysz/feature/hash
Browse files Browse the repository at this point in the history
feat: generate hash based on styleKey and stylesheet tag
  • Loading branch information
jpudysz authored Feb 3, 2025
2 parents 719e054 + 8a115d4 commit 864680b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cxx/parser/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void parser::Parser::buildUnistyles(jsi::Runtime& rt, std::shared_ptr<StyleSheet

if (styleValue.isFunction(rt)) {
styleSheet->unistyles[styleKey] = std::make_shared<UnistyleDynamicFunction>(
helpers::HashGenerator::generateHash(styleKey),
helpers::HashGenerator::generateHash(styleKey + std::to_string(styleSheet->tag)),
UnistyleType::DynamicFunction,
styleKey,
styleValue,
Expand All @@ -29,7 +29,7 @@ void parser::Parser::buildUnistyles(jsi::Runtime& rt, std::shared_ptr<StyleSheet
}

styleSheet->unistyles[styleKey] = std::make_shared<Unistyle>(
helpers::HashGenerator::generateHash(styleKey),
helpers::HashGenerator::generateHash(styleKey + std::to_string(styleSheet->tag)),
UnistyleType::Object,
styleKey,
styleValue,
Expand Down Expand Up @@ -361,7 +361,7 @@ void parser::Parser::rebuildUnistyle(jsi::Runtime& rt, Unistyle::Shared unistyle
unistyleFn->unprocessedValue = std::move(functionResult);
unistyleFn->parsedStyle = this->parseFirstLevel(rt, unistyleFn, variants);
}

if (unistyle->isDirty) {
unistyle->isDirty = false;
}
Expand Down Expand Up @@ -401,7 +401,7 @@ jsi::Object parser::Parser::parseFirstLevel(jsi::Runtime& rt, Unistyle::Shared u
// parse dependencies only once
if (propertyName == helpers::STYLE_DEPENDENCIES && !unistyle->isSealed()) {
auto newDeps = this->parseDependencies(rt, propertyValue.asObject(rt));

unistyle->dependencies.insert(unistyle->dependencies.end(), newDeps.begin(), newDeps.end());

return;
Expand Down

0 comments on commit 864680b

Please sign in to comment.