Skip to content

Conversation

@kyledurand
Copy link
Member

@kyledurand kyledurand commented Oct 27, 2022

Pulling css from https://unpkg.com/@shopify/polaris@latest/build/esm/styles.css means that css can get out of sync when developing.

Why this is important

We're currently developing documentation around alpha / beta components. These components are changing and our docs will too, let's make sure the css is synced so we're not seeing weird stuff!

@kyledurand kyledurand marked this pull request as ready for review October 27, 2022 18:46
@@ -0,0 +1,10 @@
import fs from 'fs';

const builtStylesPath = '../polaris-react/build/esm/styles.css';
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm assuming Polaris is always built when yarn dev runs, otherwise other things would fail as well, right?

Copy link
Member

Choose a reason for hiding this comment

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

Only if it happens at the root of the monorepo. This could be a little bit confusing if someone is running just the website.

@kyledurand
Copy link
Member Author

kyledurand commented Oct 28, 2022

This has just been proven to be important in production as well. unpkg.com was not serving up our css for ~1.5hr.

Failed to load resource: net::ERR_BLOCKED_BY_RESPONSE.NotSameOrigin/examples/callout-card-default:1

GET https://unpkg.com/@shopify/polaris@latest/build/esm/styles.css net::ERR_BLOCKED_BY_RESPONSE.NotSameOrigin 503

@alex-page
Copy link
Member

alex-page commented Oct 28, 2022

The way I hoped we would resolve this would be adding @shopify/polaris as a dependency and importing the css file from the package. The unpkg approach is not great and has major issues with relying on another service.

@kyledurand kyledurand mentioned this pull request Nov 7, 2022
@kyledurand
Copy link
Member Author

Closing in favour of global styles approach #7659

@kyledurand kyledurand closed this Nov 7, 2022
@kyledurand kyledurand deleted the copy-polaris-styles-to-public branch November 7, 2022 17:32
kyledurand added a commit that referenced this pull request Nov 8, 2022
Alternate solution to #7554
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