Parcel 2: .parcelrc should actually be called .parcelrc.json
See original GitHub issue💬 RFC
The new configuration file .parcelrc
is a JSON file, and the file name should reflect it as such.
🔦 Context
Using a name without an extension is cute, but doesn’t have any real positive effects when you’re using a well established format. Adding the extension on the other hand gives you…
- Editor code completion
- Syntax highlighting
- Increased clarity!
💻 Examples
Many tools that use configuration files have moved away from file names without extensions.
ESLint is probably the most well known. Yarn is making the transition in their upcoming v2 from the name .yarnrc
to .yarnrc.yml
to reflect its YAML syntax.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:32
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Parcel 2 RC
The Parcel team is very excited to announce the first Parcel 2 release candidate! This release includes many improvements, including new ...
Read more >Plugins - Parcel
Parcel configuration is specified in a .parcelrc file. It is written in JSON5, which is similar to JSON but supports comments, unquoted keys,...
Read more >Migration - Parcel
The first thing to note when upgrading from Parcel 1 to Parcel 2 is that the npm package name has changed from parcel-bundler...
Read more >Announcing Parcel v2!
For many projects, it's as simple as updating the dependency in your package.json! If you're starting a new project, we have getting started ......
Read more >Parcel 2 alpha 1 is here!
... simple JSON file called .parcelrc. There is no JavaScript or complex logic required to configure Parcel, if you ever need to at...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
.js
config files are not going to happen in parcel. We’ve discussed them generally in various other issues. They may seem nice at first, but have many many downsides. Once you support.js
, it’s a slippery slope towebpack.config.js
. We want the configuration experience using Parcel to be as minimal as possible, if you need it at all.There are also other technical reasons for not supporting them, such as the possibilities of indeterminism and non-cacheability they create. This happens with
babel.config.js
already, for which we have to disable much of Parcel’s caching support, leading to slower performance. We recently contributed support forbabel.config.json
to alleviate this.That’s actually not the case. Technically
.parcelrc
is JSON5 right now, although we are discussing using JSONC.Using
.json
in the filename does not save us from having to tell every single syntax highlighter (editors, github, etc) that.parcel.json
should beJSONC
. Seetsconfig.json
in Linguist for example.So for your list:
I know I was confused when
tsc --init
generated a JSON file with comments. And my editor was very angry about it, giving me red syntax error squiggles over the entire file.In that case it seems better to actually it rendered as plain text unless the editor has mapped the file extension ahead of time.
The alternative here is to use something like:
I have a feeling that people will complain about those names though, let’s just jump straight to “Y U NO USE TOML/YAML?”
Originally I wanted to use TOML, but I couldn’t come up with a configuration syntax that wasn’t annoyingly verbose because of the globs.
In the case of YAML, I felt like it was an overly complex format for what I wanted out of Parcel’s configuration. I expect/want most
.parcelrc
files to be very small. I wanted a really restricted format so that online examples are easy to understand and copy-and-paste. YAML allows you do so many things that can cause confusion and that make it hard to copy and paste.The other notable alternative was to use a
.js
file, like many tools have been doing recently. But again, Parcel configs are meant to be small, very static (making it easier to cache), and very easy to share. Allowing them to be scripted cause a whole suite of downstream tooling problems.Having helped introduce the original
.babelrc
file, and having watched the results of the Babel team adding almost a dozen other filenames. I know that it’s not an ideal name, but it is far better than the alternatives. Babel is just digging a hole for itself for no good reason.Right now I still feel like
.parcelrc
is the best file name choice.I could be convinced that a better name would be:
I did bring up using
.json
with the team though, mine is not the only opinion.