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
fix: non breaking align options naming #13532
Conversation
fedeci
commented
Jul 6, 2021
•
edited by gitpod-io
bot
edited by gitpod-io
bot
Q | A |
---|---|
Fixed Issues? | Fixes #13170 |
Patch: Bug Fix? | Yes |
Major: Breaking Change? | |
Minor: New Feature? | |
Tests Added + Pass? | Yes |
Documentation PR Link | |
Any Dependency Changes? | |
License | MIT |
Let's see if it breaks e2e🤞 |
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/47767/ |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 8917e57:
|
May we consider it a new feature because previously this was "shadowed" and not accessible? |
Yeah I'd consider this a new feature. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add a test that directly passes the sourceFileName
option?
And also a test for the unknown
special case (why do we need that special case?)
4d6046f
to
0d172f3
Compare
cwd: fixture(), | ||
}); | ||
expect(JSON.parse(JSON.stringify(result))).toEqual(output); | ||
}); | ||
|
||
it("should parse using passed in configuration", function () { | ||
const input = fs.readFileSync(fixture("input.js"), "utf8"); | ||
const output = require(fixture("output.json")); | ||
const input = fs.readFileSync( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nicolo-ribaudo this tests the no-"unknown" handling because no filename
, filenameRelative
or sourceFileName
is passed.
We need that special case handling because sourceFileName
defaults to filenameRelative
which defaults to "filename" (if provided) or to "unknown".
0d172f3
to
8917e57
Compare
This change breaks one of my babel plugins that relies on the |
That should be the right behaviour but yeah, since it breaks let's leave it entirely for babel-8. |
@fedeci thanks! Shouldn't we add filename as well to parserOpts then? Otherwise in the I have a babel plugin that transforms HTML Imports to es modules, and it transforms the HTML to valid JS in this hook. I need to know the folder of the file for resolving some references inside the HTML. |
Probably yes, I'll update the other PR in these days! |
Noticed this change is breaking this plugin here, which is probably the same/similar thing @LarsDenBakker is referring to. |
If we're already considering this a breaking change, would it not make more sense to standardize all uses of |
babel/babel#13532 Babel released a patch that included renaming a config property. They are planning to reverse this change. This patch works with both the previous and current versions of babel.
@DylanPiercey this was not to be considered as a breaking change initially because of my fault. It will be reverted in the next patch version. The "big breaking change" is already scheduled for babel 8. |
I'm releasing v7.15.5 to revert this. |