question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support third party framework import statements

See original GitHub issue

In frameworks like RoStrap, there is a custom “LoadLibrary” function. In RoStrap’s case, it eliminates the need for absolute paths between your code and handles replication of shared code in the background.

In a perfect world, it would be nice for import { something } from "Aurora" to compile to Resources:LoadLibrary("Aurora"), where “Aurora.ts” is the name of one of your own files.

Even if a compromise is required, it would be nice to support emitting import statements that are compatible with frameworks while not losing type information about the module.

In RoStrap’s case, relative file-based import statements should still use require, only the named module syntax should use Resources:LoadLibrary.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
evaeracommented, Oct 29, 2018

We decided that support for third party frameworks should live in modules, not the compiler. Adding support for each and every framework into the compiler would be a futile effort, but modules can and should be able to do everything that is necessary, such as dynamically generated imports via metatables + a .d.ts file.

1reaction
osyrisrblxcommented, Oct 11, 2018

@Dog2puppy This would be done by creating an npm module. I’ll post a guide for how to make these soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Conditionally import a framework (… | Apple Developer Forums
Is there any way to conditionally import a framework in Swift based on runtime iOS version? In particular, I have an app with...
Read more >
How to import 3rd party framework privately for your Swift ...
1 Answer 1 ... Swift doesn't support internal/private imports at the moment. All of your imports are forwarded to anyone using your framework....
Read more >
Auto import | IntelliJ IDEA Documentation - JetBrains
In the Settings/Preferences dialog ( Ctrl+Alt+S ), click Editor | General | Auto Import. Select the Add unambiguous imports on the fly checkbox ......
Read more >
How do I use an external framework in my project? - Using Swift
I haven't been able to use any third-party frameworks in an Xcode project ... to them with an import statement results in "module...
Read more >
Adding a third party framework inside a first party ... - Medium
To access third party public functions, we normally import the third party framework module. The error 'No such module' is a common compile ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found