-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Migration docs v3 to v4 #1945
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
Migration docs v3 to v4 #1945
Conversation
ea56e86
to
d67310a
Compare
- [API Changes](#api-changes) | ||
- [AppProvider](#appprovider) | ||
- [i18n](#i18n) | ||
- [Navigation](#navigation) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend prefixing all of these anchors because for example #navigation
already exists in the style guide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Afaik we can't prefix them since they're based on the headers. I'm not 100% positive though, would love to hear how, if there is one 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah there is! Named anchors should do the trick
|
||
#### iconBody | ||
|
||
<!-- ping ben or andre about this <svg><path d='M17 9h-6V3a1 1 0 1 0-2 0v6H3a1 1 0 1 0 0 2h6v6a1 1 0 1 0 2 0v-6h6a1 1 0 1 0 0-2' fill-rule='evenodd'/></svg> doesnt seem to work --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @amrocha (in case you haven't been pinged yet)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AndrewMusgrave I'm not sure I understand what the issue here is, can you give an example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may be using the API wrong but string's dont seem to work for iconBody or icon#source
function Playground() {
const icon =
"<svg><path d='M17 9h-6V3a1 1 0 1 0-2 0v6H3a1 1 0 1 0 0 2h6v6a1 1 0 1 0 2 0v-6h6a1 1 0 1 0 0-2' fill-rule='evenodd'/></svg>";
return (
<Fragment>
<Icon source={icon} />
<Navigation location="/">
<Navigation.Section
items={[
{
url: '/path/to/place',
label: 'Products',
icon,
},
]}
/>
</Navigation>
</Fragment>
);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's just something wrong with the SVG you're using, when I updated it to the following SVG it started working again:
<svg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'><path d='M10.707 17.707l5-5a.999.999 0 1 0-1.414-1.414L11 14.586V3a1 1 0 1 0-2 0v11.586l-3.293-3.293a.999.999 0 1 0-1.414 1.414l5 5a.999.999 0 0 0 1.414 0' /></svg>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL: xmlns
is required for image/svg+xml files which is how we server string icons
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yeah, it needs be XML compliant
|
||
Polaris v4 contains mostly internal changes and has simple migration path. This guide goes through the necessary steps to deal with breaking changes in your application. | ||
|
||
**Note:** This migration guide is for v3 but may apply for v2 as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we include any info that would let the person know when the guide applies to v2? Just wondering how they would know if it applies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We didn't have a lot of breaking changes in v3
so a lot of this guide will apply. If you think this could be jarring, we could omit it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the title saying Migrating from v3 to v4
clarifies what it's for. I'm mainly wondering if folks would want a link to more info about v2 so they can find out why we say "this guide may apply to v2" - I'd like them to have a link or more info so they can figure that out. Unless that's something they should already know?
Polaris v4 contains mostly internal changes and has simple migration path. This guide goes through the necessary steps to deal with breaking changes in your application. | ||
|
||
**Note:** This migration guide is for v3 but may apply for v2 as well. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to introduce this list with a label that lets the reader know what the list is for or what it is made up of. Something like, Navigation components:
|
||
We’ve migrated to [React’s new context API](https://reactjs.org/docs/context.html) while restructuring Polaris’ entire context structure. Using the Polaris test provider will allow you to keep up to date Polaris' internal contexts. | ||
|
||
In v3, you could hook into Polaris’ context types. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In v3, you could hook into Polaris’ context types. | |
In v3, you could hook into Polaris React’s context types. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions to the wording to add clarity.
A note to myself: remember to talk about moving from sdks.shopfiycdn.com to unpkg.com for CDN CSS assets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BPScott left some suggestions. Do you mind going over them and committing where you see fit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test - ignore this... I didn't see my review posts earlier in the feed so I clicked submit review again to see if they'd pop up. found them :)
5205ce4
to
faefdcf
Compare
faefdcf
to
f596f55
Compare
f596f55
to
365935d
Compare
dafabe9
to
7f52029
Compare
WHY are these changes introduced?
Documentation
WHAT is this pull request doing?
Documenting. This is adding a text file to the repo, it doesn't get published anywhere fancy.