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

feat: upgrade swc_ecmascript to 0.137.0 #63

Merged
merged 1 commit into from
Mar 21, 2022

Conversation

dsherret
Copy link
Member

No description provided.

@dsherret dsherret mentioned this pull request Mar 21, 2022

[[example]]
name = "eszip_load"
path = "src/examples/load.rs"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed because of circular dependency between eszip and deno_core (was getting an error upgrading a dependency). Opened #64

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yikes, how can we alleviate it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know 😅

Copy link
Member

@lucacasonato lucacasonato Mar 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does deno_core have a dep on eszip? (These examples are important, I'd like to keep them).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's not deno_core, but deno (for deno compile)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But then why is that an issue? The examples only rely on deno_core, not deno.

Copy link
Member Author

@dsherret dsherret Mar 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed on discord, it was the once_cell dep being pinned in deno_core

@@ -0,0 +1 @@
{"version":3,"sources":["file:///b.ts"],"sourcesContent":["export const b = \"b\";\n"],"names":[],"mappings":"AAAA,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,CAAG"}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Swc changed its sourcemap output (which looks valid to me, but has more detail. I went through and looked at the changes). For this reason, I stored the old sourcemap output to compare to the existing eszip files in separate files here.

@@ -827,16 +837,16 @@ mod tests {
let module = eszip.get_module("file:///main.ts").unwrap();
assert_eq!(module.specifier, "file:///main.ts");
let source = module.source().await;
assert_eq!(&*source, include_bytes!("./testdata/emit/main.ts"));
assert_matches_file!(source, "./testdata/emit/main.ts");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These statements previously did not give good assertion errors. This is improved now. I used a macro instead of a function because then it says the line number for what assertion failed.

@dsherret dsherret requested a review from bartlomieju March 21, 2022 19:40
@dsherret dsherret merged commit 462ab27 into denoland:main Mar 21, 2022
@dsherret dsherret deleted the upgrade_swc branch March 21, 2022 20:17
magurotuna added a commit that referenced this pull request Dec 21, 2022
This commit restores the examples that were removed in #63. To get it working
with the recent versions of upstream crates such as deno_graph and tokio, some
refactors are applied.

Closes #64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants