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

Export each util separately #4871

Closed
pjasiun opened this issue Mar 11, 2016 · 6 comments · Fixed by ckeditor/ckeditor5-utils#29
Closed

Export each util separately #4871

pjasiun opened this issue Mar 11, 2016 · 6 comments · Fixed by ckeditor/ckeditor5-utils#29
Assignees
Labels
intro Good first ticket. package:utils type:improvement This issue reports a possible enhancement of an existing feature.
Milestone

Comments

@pjasiun
Copy link

pjasiun commented Mar 11, 2016

I should be able to do:

import { count } from '/ckeditor5/utils/utils.js';

Instead of:

import utils from '/ckeditor5/utils/utils.js';
const count = utils.count;
@Reinmar
Copy link
Member

Reinmar commented Mar 11, 2016

I'm actually thinking about implementing each util in a separate file. We could get rid of the file named util.js which looks funny in ckeditor5-utils package.

Another argument for splitting utils will be that we'll be adding more and more functions to util.js and at some point we may end up with one huge file, like in CKE4. Module per function, like it's done by lodash, keeps things short and neat.

@Reinmar Reinmar changed the title Export each util separatly Export each util separately May 4, 2016
@oskarwrobel oskarwrobel self-assigned this May 4, 2016
@pjasiun
Copy link
Author

pjasiun commented May 4, 2016

If you found it reasonable you can group these utils in folders like dom utils are grouped.

@oskarwrobel
Copy link
Contributor

Thanks, I'll consider it.

@Reinmar
Copy link
Member

Reinmar commented May 5, 2016

How would we name it? misc/? Then we'll have to answer the question what falls into miscellaneous and what not :P.

@pjasiun
Copy link
Author

pjasiun commented May 5, 2016

We have a proud tradition of creating utils inside utils :D

But seriously, there is a big group of utils which helps us dealing with collections (arrays, maps and iterable). We could have them in one folder (together with a diff util) and the rest (spy, uid and mix) could be directly in the main directory. The problem is how to call such folder, since we already have collection util which is something different.

BTW: who use spy util, and why not sinon?

I do not think we should have a folder for miscellaneous utils since the whole repository is for it :P

@fredck
Copy link
Contributor

fredck commented May 5, 2016

Sounds unclear for me. I would just KISS and leave things at the root so we don't waste much more time talking about it.

@mlewand mlewand transferred this issue from ckeditor/ckeditor5-utils Oct 9, 2019
@mlewand mlewand added this to the v0.1.0 milestone Oct 9, 2019
@mlewand mlewand added intro Good first ticket. type:improvement This issue reports a possible enhancement of an existing feature. package:utils labels Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
intro Good first ticket. package:utils type:improvement This issue reports a possible enhancement of an existing feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants