Replies: 5 comments 4 replies
-
My first thought is to recommend kebab case (hyphens) and no other
punctuation in module names. It is true that npm module name validators do
not forbid periods, but it is unusual and more likely to lead to issues of
this kind. A module alias does not always exist.
But that's just my first thought and we should look into how serious the
dot path issue might be. I believe we've reduced our reliance on dot paths
because of their tendency to change. It might turn out to be vestigial.
…On Wed, Jul 21, 2021 at 11:14 AM Miro Yovchev ***@***.***> wrote:
Recently I've spotted that apos array field type is keeping a underscore
path reference like that:
scopedArrayName: ***@***.***/smr.event.sponsors
This is a real life example directly pulled up from the DB. The problem
here is that the name of the module is @corllete/smr.event and sponsors
is the field name. So this reference, if used, will be broken. Is this
reference used? If yes, do you think it's better to use the module alias
instead? Or maybe the whole could be ***@***.***/smr.event].sponsors?
My naming convention for the project contains dots for the unique prefix,
the rest is following the A3 conventions. Example:
smr.event, smr.event-page, smr.event-widget.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#3256>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAH27PHZWSCDWKVA4BJCUTTY3P5RANCNFSM5AYFOFNA>
.
--
THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER
APOSTROPHECMS | apostrophecms.com | he/him/his
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
myovchev
-
(I bring up npm module names because there is already a clear tendency in
Apostrophe to follow the same conventions as npm, which is why even core
modules in bundles use the @namespace/name syntax.)
…On Wed, Jul 21, 2021 at 11:25 AM Tom Boutell ***@***.***> wrote:
My first thought is to recommend kebab case (hyphens) and no other
punctuation in module names. It is true that npm module name validators do
not forbid periods, but it is unusual and more likely to lead to issues of
this kind. A module alias does not always exist.
But that's just my first thought and we should look into how serious the
dot path issue might be. I believe we've reduced our reliance on dot paths
because of their tendency to change. It might turn out to be vestigial.
On Wed, Jul 21, 2021 at 11:14 AM Miro Yovchev ***@***.***>
wrote:
> Recently I've spotted that apos array field type is keeping a underscore
> path reference like that:
> scopedArrayName: ***@***.***/smr.event.sponsors
> This is a real life example directly pulled up from the DB. The problem
> here is that the name of the module is @corllete/smr.event and sponsors
> is the field name. So this reference, if used, will be broken. Is this
> reference used? If yes, do you think it's better to use the module alias
> instead? Or maybe the whole could be ***@***.***/smr.event].sponsors?
>
> My naming convention for the project contains dots for the unique prefix,
> the rest is following the A3 conventions. Example:
> smr.event, smr.event-page, smr.event-widget.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#3256>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAAH27PHZWSCDWKVA4BJCUTTY3P5RANCNFSM5AYFOFNA>
> .
>
--
THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER
APOSTROPHECMS | apostrophecms.com | he/him/his
--
THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER
APOSTROPHECMS | apostrophecms.com | he/him/his
|
Beta Was this translation helpful? Give feedback.
3 replies
-
Thanks for letting us know Miro and for being understanding. I am opening a
ticket to get this documented.
…On Thu, Jul 22, 2021 at 6:07 AM Miro Yovchev ***@***.***> wrote:
There is definitely a problem with module names containing dots and it
might have further implications in the future. So I've decided to go for
mass refactoring. When it comes to DB migration, we'll go for old school find
and replace:
- dump docs to json
- find and replace manually in the dump
- replace docs in the DB
This sounds like the painless way to go.
@boutell <https://github.com/boutell> this definitely needs to be added
to a good visible place in docs. I don't recall it's mentioned.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3256 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAH27OIKVRBRLO4X6Q66TLTY7UUVANCNFSM5AYFOFNA>
.
--
THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER
APOSTROPHECMS | apostrophecms.com | he/him/his
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Glad it wasn't so hard! But we have an internal ticket open to print a
linter message to save the next person (:
…On Thu, Jul 22, 2021 at 3:35 PM Miro Yovchev ***@***.***> wrote:
I've made a bad call based on speculation and not enough research in first
place :)
And the price I'm paying is not that great - we finished full refactoring
in 3-4 hours including DB migration and deployment. And hopefully other
devs won't fall in that trap in the future. Happy ending :)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3256 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAH27K5XCYG2NFUVT6CWC3TZBXHDANCNFSM5AYFOFNA>
.
--
THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER
APOSTROPHECMS | apostrophecms.com | he/him/his
|
Beta Was this translation helpful? Give feedback.
0 replies
-
The rule will be that the module name must match the slug-ified version of
itself. So no punctuation except hyphens, but unicode is supported.
…On Thu, Jul 22, 2021 at 3:46 PM Tom Boutell ***@***.***> wrote:
Glad it wasn't so hard! But we have an internal ticket open to print a
linter message to save the next person (:
On Thu, Jul 22, 2021 at 3:35 PM Miro Yovchev ***@***.***>
wrote:
> I've made a bad call based on speculation and not enough research in
> first place :)
> And the price I'm paying is not that great - we finished full refactoring
> in 3-4 hours including DB migration and deployment. And hopefully other
> devs won't fall in that trap in the future. Happy ending :)
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#3256 (reply in thread)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAAH27K5XCYG2NFUVT6CWC3TZBXHDANCNFSM5AYFOFNA>
> .
>
--
THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER
APOSTROPHECMS | apostrophecms.com | he/him/his
--
THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER
APOSTROPHECMS | apostrophecms.com | he/him/his
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Recently I've spotted that apos
array
field type is keeping aunderscore path
reference like that:scopedArrayName: doc.@corllete/smr.event.sponsors
This is a real life example directly pulled up from the DB. The problem here is that the name of the module is
@corllete/smr.event
andsponsors
is the field name. So this reference, if used, will be broken. Is this reference used? If yes, do you think it's better to use the module alias instead? Or maybe the whole could bedoc[@corllete/smr.event].sponsors
?My naming convention for the project contains dots for the unique prefix, the rest is following the A3 conventions. Example:
smr.event
,smr.event-page
,smr.event-widget
.Beta Was this translation helpful? Give feedback.
All reactions