-
Notifications
You must be signed in to change notification settings - Fork 111
fix(rspeedy/core): deno compat #1412
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d3bbd91
fix rspeedy deno compat
knotbin 0e44566
hasNativeTSSupport deno logic
knotbin db0b806
Merge branch 'lynx-family:main' into main
knotbin 64ce3fd
remove bailout in start, conditional unregister
knotbin 8a1cd35
Merge branch 'lynx-family:main' into main
knotbin c59e9e7
fix js support
knotbin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,5 @@ | ||
| --- | ||
| "@lynx-js/rspeedy": patch | ||
| --- | ||
|
|
||
| fix deno compatibility |
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have a
hasNativeTSSupportfunction at:lynx-stack/packages/rspeedy/core/src/config/loadConfig.ts
Line 155 in 15a46bc
which is based on
process.features.typescript.Although deno does not support
process.features.typescriptyet :)But it would be great to have the similar logic together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried just adding the Deno logic to
hasNativeTSSupportbut it resulted in the same error when trying to run with Deno because the current logic assumes nativeTsSupport runtimes still support module.register.I ended up using
hasNativeTSSupportin a conditional for runningregister.This only meant I had to change the
commonConfig.jsimports tocommonConfig.tsinweb-testsbecause these specific tests are run directly from the TypeScript source and not compiled into JS.All other tests and libraries built perfectly fine with no changes and all tests pass.
I understand this change may be too much for just adding Deno support and I really did want to keep it isolated but that would have meant using the original change or making the conditional specific to only Deno. Please let me know if this meets your standards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are using
registerwithout condition to fix #1406.I do think it would be necessary to keep this way since there could be a lot of user that are doing this way (import with
.jsfor a.tsfile) since this is the default of TypeScript.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer something like this:
wdyt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a perfect solution! Sorry I tried a bunch of combinations of
isJavaScriptPath,hasNativeTSSupportand the Deno logic but this one is clearly the most logical. Just updated it to reflect this and removed the web-test changes. Let me know what you think.