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

feat: injector utility for the archetype and build config to override the one in X #1258

Merged
merged 2 commits into from
Aug 8, 2023

Conversation

CachedaCodes
Copy link
Contributor

@CachedaCodes CachedaCodes commented Aug 2, 2023

EMP-1613

Motivation and context

We needed to encapsulate the styles in the x-archetype overlay from the clients' page, so we needed a way to tell to the styles where they should be injected (by default they're injected at the head of the page).
The injector in this PR does that, along with the rollup config (the implementation would only work on live envs)

  • Dependencies. If any, specify:
  • Open issue. If applicable, link:

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that causes existing functionality to not work as expected)
  • Change requires a documentation update

What is the destination branch of this PR?

  • Main
  • Other. Specify:

How has this been tested?

Run build on the x-archetype-utils package and the import the build in the x-archetype dependency.
Follow this draft in local to see it running:
empathyco/x-archetype#308

@CachedaCodes CachedaCodes requested a review from a team as a code owner August 2, 2023 14:56
@@ -104,6 +104,7 @@ export const rollupConfig = createRollupOptions({
})();
const useBrowserInjector =
(typeof STRIP_SSR_INJECTOR !== 'undefined' && STRIP_SSR_INJECTOR) || isBrowser;
console.log('${normalizePath(id)}',{source:${varname}})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀 console.log should be there?

Copy link
Contributor

@annacv annacv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gj!

@annacv annacv merged commit 08eb5c1 into main Aug 8, 2023
4 checks passed
@annacv annacv deleted the feature/EMP-1613-add-css-injector-to-archetype-utils branch August 8, 2023 14:03
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.

2 participants