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

v2.0 Dev Server options need better names #41

Closed
Zearin opened this issue Sep 7, 2022 · 2 comments
Closed

v2.0 Dev Server options need better names #41

Zearin opened this issue Sep 7, 2022 · 2 comments
Milestone

Comments

@Zearin
Copy link

Zearin commented Sep 7, 2022

As recommended, reposting this issue here in the Dev Server repo:

11ty/eleventy#2550 (comment)

@Zearin
Copy link
Author

Zearin commented Sep 7, 2022

Reposting text for convenience:


I was reading about the upcoming Dev Server in v2, and I noticed some issues with the option names.

I’ll go through the options that raised my eyebrow one by one:


// Opt-out of the live reload snippet
enabled: true,

Nothing in this option name says anything about live reload.

Put another way: Could you tell what this option does from eleventyConfig.setServerOptions({ enabled: true })?

To me, it looks like you are simply enabling the server.

I recommend something like enableLiveReload: true instead.


// Opt-out of DOM diffing updates and use page reloads
domdiff: true,

This is a trivial nitpick, but when all other options are camelCase, my brain wants this option to be domDiff so that it matches.


// Show local network IP addresses for device testing
showAllHosts: false,

This option name is decent, but I think something a little more specific would be even better (e.g., showLocalHosts or showLocalDevices).


// Change the name of the special folder name used for injected scripts
folder: ".11ty",

This option has the same issue as enabled. What does eleventyConfig.setServerOptions({ folder: '.11ty' }) tell you? I would probably read that and think it is setting the root folder to serve files from.

Additionally, since specifying folders is a really common configuration option, I recommend something like:

folder: {
    injectedScripts: ".11ty",
    // ... future folder-related configuration options can be added to `folder`
}

@zachleat
Copy link
Member

This will ship with 1.0 (dev server). The old names will continue to work to prevent broken builds. I’ll update the docs shortly

zachleat added a commit to 11ty/11ty-website that referenced this issue Jan 13, 2023
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

2 participants