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

Convert this module into a runtime package #12

Merged
merged 10 commits into from
Oct 9, 2023
Merged

Convert this module into a runtime package #12

merged 10 commits into from
Oct 9, 2023

Conversation

ramyakrishnai
Copy link
Contributor

@ramyakrishnai ramyakrishnai commented Sep 20, 2023

Will address #2

@wpscholar
Copy link
Member

Thanks @ramyakrishnai,

Let's hold on merging this just yet. After discussions with @arunshenoy99 about how we'll handle modules moving forward, I think we will stick with the wp-module-runtime name.

Additionally, in the bootstrap.php file, this is actually what I had in mind:

if ( function_exists( 'add_action' ) )  {
	add_action(
		'newfold_container_set',
		function ( $container )  {
                        $runtime = new Runtime( $container );
                        $runtime->loadIntoPage( 'admin_enqueue_scripts' );
               }
        );
}

@ramyakrishnai
Copy link
Contributor Author

ramyakrishnai commented Sep 22, 2023

hi @wpscholar ,
I tried the code that is shared here but after addig that, newfoldruntime is not loading in the window object getting an error.

I also tried with this https://github.com/newfold-labs/wp-module-data/blob/main/bootstrap.php#L79-L109 but it is still throiwng the same error

I'm sharing the error here and also attached a screenshot for your reference

**
Uncaught TypeError: Cannot read properties of undefined (reading 'isJarvis')
at 4432 (accountCard.js:14:37)
at a (bootstrap:19:22)
at 689 (index.js?ver=b922c5eee28c4c013ea5:1:667442)
at a (bootstrap:19:22)
at 3400 (index.js?ver=b922c5eee28c4c013ea5:1:657785)
at a (bootstrap:19:22)
at 2386 (index.js?ver=b922c5eee28c4c013ea5:1:660941)
at a (bootstrap:19:22)
at index.js?ver=b922c5eee28c4c013ea5:1:810445
at index.js?ver=b922c5eee28c4c013ea5:1:811375
**
Screenshot 2023-09-22 at 5 16 21 PM

Could you please assist me with this.

Thank you!

@ramyakrishnai ramyakrishnai linked an issue Sep 25, 2023 that may be closed by this pull request
@circlecube
Copy link
Member

These errors look like the runtime object wasn't set up properly so when the app tried to find the isJarvis value (I'm sure among others), the app broke.

We'll still need to use the Wordpress hook to add the code (add_action). It looks like that is missing. Looks like the code included in this PR doesn't reflect the suggestion @wpscholar mentioned either.

@ramyakrishnai
Copy link
Contributor Author

Hi @circlecube , I've checked with the @wpscholar suggestion and getting the error as shown above. Like I mean NewfoldRuntime is not getting loaded correctly. So, could you please assist with this ?

Thank you

@wpscholar
Copy link
Member

@ramyakrishnai We can't assist if your latest code isn't in the PR. Can you push the change anyway so we can pull down and test?

@ramyakrishnai
Copy link
Contributor Author

Hi @wpscholar , I've pushed the code and updated my pr with latest code.

Thank you

@wpscholar wpscholar merged commit f661d42 into trunk Oct 9, 2023
@wpscholar wpscholar deleted the PRESS4-311 branch October 9, 2023 19:28
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

Successfully merging this pull request may close these issues.

Convert this module into a runtime package
3 participants