Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Also pass the caller option to loadPartialConfig #685

Merged
merged 2 commits into from
Sep 27, 2018

Conversation

hedgepigdaniel
Copy link
Contributor

Please Read the CONTRIBUTING Guidelines
In particular the portion on Commit Message Formatting

Please check if the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior? (You can also link to an open issue here)

The caller option (added in #660) is passed to the transform function here:

result = await transform(source, injectCaller(options));

But it is not passed to the loadPartialConfig function here:

const config = babel.loadPartialConfig(programmaticOptions);

This results in the caller option not being available in the project's babel.config.js

What is the new behavior?

The caller option is passed (subject to the existing compatibility check) in both cases.

Does this PR introduce a breaking change?

  • Yes
  • No

If this PR contains a breaking change, please describe the following...

  • Impact:
  • Migration path for existing applications:
  • Github Issue(s) this is regarding:

Other information:

I'm not sure why it works for @babel/preset-env - I assume the presets referenced from babel.config.js get access to the option from the transform call rather than the loadPartialConfig call.

@loganfsmyth
Copy link
Member

loganfsmyth commented Sep 22, 2018

Ah great point. We actually don't need to pass it to transform at all in this case, so we can remove it from the transform file entirely. It'll stay in the result passed from loadPartialConfig so we don't need to set it again later.

@hedgepigdaniel
Copy link
Contributor Author

Ah, yes that makes sense. I've put the injectCaller call in only one place now, before loadPartialConfig.

@loganfsmyth loganfsmyth merged commit 7d8500c into babel:master Sep 27, 2018
@loganfsmyth
Copy link
Member

Thanks!

willmendesneto pushed a commit to willmendesneto/feature-toggle-service that referenced this pull request Sep 30, 2018
## The devDependency [babel-loader](https://github.com/babel/babel-loader) was updated from `7.1.5` to `8.0.3`.
This version is **not covered** by your **current version range**.

If you don’t accept this pull request, your project will work just like it did before. However, you might be missing out on a bunch of new features, fixes and/or performance improvements from the dependency update.

---

<details>
<summary>Release Notes for v8.0.3</summary>

<h3>Features</h3>
<ul>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="363280376" data-permission-text="Issue title is private" data-url="babel/babel-loader#687" href="https://urls.greenkeeper.io/babel/babel-loader/pull/687">#687</a> - Add <code>customize</code> option</li>
</ul>
<h3>Bugs</h3>
<ul>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="362860284" data-permission-text="Issue title is private" data-url="babel/babel-loader#685" href="https://urls.greenkeeper.io/babel/babel-loader/pull/685">#685</a> - Also pass the caller option to loadPartialConfig</li>
</ul>
<h3>Docs</h3>
<ul>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="361610577" data-permission-text="Issue title is private" data-url="babel/babel-loader#681" href="https://urls.greenkeeper.io/babel/babel-loader/pull/681">#681</a> - Update the README links to use the new options docs</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="362787813" data-permission-text="Issue title is private" data-url="babel/babel-loader#683" href="https://urls.greenkeeper.io/babel/babel-loader/pull/683">#683</a> - Add .mjs to the examples</li>
</ul>
<h3>Internal</h3>
<p>Some dev dependency updates and CI tweaks.</p>
</details>

<details>
<summary>Commits</summary>
<p>The new version differs by 77 commits ahead by 77, behind by 9.</p>
<ul>
<li><a href="https://urls.greenkeeper.io/babel/babel-loader/commit/800181b91dc4136bdb1d068f1fe730998eac6512"><code>800181b</code></a> <code>8.0.3</code></li>
<li><a href="https://urls.greenkeeper.io/babel/babel-loader/commit/7d8500ced72046d4c5c1dcdc7a9c0016d7e6c15b"><code>7d8500c</code></a> <code>Also pass the caller option to loadPartialConfig (#685)</code></li>
<li><a href="https://urls.greenkeeper.io/babel/babel-loader/commit/a50791472f1f706bf2ec4ea06427df2dd8b31080"><code>a507914</code></a> <code>Expose the full loader options to all overrides hooks.</code></li>
<li><a href="https://urls.greenkeeper.io/babel/babel-loader/commit/ac0c869b86b98881ac5544bf7248c63a971b7219"><code>ac0c869</code></a> <code>Tweak the customize implementation to be a bit more strict.</code></li>
<li><a href="https://urls.greenkeeper.io/babel/babel-loader/commit/9b70a02b3069000133122c09271ce0a7144f8dae"><code>9b70a02</code></a> <code>Add overrides option</code></li>
<li><a href="https://urls.greenkeeper.io/babel/babel-loader/commit/c8d7a7287a6b0dc60480b026159f0486ac9bf074"><code>c8d7a72</code></a> <code>Add .mjs to the examples (#683)</code></li>
<li><a href="https://urls.greenkeeper.io/babel/babel-loader/commit/461999323585fdaa420530a9f85ff5701a7d298e"><code>4619993</code></a> <code>bable options link update (#681)</code></li>
<li><a href="https://urls.greenkeeper.io/babel/babel-loader/commit/8f240b498bb24ef89f7b306f5ac806e84b813b0d"><code>8f240b4</code></a> <code>Use node 10 on appveyor</code></li>
<li><a href="https://urls.greenkeeper.io/babel/babel-loader/commit/7e4189ebb6e313df460de25949503e73cb260bf6"><code>7e4189e</code></a> <code>Change appveyor to use babel account</code></li>
<li><a href="https://urls.greenkeeper.io/babel/babel-loader/commit/eeaee463232e786d030716894ed4f66e505acbde"><code>eeaee46</code></a> <code>Update devDeps to use most recent versions, and fix tests.</code></li>
<li><a href="https://urls.greenkeeper.io/babel/babel-loader/commit/3e5fb5e3ab9bd02d6955625bde4c71fee1619473"><code>3e5fb5e</code></a> <code>chore(package): update lockfile</code></li>
<li><a href="https://urls.greenkeeper.io/babel/babel-loader/commit/2b8e479e50ce6dc7fc0bc5ae700951b9631a4959"><code>2b8e479</code></a> <code>chore(package): update eslint-config-babel to version 8.0.0</code></li>
<li><a href="https://urls.greenkeeper.io/babel/babel-loader/commit/0e43d0ab51d3b3f627e39d82e85b40a99c6316e3"><code>0e43d0a</code></a> <code>8.0.2</code></li>
<li><a href="https://urls.greenkeeper.io/babel/babel-loader/commit/5e0565d1199bcf42c238657f48460727680a2864"><code>5e0565d</code></a> <code>Manually fix 'inline' sourcemaps so they work with Webpack. (#671)</code></li>
<li><a href="https://urls.greenkeeper.io/babel/babel-loader/commit/ea52d05a41c4b44288348093ac3bb7ef52fa60bc"><code>ea52d05</code></a> <code>Use 'sourceMaps' since that is what we suggest to use in our docs. (#670)</code></li>
</ul>
<p>There are 77 commits in total.</p>
<p>See the <a href="https://urls.greenkeeper.io/babel/babel-loader/compare/f3bfed932a959f7ffe3633e7f88cba0f3fcbf7b2...800181b91dc4136bdb1d068f1fe730998eac6512">full diff</a></p>
</details>

<details>
  <summary>FAQ and help</summary>

  There is a collection of [frequently asked questions](https://greenkeeper.io/faq.html). If those don’t help, you can always [ask the humans behind Greenkeeper](https://github.com/greenkeeperio/greenkeeper/issues/new).
</details>

---


Your [Greenkeeper](https://greenkeeper.io) bot 🌴
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants