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.

Is there a simple replacement for @providesModule?

See original GitHub issue

Do you want to request a feature or report a bug?

Feature request, I think?

What is the current behavior?

I can no longer import myClass from "MyClass"; where said class contains @providesModule myClass.

I’m not sure if this is the right place to ask, but a commenter over in this issue suggested to ask the Metro team. I’ve used @providesModule since I started with React Native (~3 years ago) and now have a massive project. I’m looking to upgrade to the latest React Native version, but since @providesModule has been removed I’m not sure how to migrate my code base, short of modifying thousands of import statements.

Is there a way to easily enable this type of functionality?

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
MattFoleycommented, Dec 19, 2018

Okay, that branch linked in my previous comment has been updated and is now a full working example!

1reaction
MattFoleycommented, Dec 17, 2018

Thanks Rubén, I wasn’t able to find detailed documentation on this, but I see the property now specified in the Metro documentation. I’ll take a look.

Sent from my iPhone

On Dec 17, 2018, at 8:32 AM, Rubén Norte <notifications@github.commailto:notifications@github.com> wrote:

We removed the support for @providesModule by default but you can use global modules the same way using the option. You can see an example here: https://github.com/facebook/metro/blob/cdc9cbe89c9966a25314cc13971e547c12e9227a/packages/metro/src/DeltaBundler/__fixtures__/hasteImpl.js

I recommend you not to read the file to get the haste name from the @providesModule tag but extract it from the file name, as we do now at Facebook.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/facebook/metro/issues/334#issuecomment-447908673, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABIJWgH_QbZO7qeeFw70JZTEj_VYk5Toks5u58csgaJpZM4ZVlwt.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HttpApplication.RegisterModule(Type) Method (System.Web ...
The type of the module. ... Provides module initialization and disposal events to the implementing class. ... Discover how to replace machineKey in...
Read more >
ios - @providesModule naming collision error - Stack Overflow
The error is saying something about naming collisions. I already tried deleting the collisioned files but another file happens to occur. Then delete...
Read more >
pubkey/rxdb - Gitter
Hi, I put 2 image attachments to doc from PC, than I get back on my phone, it work exactly, than I replace...
Read more >
API - esbuild
#Simple options. #Alias. Supported by: Build. This feature lets you substitute one package for another when bundling. The example below substitutes the package ......
Read more >
Blackboard Ally - NILE & Other Technology Guides
Blackboard Ally is easy to use, it is available in every module site and provides module tutors with quick fixes, inline guidance on...
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