-
-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(rust-plugin): implement dynamic rust plugin CLI and loader * chore: complete runtime * chore: implement ResourceLoader * chore: top level await implement * chore: revert top level await impelment and leave it to future implemention * fix: test and spell issue * fix: windows resolve error
- Loading branch information
Showing
75 changed files
with
1,907 additions
and
582 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"editor.formatOnSave": true, | ||
"editor.tabSize": 2 | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use farmfe_compiler::Compiler; | ||
use farmfe_core::{ | ||
config::{Config, RuntimeConfig}, | ||
relative_path::RelativePath, | ||
}; | ||
|
||
fn main() { | ||
let relative_root = RelativePath::new("examples/react"); | ||
let cwd = std::env::current_dir().unwrap(); | ||
let react_examples_root = relative_root.to_logical_path(cwd.clone()); | ||
|
||
let compiler = Compiler::new( | ||
Config { | ||
root: react_examples_root.to_string_lossy().to_string(), | ||
runtime: RuntimeConfig { | ||
path: cwd | ||
.join("packages") | ||
.join("runtime") | ||
.join("src") | ||
.join("index.ts") | ||
.to_string_lossy() | ||
.to_string(), | ||
plugins: vec![], | ||
}, | ||
..Default::default() | ||
}, | ||
vec![], | ||
) | ||
.unwrap(); | ||
|
||
compiler.compile().unwrap(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
use std::sync::Arc; | ||
|
||
use farmfe_core::{context::CompilationContext, error::Result, module::ModuleId}; | ||
|
||
pub fn finalize_module(module_id: &ModuleId, context: &Arc<CompilationContext>) -> Result<()> { | ||
context.plugin_driver.finalize_module(module_id, context) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
pub struct UpdateOutput {} | ||
use farmfe_core::module::ModuleId; | ||
|
||
/// The output after the updating process | ||
#[derive(Debug, Default)] | ||
pub struct UpdateOutput { | ||
pub added_module_ids: Vec<ModuleId>, | ||
pub updated_module_ids: Vec<ModuleId>, | ||
pub removed_module_ids: Vec<ModuleId>, | ||
pub resources: String, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.