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

Consider removing C++ dependency #14

Closed
danielgtaylor opened this issue Mar 21, 2014 · 4 comments
Closed

Consider removing C++ dependency #14

danielgtaylor opened this issue Mar 21, 2014 · 4 comments

Comments

@danielgtaylor
Copy link
Contributor

Right now Flightplan depends on the fibers module. Unfortunately the module is written in C++ and requires a C++ compiler to be set up for installation, which is inconvenient. While I personally don't mind, it makes onboarding new developers more difficult.

I don't have much experience with coroutines and promises but maybe another library could be used?

@pstadler
Copy link
Owner

I know it's suboptimal, but I found no real alternative to fibers for this use-case.

@renarsvilnis
Copy link
Contributor

renarsvilnis commented Sep 26, 2018

I'm resurrecting this discussion.

Not that familiar with fibers, but can't it just be dropped in favour of async-await?

My use case right now, I need to do some async stuff in the local, but it fails Error: Can't wait without a fiber.

@pstadler Is it doable? I'm ready to contribute the changes if needed.

Which to a synced version of glob right now, not optimal, but works.

plan.local(async (local) => {
  // ... other sync stuff

  async function addItems (items) {
    const promises = items.map(async (fileOrFolder) => {
      if (isGlob(fileOrFolder)) {
        const sublist = await globP(fileOrFolder);
        await addItems(sublist);
      } else {
        filesToCopy.add(fileOrFolder);
      }
    });

    if (promises.length) {
      await Promise.all(promises);
    }
  }

  local.log('Building client files');
  local.exec('npm run build:prod', {silent: true});

  local.log('Fetching build result client file list');
  await addItems(fileWhiteList);

  local.log('Copy files to remote hosts');
  local.transfer([...filesToCopy], `/tmp/${tmpDir}`);
});

@pstadler
Copy link
Owner

See: #162

@pstadler
Copy link
Owner

@renarsvilnis Sorry, somehow the following sentence got lost:
If you're willing to perform such a huge refactoring and hopefully continue to maintain this project in the future, I will happily add you as a contributor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants