Skip to content
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

Page score might require updation #89

Open
HimanshuNarang opened this issue Jul 25, 2023 · 0 comments
Open

Page score might require updation #89

HimanshuNarang opened this issue Jul 25, 2023 · 0 comments

Comments

@HimanshuNarang
Copy link

HimanshuNarang commented Jul 25, 2023

Hello,
I created a sample app for mocking the js thread blocking with infinite loop, after running the app I could see that UI is not being drawn and user input was not being served, but surprisingly after stopping the page score measuring I got the page score 99 although complete UI was blocked and user couldn't see any update on the display.
I am not sure which factor need to use for updating the page score formula but it was the case which should be handled in the formula.

Blocking Code:

`
import React, { useEffect, useState } from 'react';
import {
SafeAreaView,
ScrollView,
StatusBar,
StyleSheet,
Text,
View,
} from 'react-native';

import {
Colors,
DebugInstructions,
Header,
LearnMoreLinks,
ReloadInstructions,
} from 'react-native/Libraries/NewAppScreen';

/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's

  • LTI update could not be added via codemod */
    const Section = ({children, title}) => {
    return (

    <Text
    style={[
    styles.sectionTitle,
    {
    color: Colors.black,
    },
    ]}>
    {title}

    <Text
    style={[
    styles.sectionDescription,
    {
    color: Colors.dark,
    },
    ]}>
    {children}


    );
    };

const App = () => {
const [name, setName] = useState("xyz")

const backgroundStyle = {
backgroundColor: Colors.lighter,
};

useEffect(()=>{
// setTimeout(()=>{
let t = 1
while(t < 100000){
setName("infinite loop, js thread blocked")
setTimeout(() => {
t++;
}, 200);
}
// },1000)
})

return (

    <StatusBar
      barStyle={'dark-content'}
      backgroundColor={backgroundStyle.backgroundColor}
    />
    <ScrollView
      contentInsetAdjustmentBehavior="automatic"
      style={backgroundStyle}
      >
      <Header />
      <View
        style={{
          backgroundColor: Colors.white,
        }}>
        <Section title="Step One">
          Edit <Text style={styles.highlight}>{name}</Text>
        </Section>
        <Section title="See Your Changes">
          <ReloadInstructions />
        </Section>
        <Section title="Debug">
          <DebugInstructions />
        </Section>
        <Section title="Learn More">
          Read the docs to discover what to do next:
        </Section>
        <LearnMoreLinks />
      </View>
    </ScrollView>
  </SafeAreaView>

);
};

const styles = StyleSheet.create({
sectionContainer: {
marginTop: 32,
paddingHorizontal: 24,
},
sectionTitle: {
fontSize: 24,
fontWeight: '600',
},
sectionDescription: {
marginTop: 8,
fontSize: 18,
fontWeight: '400',
},
highlight: {
fontWeight: '700',
},
});

export default App;
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant