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

In upgrading from v2.13 to v2.15: broccoli-babel-transpiler is opting out of caching #5164

Closed
raido opened this issue Sep 6, 2017 · 15 comments

Comments

@raido
Copy link

raido commented Sep 6, 2017

Upgrading ember-data from v2.13 to v2.15 (in addon) with "yarn upgrade ember-data" results in:

broccoli-babel-transpiler is opting out of caching due to a plugin that does not provide a caching strategy:

Probably some dependency needs to be bumped to avoid this.

Doing full "yarn upgrade" fixes the broccoli-babel-transpiler issue but introduces new warning:

"'instrument' is imported from external module 'ember-data/-debug' but never used"

@andrei-zhidkov
Copy link

andrei-zhidkov commented Sep 8, 2017

I'm experiencing the same issue after upgrading to v2.15 from v2.14.
It seems like the problem is with babel-plugin-transform-es2015-block-scoping...
For some reason, the issue is present in only one of the two projects that I've recently upgraded. I am going to investigate this further this weekend.

@xomaczar
Copy link
Contributor

This has been fixed in #5114 /w tests...

@RobbieTheWagner
Copy link
Member

@xomaczar I still see the issue on ember-data 2.15.2. I get the opting out of caching message.

@xomaczar
Copy link
Contributor

xomaczar commented Oct 1, 2017

What's the error/warning?

@xomaczar
Copy link
Contributor

xomaczar commented Oct 1, 2017

Can you try 2.15.3

@RobbieTheWagner
Copy link
Member

@xomaczar same issue with 2.15.3. It's the same issue this issue says. broccoli-babel-transpiler is opting out of caching due to a plugin that does not provide a caching strategy

@rwjblue
Copy link
Member

rwjblue commented Oct 1, 2017

Can you share the full output of the warning? It generally includes the actual plugin code after that message (this will help us identify which plugin is causing the caching to be disabled)...

@RobbieTheWagner
Copy link
Member

@rwjblue sure thing!

broccoli-babel-transpiler is opting out of caching due to a plugin that does not provide a caching strategy: `function () {
  return {
    visitor: {
      VariableDeclaration: function VariableDeclaration(path, file) {
        var node = path.node,
            parent = path.parent,
            scope = path.scope;

        if (!isBlockScoped(node)) return;
        convertBlockScopedToVar(path, null, parent, scope, true);

        if (node._tdzThis) {
          var nodes = [node];

          for (var i = 0; i < node.declarations.length; i++) {
            var decl = node.declarations[i];
            if (decl.init) {
              var assign = t.assignmentExpression("=", decl.id, decl.init);
              assign._ignoreBlockScopingTDZ = true;
              nodes.push(t.expressionStatement(assign));
            }
            decl.init = file.addHelper("temporalUndefined");
          }

          node._blockHoist = 2;

          if (path.isCompletionRecord()) {
            nodes.push(t.expressionStatement(scope.buildUndefinedNode()));
          }

          path.replaceWithMultiple(nodes);
        }
      },
      Loop: function Loop(path, file) {
        var node = path.node,
            parent = path.parent,
            scope = path.scope;

        t.ensureBlock(node);
        var blockScoping = new BlockScoping(path, path.get("body"), parent, scope, file);
        var replace = blockScoping.run();
        if (replace) path.replaceWith(replace);
      },
      CatchClause: function CatchClause(path, file) {
        var parent = path.parent,
            scope = path.scope;

        var blockScoping = new BlockScoping(null, path.get("body"), parent, scope, file);
        blockScoping.run();
      },
      "BlockStatement|SwitchStatement|Program": function BlockStatementSwitchStatementProgram(path, file) {
 if (!ignoreBlock(path)) {
          var blockScoping = new BlockScoping(null, path, path.parent, path.scope, file);
          blockScoping.run();
        }
      }
    }
  };
}`.

@rwjblue
Copy link
Member

rwjblue commented Oct 1, 2017

Awesome, thank you! I submitted #5196 to address.

@bmac bmac closed this as completed in #5196 Oct 1, 2017
@RobbieTheWagner
Copy link
Member

Thanks @rwjblue!

@musaffa
Copy link

musaffa commented Oct 4, 2017

@rwjblue Will this fix be released in ember-data 2.15 or 2.16?

@bmac
Copy link
Member

bmac commented Oct 4, 2017

@musaffa This fix should be in Ember Data 2.16.0.

@musaffa
Copy link

musaffa commented Oct 4, 2017

Thanks. I couldn't upgrade to 2.15 because of this issue. This is for the first time I couldn't upgrade.

@bmac
Copy link
Member

bmac commented Oct 4, 2017

Looks like @rwjblue's fix didn't get everything. There is a new pr #5206 that will land in a 2.16.1 sometime tonight or tomorrow.

@scottkidder
Copy link

This is fixed for me on 2.16.2. Thanks everyone!

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

No branches or pull requests

8 participants