-
-
Notifications
You must be signed in to change notification settings - Fork 224
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
Updated javascript guide to remove RequireJS references #36117
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
In order to ensure that the CDN has the most up to date version, we | ||
append a version number to the end of the javascript file that is a sha | ||
of the file. This infrastructure was already in place for cache busting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we no longer do this? For my curiosity, how does Webpack do it? (I forget if I knew this and am just forgetting right now, or if it's a piece of Webpack infra I never realized existed.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Webpack embeds a hash in the filename itself (on production environments), so it's similar to django compressor. So we no longer need to do this for js, but we do still need to do it for other static assets (stylesheets, images - although it's possible to also use webpack to handle these down the road). There's a ticket files to update the static asset handling for the build process. I'm hoping to at least make it faster.
docs/js-guide/migrating.rst
Outdated
and unmigrated pages. | ||
- `Bundler migration (RequireJS): dashboard <https://github.com/dimagi/commcare-hq/pull/19182/>`__ is an | ||
example of an easy migration, where all dependencies are already migrated | ||
- `Bundler proof of concept (with RequireJS) <https://github.com/dimagi/commcare-hq/pull/18116>`__ migrates a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's unfortunate that these still mention RequireJS. I guess we do not have examples of migrating to Webpack? Do you know how hard it would be to create new ones?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took a look at the linked PRs and decided to just remove this section: 23a6351 I don't think looking at those PRs (especially the massive old requirejs proof of concept PR!) will help anyone any more than just looking at production pages that use webpack. I'm also anticipating removing the docs fairly soon, once app manager is on webpack (it's currently in QA).
docs/js-guide/migrating.rst
Outdated
1. Add ``js_entry`` tag and remove ``<script>`` tags | ||
1. Add dependencies | ||
1. Test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, doesn't look like this formatted correctly.
Safety Assurance
Safety story
Docs only
Automated test coverage
yes
QA Plan
no
Rollback instructions
Labels & Review