You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Published NPM Modules docs should show more information or guidelines using own dependencies than relying on Apostrophe's Browser libraries pushed (JQuery, Lodash and etc)
#154
I would make a PR for this but I don't know how is it going to be on Apostrophe 3.0 modules. As I recall, Apostrophe 3.x will make everything in VanillaJS on browser side to avoid using Jquery, Lodash and etc. Before making an update to the Docs, I would like to highlight some use case before we proceed to update the docs.
As discussed in Discord App regarding of apostrophe lean front-end issue, I believe in Apostrophe 2.x user.js will always push jQuery in it but not in always.js. I hope, we could publish npm package modules from 2.x that also can be used in Apostrophe 3.x to avoid redundancy package published. (It is happening to all modules in Apostrophe 0.5x and this could also avoid confusion on finding the right packaged modules for each version of Apostrophe)
If apostrophe lean front-end is enabled, I wonder about $fieldSet attribute in browser-based class module from self.populate arguments. That argument will always return jQuery object which will take different methods to get that querySelector. Main question for this point is , Should we consider If Else statement to determine if the $fieldSet is the constructor of jQuery when using lean front-end and the module is pushed as always ?
In jQuery :
$($fieldSet).find()
// or
$fieldSet.find()
In Javascript :
$fieldSet.get(0).querySelector()
Lastly, I would like to highlight on this section of the docs in Apostrophe 2.x Publishing Your Own NPM Modules for Apostrophe, should provide a warning sign without assuming that Apostrophe will always use these dependencies libraries of jQuery, Lodash and etc.
I'm open to more suggestions and ideas on how to fix this documentation issues of publishing our own npm modules to Apostrophe that covers all use cases above.
The text was updated successfully, but these errors were encountered:
Hi Amin!
I appreciate your input but it is just too early to document how this will
work on 3.0. You can help us decide how it will work though, see link at
the end.
As for 2.x, our documentation covers how to push additional assets in any
module.
We could add some discussion of lean frontend's impact. For logged in
editing features, there is zero impact - jquery, lodash, etc. are all
present at all times when a user is logged in.
If your module cares about the frontend for logged out site visitors (most
don't have this concern), then yes, you benefit from more info about how to
be lean-ready if you so choose, in order to be compatible with sites that
actually choose to go for "lean: true" (pretty uncommon so far). So let's
keep this ticket open for a PR about that.
See here for 3.x discussion about the frontend world:
apostrophecms/apostrophe#1589
On Tue, Jun 25, 2019, 1:31 PM Amin Shazrin ***@***.***> wrote:
I would make a PR for this but I don't know how is it going to be on
Apostrophe 3.0 modules. As I recall, Apostrophe 3.x will make everything in
VanillaJS on browser side to avoid using Jquery, Lodash and etc. Before
making an update to the Docs, I would like to highlight some use case
before we proceed to update the docs.
1.
As discussed in Discord App, I believe in Apostrophe 2.x user.js will
always push jQuery in it but not in always.js. I hope, we could use
npm published package modules from 2.x can be used in Apostrophe 3.x to
avoid redundancy package published. (It is happening to all modules in
Apostrophe 0.5x and this could also avoid confusion on finding the right
packaged modules for each version of Apostrophe)
2.
If apostrophe lean front-end is enabled, I wonder about $fieldSet
attribute in browser-based class module from self.populate arguments.
That argument will always return jQuery object which will take different
methods to get that querySelector. Main question for this point is , *Should
we consider If Else statement to determine if the $fieldSet is the
constructor of jQuery on lean front-end if that module is pushed as always
?*
In jQuery :
$($fieldSet).find()
// or
$fieldSet.find()
In Javascript :
$fieldSet.get(0)
1. Lastly, I would like to highlight on this section of the docs in
Apostrophe 2.x Publishing Your Own NPM Modules for Apostrophe
<https://docs.apostrophecms.org/apostrophe/other/more-modules#publishing-your-own-npm-modules-for-apostrophe>,
should provide a warning sign without assuming that Apostrophe will always
use these dependencies libraries of jQuery, Lodash and etc.
I open to more suggestions and ideas on how to fix this documentation
issues of publishing our own npm modules to Apostrophe.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#154?email_source=notifications&email_token=AAAH27LORA4OP7HTXQDO5Z3P4JI75A5CNFSM4H3KTQKKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G3TOFEQ>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAH27I27VKRN25KXF7ZAI3P4JI75ANCNFSM4H3KTQKA>
.
I would make a PR for this but I don't know how is it going to be on Apostrophe 3.0 modules. As I recall, Apostrophe 3.x will make everything in VanillaJS on browser side to avoid using Jquery, Lodash and etc. Before making an update to the Docs, I would like to highlight some use case before we proceed to update the docs.
As discussed in Discord App regarding of apostrophe lean front-end issue, I believe in Apostrophe 2.x
user.js
will always push jQuery in it but not inalways.js
. I hope, we could publish npm package modules from 2.x that also can be used in Apostrophe 3.x to avoid redundancy package published. (It is happening to all modules in Apostrophe 0.5x and this could also avoid confusion on finding the right packaged modules for each version of Apostrophe)If apostrophe lean front-end is enabled, I wonder about
$fieldSet
attribute in browser-based class module fromself.populate
arguments. That argument will always return jQuery object which will take different methods to get that querySelector. Main question for this point is , Should we considerIf Else
statement to determine if the$fieldSet
is the constructor of jQuery when using lean front-end and the module is pushed asalways
?In jQuery :
In Javascript :
I'm open to more suggestions and ideas on how to fix this documentation issues of publishing our own npm modules to Apostrophe that covers all use cases above.
The text was updated successfully, but these errors were encountered: