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

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

Open
ammein opened this issue Jun 25, 2019 · 1 comment

Comments

@ammein
Copy link

ammein commented Jun 25, 2019

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 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)

  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 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()
  1. 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.

@boutell
Copy link
Member

boutell commented Jun 26, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants