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

Use importjs #17422

Merged
merged 2 commits into from
Mar 19, 2021
Merged

Use importjs #17422

merged 2 commits into from
Mar 19, 2021

Conversation

konsumlamm
Copy link
Contributor

This PR changes uses of importcpp to importjs where it doesn't make any problems.

I looked at all files with "js" in the path name, those that I didn't change are:

  • js/dom.nim
  • js/dom_extensions.nim
  • js/jsconsole.nim
  • js/jscore.nim
  • system/jssys.nim

Using importjs there gives `importjs` for routines requires a pattern errors, since apparently importjs doesn't behave the same as importc and importcpp. Should I open an issue for this or just add patterns for the imports (in a future PR)?

Copy link
Contributor

@dom96 dom96 left a comment

Choose a reason for hiding this comment

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

Nice! LGTM

@@ -70,7 +70,7 @@ type
future*: T
## Wraps the return type of an asynchronous procedure.

PromiseJs* {.importcpp: "Promise".} = ref object
PromiseJs* {.importjs: "Promise".} = ref object
Copy link
Member

Choose a reason for hiding this comment

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

see also timotheecour#662

Copy link
Member

@timotheecour timotheecour left a comment

Choose a reason for hiding this comment

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

LGTM. the reason this now works is that docs for nim js modules are now built with the new -b:js flag

@timotheecour
Copy link
Member

timotheecour commented Mar 19, 2021

Using importjs there gives importjs for routines requires a pattern errors, since apparently importjs doesn't behave the same as importc and importcpp. Should I open an issue for this or just add patterns for the imports (in a future PR)?

it should be discussed in nim-lang/RFCs#315, please add a note there if this use case isn't covered already

@timotheecour timotheecour merged commit 9997b42 into nim-lang:devel Mar 19, 2021
ringabout pushed a commit to ringabout/Nim that referenced this pull request Mar 22, 2021
ardek66 pushed a commit to ardek66/Nim that referenced this pull request Mar 26, 2021
@konsumlamm konsumlamm deleted the importjs branch March 30, 2021 21:45
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