Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
wmertens committed Apr 26, 2024
1 parent 1cdf6ef commit a9afa7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/qwik/src/optimizer/core/src/transform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ pub struct QwikTransformOptions<'a> {

fn convert_signal_word(id: &JsWord) -> Option<JsWord> {
let ident_name = id.as_ref();
let has_signal = ident_name.ends_with(SIGNAL);
let has_signal = ident_name.ends_with(QRL_SUFFIX);
if has_signal {
let new_specifier = [&ident_name[0..ident_name.len() - 1], LONG_SUFFIX].concat();
Some(JsWord::from(new_specifier))
Expand All @@ -147,13 +147,13 @@ impl<'a> QwikTransform<'a> {
pub fn new(options: QwikTransformOptions<'a>) -> Self {
let mut marker_functions = HashMap::new();
for (id, import) in options.global_collect.imports.iter() {
if import.kind == ImportKind::Named && import.specifier.ends_with(SIGNAL) {
if import.kind == ImportKind::Named && import.specifier.ends_with(QRL_SUFFIX) {
marker_functions.insert(id.clone(), import.specifier.clone());
}
}

for id in options.global_collect.exports.keys() {
if id.0.ends_with(SIGNAL) {
if id.0.ends_with(QRL_SUFFIX) {
marker_functions.insert(id.clone(), id.0.clone());
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/qwik/src/optimizer/core/src/words.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use lazy_static::lazy_static;
use swc_atoms::JsWord;

pub const SIGNAL: char = '$';
pub const QRL_SUFFIX: char = '$';
pub const LONG_SUFFIX: &str = "Qrl";

lazy_static! {
Expand Down

0 comments on commit a9afa7c

Please sign in to comment.