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

fix: persistent cache conflicts #1131

Merged
merged 1 commit into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/gentle-gorillas-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@farmfe/core': patch
---

Fix persistent cache conflicts
2 changes: 1 addition & 1 deletion crates/core/src/cache/cache_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::{

use crate::config::Mode;

const FARM_CACHE_VERSION: &str = "0.3.2";
const FARM_CACHE_VERSION: &str = "0.3.3";
const FARM_CACHE_MANIFEST_FILE: &str = "farm-cache.json";

// TODO make CacheStore a trait and implement DiskCacheStore or RemoteCacheStore or more.
Expand Down
7 changes: 6 additions & 1 deletion crates/plugin_css/src/transform_css_to_script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ pub fn transform_css_to_script_modules(
let store_key = CacheStoreKey {
name: module_id.to_string() + "-transform_css_to_script_modules",
key: sha256(
format!("{}{}", content_hash, module_id.to_string()).as_bytes(),
format!(
"transform_css_to_script_modules_{}_{}",
content_hash,
module_id.to_string()
)
.as_bytes(),
32,
),
};
Expand Down
7 changes: 6 additions & 1 deletion crates/plugin_runtime/src/render_resource_pot/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,12 @@ pub fn resource_pot_to_runtime_object(
let store_key = CacheStoreKey {
name: m_id.to_string() + "-resource_pot_to_runtime_object",
key: sha256(
format!("{}{}", content_hash, m_id.to_string()).as_bytes(),
format!(
"resource_pot_to_runtime_object_{}_{}",
content_hash,
m_id.to_string()
)
.as_bytes(),
32,
),
};
Expand Down
2 changes: 1 addition & 1 deletion examples/vite-adapter-vue/farm.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function configureVitePluginVue() {
export default defineConfig({
compilation: {
// compilation options here
persistentCache: false
// persistentCache: false
},
plugins: [
'@farmfe/plugin-sass',
Expand Down
2 changes: 1 addition & 1 deletion examples/vite-adapter-vue/src/components/Intro.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts"></script>

<template>
<p>
<p>
Install
<a href="https://github.com/vuejs/language-tools" target="_blank">Volar</a>
in your IDE for a better DX
Expand Down
Loading