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

feat: Allow to import without dist #6385

Merged
merged 1 commit into from
Jan 15, 2025
Merged

feat: Allow to import without dist #6385

merged 1 commit into from
Jan 15, 2025

Conversation

susnux
Copy link
Contributor

@susnux susnux commented Jan 14, 2025

The individual import path of components, composables, directives, and functions was changed.
The type of import is (e.g. components) is now lowercase and the dist will be omitted.
For example to import the NcButton component the path has changed:

  • from @nextcloud/vue/dist/Components/NcButton.js.
  • to @nextcloud/vue/components/NcButton.js

The old import paths are still valid, but deprecated and will be removed in version 9.

@susnux susnux added enhancement New feature or request 3. to review Waiting for reviews labels Jan 14, 2025
@susnux susnux requested a review from ShGKme January 14, 2025 17:35
@ShGKme
Copy link
Contributor

ShGKme commented Jan 14, 2025

Can/should we also remove .js suffix?

import NcButton from '@nextcloud/vue/components/NcButton'

@susnux
Copy link
Contributor Author

susnux commented Jan 14, 2025

Can/should we also remove .js suffix?

Yes we can, I have no strong opinion on this.
For real modules I prefer it without extension, but here 🤷
So yes if others also prefer it without extension.

@ShGKme
Copy link
Contributor

ShGKme commented Jan 14, 2025

For real modules I prefer it without extension, but here 🤷

That's why I don't like extensions here, they are different from real (even while it is valid)

@juliusknorr
Copy link
Contributor

Nice 👍

We should also update in the documentation

styleguide.config.js:			return `import ${name} from '@nextcloud/vue/dist/Components/${name}.js'`
docs/composables.md:import { useIsMobile } from '@nextcloud/vue/dist/composables/useIsMobile.js'
docs/composables.md:import { useIsMobile } from '@nextcloud/vue/dist/composables/useIsMobile.js'
docs/functions/usernameToColor.md:import usernameToColor from '@nextcloud/vue/dist/Functions/usernameToColor.js'
docs/functions/a11y.md:import { isA11yActivation } from '@nextcloud/vue/dist/Functions/a11y.js'
docs/directives.md:import Tooltip from '@nextcloud/vue/dist/Directives/Tooltip.js'
docs/directives.md:import vTooltip from '@nextcloud/vue/dist/Directives/Tooltip.js'
docs/directives.md:import Tooltip from '@nextcloud/vue/dist/Directives/Tooltip.js'
docs/composables/useHotKey.md:import { useHotKey } from '@nextcloud/vue/dist/Composables/useHotKey/index.js'
docs/directives/tooltip.md:import Tooltip from '@nextcloud/vue/dist/Directives/Tooltip.js'
docs/directives/focus.md:import Focus from '@nextcloud/vue/dist/Directives/Focus.js'
docs/directives/linkify.md:import Linkify from '@nextcloud/vue/dist/Directives/Linkify.js'

@susnux susnux force-pushed the feat/import-paths branch from e5908c4 to a174ce8 Compare January 15, 2025 12:14
@susnux
Copy link
Contributor Author

susnux commented Jan 15, 2025

@juliusknorr

We should also update in the documentation

Done ✅

The individual import path of components, composables, directives, and functions was changed.
The type of import is (e.g. `components`) is now lowercase and the `dist` will be omitted.

Signed-off-by: Ferdinand Thiessen <[email protected]>
@susnux susnux merged commit 25f0661 into master Jan 15, 2025
19 checks passed
@susnux susnux deleted the feat/import-paths branch January 15, 2025 20:17
@susnux susnux added this to the 8.23.0 milestone Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants