English 中文(简体)
消防站诉9号,在机动车上装载大型机体(263K)
原标题:Firebase v9 loads a large iframe.js (263K) on mobile

仅在机动版本上将消防基地从V8升级至V9,之后,从<>https://[Firebase ProjectId].firebaseapp.com/__auth/iframe.js上载了大型javascript文档(263K)。 (见以下图象):

“entergraph

至今为止唯一发现的圆点是,它可能与本论坛提及的在神学院实行限制有关:

I m 不允许在 Chrome中使用任何 co基限制,因为所有 co都是根据以下环境允许的:chrome http://dings/cookies?search=cookies

此外,我还有残疾人<>加强保护的更安全 Browsing,将其定为。 此处无保护(未建议):chrome://dings/security?search=cookies

但是,iframe.js仍被装上移动式。

I am using [email protected] library with version 9 modular (not compat) code snippets here: https://firebase.google.com/docs/web/modular-upgrade.

Any idea or clue about getting rid of this huge iframe.js file will be appreciated. Even though the library is BETA, everything else works as expected with tree-shaking that considerably reduced client side package size.

You can test with Lighthouse on my personal Website here: https://guydumais.digital

预告见你们!

问题回答

We also had this problem for quite a while, I ve just recently found this link https://firebase.google.com/docs/auth/web/custom-dependencies

在流动浏览器上,图书馆将自动向奥恩特区开放一个框架。 这样做是为了使大多数用户能够无缝地获得经验,但随着时间的推移,可能会通过增加代码来影响业绩。 可以通过使用初始版本Auth()和人工通过浏览器PopupRedirectResolver依赖需要的功能来避免这种行为。

import {initializeAuth, browserLocalPersistence, browserPopupRedirectResolver, indexedDBLocalPersistence, signInWithRedirect, GoogleAuthProvider} from "firebase/auth";
import {initializeApp} from "firebase/app";

const app = initializeApp({/** Your app config */});
const auth = initializeAuth(app, {
  persistence: [indexedDBLocalPersistence, browserLocalPersistence],
});

// Later
signInWithRedirect(auth, new GoogleAuthProvider(), browserPopupRedirectResolver);

Here goes my solution. I only dynamic import firebase auth when I need it. So I don t call it in the entire application, only when am making request to firebase. If you have small to medium application, it should not be to much work. Tip: To keep the state of current user, use cookies.

const onSubmit = async () => {
  const { getAuth } = await import("firebase/auth");
  getAuth(firebase);
}

如果你想保留改头/人使用标识的选择,解决办法如下。 在你的主要火库中,压倒了主机,确定 au/frame是否。 j 档案应当装载。

import { initializeApp } from "firebase/app";
import { browserPopupRedirectResolver } from "firebase/auth";

Object.defineProperty(browserPopupRedirectResolver.prototype,
   _shouldInitProactively , { get: function() {return false;} });

const firebaseConfig = { /*...*/ };
export const app = initializeApp(firebaseConfig);

如有必要,则将下列功能从某个地方接通,因为用户会看到信号,而会有人会pop住/后方向,或许会采用一种成因的方法。 主要呼吁是重新定位初始功能。

let resolverIsInitialized = false;


async function initializePopupRedirectResolverOnRender() {
  if (resolverIsInitialized) return;

  try {
    await auth.authStateReady();
    if (!resolverIsInitialized) auth._popupRedirectResolver._initialize(auth);
    resolverIsInitialized = true;
  } catch (error) {
    console.error(error);
  }
}

Reference to my solution on GitHub: https://github.com/firebase/firebase-js-sdk/issues/4946#issuecomment-1918193756





相关问题
拆除月度边界(实际大型日历)

采用大型反应日历的Im, 并想要清除包罗日历的边界。 以及如何改变日记栏和日记的颜色? 如何使其发挥作用?

表中未显示的元数据

我将元件定义为如下文所示,但是在我的剪辑中,它没有显示“当地:3000/#home”。 我的所有jsx档案都有“用户”bc。

NextJS 13 Data Fetching

Is there anyway of custom baseURL for their fetch method? For example in axios: const instance = axios.create({ baseURL: https://some-domain.com/api/ , timeout: 1000, headers: { X-Custom-Header ...

热门标签