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.

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

Feature

What is the current behavior?

I’m removing a test from DependencyGraph-test that looked like so, but wasn’t actually working after I fixed problems with the fs mocks:

    it('should work with packages with symlinked subdirs', function() {
      var root = '/root';
      setMockFileSystem({
        'symlinkedPackage': {
          'package.json': JSON.stringify({
            name: 'aPackage',
            main: 'main.js',
          }),
          'main.js': 'lol',
          'subdir': {
            'lolynot.js': 'lolynot',
          },
        },
        'root': {
          'index.js': [
            '/**',
            ' * @providesModule index',
            ' */',
            'require("aPackage/subdir/lolynot")',
          ].join('\n'),
          'aPackage': { SYMLINK: '/symlinkedPackage' },
        },
      });

      var dgraph = new DependencyGraph({
        ...defaults,
        roots: [root],
      });
      return getOrderedDependenciesAsJSON(dgraph, '/root/index.js').then(function(deps) {
        expect(deps)
          .toEqual([
            {
              id: 'index',
              path: '/root/index.js',
              dependencies: ['aPackage/subdir/lolynot'],
              isAsset: false,
              isJSON: false,
              isPolyfill: false,
              resolution: undefined,
              resolveDependency: undefined,
            },
            {
              id: 'aPackage/subdir/lolynot.js',
              path: '/root/aPackage/subdir/lolynot.js',
              dependencies: [],
              isAsset: false,
              isJSON: false,
              isPolyfill: false,
              resolution: undefined,
              resolveDependency: undefined,
            },
          ]);
      });
    });

What is the expected behavior?

Reintroduce the test and verify symlinks work.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:300
  • Comments:207 (16 by maintainers)

github_iconTop GitHub Comments

156reactions
ericwooleycommented, Jun 15, 2017

Can we leave this open until it’s resolved?

This is a huge PITA for code sharing, and developing modules. I’m not sure what your looking for in terms of a strong case, but it’s definitely a major pain point for me, and module developers.

Currently I am trying to use lerna, and react-primitives to reorganize a project boilerplate to maximize code reuse, while maintaining upgradability by rn.

Lerna works by symlinking and installing your packages in a mono repo, which is an incredibly helpful pattern for code reuse, and completely broken when the react native packager won’t follow symlinks.

155reactions
jeanlauliaccommented, Apr 25, 2017

I think we won’t have time to deal with this anytime soon unfortunately. I’d love to reopen once we have a strong case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is Options +FollowSymLinks? - Stack Overflow
FollowSymLinks relates to server security. When dealing with web servers, you can't just leave things undefined. You have to tell who has access ......
Read more >
FollowSymLinks
FollowSymLinks is a directive in your web server configuration that tells your web server to follow so called symbolic links. As one would...
Read more >
How to get full path of original file of a soft symbolic link?
-f , --canonicalize : canonicalize by following every symlink in every component of the given name recursively; all but the last component must...
Read more >
How to Follow Symbolic Links - Linux Handbook
You got a symbolic link and wondering about the actual source file? Here's how to follow symlinks in Linux.
Read more >
Command differences with symbolic links - IBM
Some shell commands have minor technical differences when they refer to symbolic links instead of regular files or directories. For example, ls does...
Read more >

github_iconTop Related Medium Post

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