Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Javascript Modules - Useful or Unnecessary?

Posted on by 279

I currently use namespaces for my JS files after reading through some best practices for custom D365 CRM code.

However, I recently ran across a post that mentioned that modules, not namespaces, are now the preferred way of packaging code. Looking into this, I'm confused about a few things:

  • If the goal is to decrease load time, don't all the libraries included on a form get downloaded regardless? So packaging code into separate modules wouldn't improve load time, correct?
  • If the goal is to decrease or manage dependencies, don't all libraries get loaded before the UI loads, so that wouldn't be a concern?
  • Would a "helper file" with a namespace work just as well or the same as exporting/importing modules?

Thanks for the help!

  • Suggested answer
    Vipin J Profile Picture
    Vipin J 1,583 on at
    RE: Javascript Modules - Useful or Unnecessary?

    Can you provide that post here for reference. 

    Few notes about Jscript best practice here : https://vjcity.blogspot.com/2019/08/best-practise-to-write-javascript-in.html

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans