CSE-112: Add support for atlassian dev mode

Merged
#447 · Created  · Last updated

Merged pull request

Merged in issues/CSE-112-dev-mode-wip (pull request #447)

18f174f·Author: ·Closed by: ·2021-04-16

Description

Work on checking if the product is running in dev mode.

I don’t like that we are blurring the lines between Node and WRM worlds even more, to be fair with you.

The only solution I managed to find is to allow the runtime plugin to overwrite the singleton global object we use to store the registry state.

Context

Why we need that at all? When the product is running in dev mode with webpack-dev-server (WDS), the WRM and webpack WRM plugin are changing the behaviour of WRM.require function.

The CSE code depends on the promise result of calling WRM.require the async function. Once the products run WDS, we are losing the deterministic behaviour of WRM.require. The web-resources loaded by WRM are only proxing the scripts to assets on the WDS.

We already have a solution in place to check if the local refapp is running WDS. That works only when we run the CSE with local refapp.

Once we build a Java P2 plugin that we run on a product, we can’t detect if the product runs WDS to server the Javascript assets. The registry module is a provided dependency, and it’s not served by WDS.

The solution I propose is to use the atlassian.dev.mode flag that can simulate the same check as we have for local refapp. We can provide the value of atlassian.dev.mode flag by using the old good web-resource data providers. The flag value can be provided to the registry NPM module inside the P2 runtime module.

0 attachments

0 comments

Loading commits...