Skip to content

Conversation

@rijkvanzanten
Copy link
Member

@rijkvanzanten rijkvanzanten commented Jul 22, 2022

When the app was first created, the decision was made to put every util/composable/component into a folder, with an index.ts file that would reexport the component:

import Example from './example.vue';

export { Example };
export default Example;

The idea behind this was that it would make the usage of these parts nicer, by allowing any:

import Example from '@/components/example';
import { Example } from '@/components/example';
import Example from '@/components/example/';
import { Example } from '@/components/example/';

However, in practice this is rather pointless. Dev tooling nowadays will autocomplete and resolve imports on your behalf, and this mixed usage turned into a bit of a messy import system, where different components would use different strategies. It also means that you can't properly rely on global searching, as the generic import means that components can import them under a different name. It also complicates testing coverage a bit, as there's a lot of needless imports/exports that need to be re-tested. This PR cleans that up to prepare for easier integration with testing suites coming soon.


Also removing the outdated readme.md files that were scattered around the nested folders in favor of moving that into the docs

@rijkvanzanten rijkvanzanten marked this pull request as ready for review July 22, 2022 17:26
@rijkvanzanten rijkvanzanten merged commit d6846d7 into main Jul 22, 2022
@rijkvanzanten rijkvanzanten deleted the refactor/app-folders branch July 22, 2022 19:10
@azrikahar azrikahar added this to the Next Release milestone Jul 25, 2022
@azrikahar azrikahar mentioned this pull request Jul 25, 2022
9 tasks
qborisb pushed a commit to qborisb/directus that referenced this pull request Jul 28, 2022
* Remove unused nested folders from components

* Remove nested folders

* Standardize composables output

* Fix import inconsistencies

* Same trick for directives

* Same for routes

* Replace reliance root grouped export in favor of explicit imports

* Replace reliance on implicit imports

* Remove nested folder structure

* Consistent use of non-default exports in utils

* Remove nested folder structure from private components

* Fix test mock

* Remove extraneous component registration for valuenull

* Fix stores provider

* Fix logo sprite
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants