什么是“Javascript 引导加载程序”?

发布于 2024-09-14 03:25:21 字数 130 浏览 5 评论 0原文

我主要在Facebook的源代码中看到过这个 Bootloader.setResourceMap({"bMxb7":{"name":.... javascript中的bootloader到底是什么?它的用途和目的是什么?

I have seen this mainly in the source of Facebook Bootloader.setResourceMap({"bMxb7":{"name":.... What is exactly a bootloader in javascript? What is its use and purpose?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

小红帽 2024-09-21 03:25:21

Bootloader 是 Facebook 前端代码的重要组成部分,它允许 Javascript 库根据需要延迟加载,而不是在页面加载。如果您愿意,一些 Facebook 开发人员在此了解更多详细信息了解更多。

您可以使用 RequireJSLABjs其他来实现同样的事情。

Bootloader is an important part of Facebook's front-end code, which allows Javascript libraries to be lazy-loaded as needed instead of on page load. A couple of Facebook developers go into further detail here if you'd like to know more.

You can use RequireJS, LABjs or others to achieve the same thing.

你与昨日 2024-09-21 03:25:21

一般来说,引导加载程序是一段(相对)少量的代码,负责建立所有后续代码运行所需的环境,因此它也是最先执行的代码。它通常仅限于操作系统,但对于 FB 也有意义。

就 Facebook 而言,除了开发人员在文档中包含的单个公共

Generally speaking, the bootloader is a (relatively) small amount of code responsible for establishing the environment that all subsequent code requires to run, as such it is also the the first code to be executed. It's usually restricted to OSes, but makes sense for FB too.

In the case of Facebook, the bootloader will do things like loading additional JS files and other resources that the library needs in addition to the single public <script /> the developer included in the document.

单身狗的梦 2024-09-21 03:25:21

严格来说,不存在这样的事情。

引导加载程序(这是该术语的全称)是操作系统的一部分,它从磁盘加载磁盘操作系统,因此计算机通过引导程序自行提升,在加载磁盘加载例程之前从磁盘加载。

没有 Javascript 操作系统,因此没有 Javascript 的引导加载程序。这只是一个以这种方式命名的对象,大概是因为它在页面加载过程的早期做了一些事情。

Strictly speaking, there is no such thing.

A bootstrap loader (which is the full name of the term) is the part of an operating system that loads the disk operating system from disk, thus the computer lifts itself by the bootstraps, by loading from disk before the disk loading routines are loaded.

There are no Javascript operating systems, so there is no bootstrap loader for Javascript. This is just some object that is named that way, presumably because it does something early in the page load process.

╄→承喏 2024-09-21 03:25:21

这是来自 React.js Conf 2016 的视频,介绍了 Bootloader 是什么。但总而言之:引导加载程序有助于提高应用程序的性能,但不会下载内容,除非确实需要。该视频包含“分享按钮”

https://youtu.be/SnAq9tbeRm4?t=17m16s< /a>

Here is a video from React.js Conf 2016 that touches on what Bootloader is. But to summarize: Bootloader helps improve the performance of the app but not downloading content unless they are actually needed. The video has the example of the 'share button'

https://youtu.be/SnAq9tbeRm4?t=17m16s

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文