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

Omitting default options #37

Open
marcovtwout opened this issue Apr 7, 2017 · 3 comments
Open

Omitting default options #37

marcovtwout opened this issue Apr 7, 2017 · 3 comments

Comments

@marcovtwout
Copy link

After filling out the form at https://realfavicongenerator.net/favicon/grunt, about 60 lines of configuration are generated. I was wondering, can I simply omit them from my configuration?

My grunt config could only have:

         realFavicon: {
            favicons: {
                src: 'master.png',
                dest: 'dist/favicons/',
                options: {
                    iconsPath: '/',
                    html: [ 'index.html' ],
                }
            }
        }

Every omitted config option could revert to the default value. Is this possible?

@phbernard
Copy link
Contributor

This may work as expected. However, there is no warranty about this. If tomorrow a default value is changed, it might break your favicon design without notice. Maybe the right solution is to put the configuration in a separate file (one you will never look at).

@marcovtwout
Copy link
Author

I think any API benefits from having good default values, and API versioning should prevent changes without notice. I realise this is more of an API-request and not grunt specific, but I'm not sure where to file it.

@phbernard
Copy link
Contributor

I certainly agree with what you say.

For the RFG API, the rational is a bit different. You (almost) always use RealFaviconGenerator.net (the web site) as a GUI wizard. So the API request verboseness is not really an issue because you didn't have to actually type it.

Granted: the favicon stuff suddenly becomes the biggest task of your Grunt or Gulp file, which is a bit odd.

Two items must be addressed to tackle this issue:

  • Ensure default values do not change over time. This is already the case, although more as a good practice than as a "feature".
  • Make the service creates minimalist requests. Because emptying the request yourself is error prone.

This second point is simple, but it will require some efforts in the API test suite (although not much, just add a few additional test cases). and in the internal unit tests. This last point will demand some time, as this part is well covered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants