web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Javascript Modules - Useful or Unnecessary?

(0) ShareShare
ReportReport
Posted on by 283

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!

I have the same question (0)
  • Suggested answer
    Vipin J Profile Picture
    1,603 on at

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 137 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 57

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans