Put react / react-dom for newtab, about:welcome, and (eventually) about:asrouter into a shared location
Categories
(Firefox :: New Tab Page, task, P3)
Tracking
()
People
(Reporter: mconley, Unassigned)
References
(Blocks 1 open bug)
Details
about:welcome, about:newtab and the upcoming about:asrouter all use the same instances of react.js and react-dom.js. They don't webpack bundle them, but treat them as externals that are loaded via <script> tags within the host page:
- https://searchfox.org/mozilla-central/rev/033cc91cd088a992ab8728bab9821624cee62ce5/browser/components/aboutwelcome/content/aboutwelcome.html#39-40
- https://searchfox.org/mozilla-central/rev/033cc91cd088a992ab8728bab9821624cee62ce5/browser/base/content/spotlight.html#27-28
- https://searchfox.org/mozilla-central/rev/033cc91cd088a992ab8728bab9821624cee62ce5/browser/components/newtab/prerendered/activity-stream.html#42-43
Given this relationship, we should probably move these scripts somewhere for shared scripts, rather than having it live under browser/components/newtab.
I'm tempted to put these under toolkit/content/widgets/vendor, but am definitely open to alternatives.
What do you think, mstriemer?
Comment 1•2 years ago
|
||
I think it would depend on if we expect to have all of our react pages on the same version of react. That seems like a reasonable place to host a react to do so, but if its an older version of react since newtab code can't update to the latest or something then that may give a false impression that it's up to date and expected to be the de facto react version
Updated•2 years ago
|
Description
•