Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

chore: release candidate @chakra-ui/vue@0.9.1 🎉 (patch) #447

Merged
merged 21 commits into from
Jun 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
5b499ec
docs: update README.md [skip ci]
allcontributors[bot] Jun 12, 2021
f56a82f
docs: update .all-contributorsrc [skip ci]
allcontributors[bot] Jun 12, 2021
a430f9a
docs: update README.md [skip ci]
allcontributors[bot] Jun 12, 2021
016dafc
docs: update .all-contributorsrc [skip ci]
allcontributors[bot] Jun 12, 2021
494ed1e
Merge pull request #444 from chakra-ui/master
codebender828 Jun 12, 2021
e88f8b5
Merge branch 'develop' into all-contributors/add-IHIutch
codebender828 Jun 12, 2021
bdebe1a
Merge pull request #441 from chakra-ui/all-contributors/add-IHIutch
codebender828 Jun 12, 2021
7331bb6
Merge branch 'develop' into all-contributors/add-MaySoMusician
codebender828 Jun 12, 2021
fafc52c
Merge pull request #440 from chakra-ui/all-contributors/add-MaySoMusi…
codebender828 Jun 12, 2021
0129467
fix: add fix for src attribute
codebender828 Jun 14, 2021
f4aead1
refactor: cleanup test code
codebender828 Jun 14, 2021
7ba26b9
chore: ignore service worker
codebender828 Jun 14, 2021
aa493a7
chore: remove untracked files
codebender828 Jun 14, 2021
af3c0d7
ci: added codesandbox for pull request previews
codebender828 Jun 14, 2021
f124d5c
chore: add release changeset
codebender828 Jun 14, 2021
3a21e5e
Merge branch 'develop' into fix/img-src-attr
codebender828 Jun 14, 2021
467cbdf
ci: update csb installCommand
codebender828 Jun 14, 2021
b946d88
Merge branches 'fix/img-src-attr' and 'fix/img-src-attr' of github.co…
codebender828 Jun 14, 2021
75c7cf4
ci: update csb installCommand
codebender828 Jun 14, 2021
737631e
chore: remove debugger
codebender828 Jun 14, 2021
ae1d19e
Merge pull request #446 from chakra-ui/fix/img-src-attr
codebender828 Jun 14, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@
"contributions": [
"code",
"bug",
"ideas"
"ideas",
"test",
"doc"
]
},
{
Expand All @@ -236,6 +238,15 @@
"doc"
]
},
{
"login": "MaySoMusician",
"name": "MaySoMusician",
"avatar_url": "https://avatars.githubusercontent.com/u/34566290?v=4",
"profile": "https://github.com/MaySoMusician",
"contributions": [
"code"
]
},
{
"login": "MWFIAE",
"name": "Martin",
Expand Down
5 changes: 5 additions & 0 deletions .changeset/curvy-squids-doubt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@chakra-ui/vue': patch
---

Fixes CImage src attribute bug
10 changes: 10 additions & 0 deletions .codesandbox/ci.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"installCommand": "csb:install",
"buildCommand": "build",
"packages": [
"packages/chakra-ui-core",
"packages/chakra-ui-nuxt"
],
"sandboxes": ["chakra-ui-vue-0x-starter-template-2sy0g", "chakra-ui-nuxt-demo-f8tq4"],
"node": "14"
}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ config/.env
packages/chakra-ui-nuxt/.github
packages/chakra-ui-docs/static/sw.js
website/static/sw.js
.npmrc
.npmrc
**/static/sw.js
Binary file added .storybook/assets/chakra.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions .storybook/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ module.exports = async ({ config, mode }) => {
'sass-loader'
],
});
config.resolve.alias = {
...config.resolve.alias,
"@/": path.resolve(__dirname, "./"),
};

// Return the altered config
return config;
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center"><a href="https://github.com/odanado"><img src="https://avatars.githubusercontent.com/u/6040962?v=4?s=50" width="50px;" alt=""/><br /><sub><b>odanado</b></sub></a><br /><a href="https://github.com/chakra-ui/chakra-ui-vue/commits?author=odanado" title="Code">💻</a> <a href="#tool-odanado" title="Tools">🔧</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/IHIutch"><img src="https://avatars.githubusercontent.com/u/20825047?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Jonathan Hutchison</b></sub></a><br /><a href="https://github.com/chakra-ui/chakra-ui-vue/commits?author=IHIutch" title="Code">💻</a> <a href="https://github.com/chakra-ui/chakra-ui-vue/issues?q=author%3AIHIutch" title="Bug reports">🐛</a> <a href="#ideas-IHIutch" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center"><a href="https://jt.houk.space/"><img src="https://avatars.githubusercontent.com/u/23695312?v=4?s=50" width="50px;" alt=""/><br /><sub><b>JT Houk</b></sub></a><br /><a href="https://github.com/chakra-ui/chakra-ui-vue/commits?author=HoukasaurusRex" title="Documentation">📖</a> <a href="#platform-HoukasaurusRex" title="Packaging/porting to new platform">📦</a></td>
<td align="center"><a href="https://github.com/vincentpalma"><img src="https://avatars.githubusercontent.com/u/10133632?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Vincent Palma</b></sub></a><br /><a href="https://github.com/chakra-ui/chakra-ui-vue/commits?author=vincentpalma" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/MaySoMusician"><img src="https://avatars.githubusercontent.com/u/34566290?v=4?s=50" width="50px;" alt=""/><br /><sub><b>MaySoMusician</b></sub></a><br /><a href="https://github.com/chakra-ui/chakra-ui-vue/commits?author=MaySoMusician" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/MWFIAE"><img src="https://avatars.githubusercontent.com/u/6072971?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Martin</b></sub></a><br /><a href="https://github.com/chakra-ui/chakra-ui-vue/commits?author=MWFIAE" title="Code">💻</a> <a href="https://github.com/chakra-ui/chakra-ui-vue/commits?author=MWFIAE" title="Tests">⚠️</a></td>
</tr>
</table>
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
},
"scripts": {
"postinstall": "lerna link",
"csb:install": "yarn && yarn bootstrap",
"bootstrap": "lerna bootstrap --use-workspaces",
"build:dev": "yarn workspace @chakra-ui/vue run rollup --config rollup.dev.config.js",
"build": "yarn workspace @chakra-ui/vue build",
Expand Down
8 changes: 6 additions & 2 deletions packages/chakra-ui-core/src/CImage/CImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,12 @@ const CImage = {
methods: {
loadImage (src, srcset) {
const image = new window.Image()
image.srcset = srcset
image.src = src
if (srcset) {
image.srcset = srcset
}
if (src) {
image.src = src
}

image.onload = (event) => {
this.hasLoaded = true
Expand Down
13 changes: 12 additions & 1 deletion packages/chakra-ui-core/src/CImage/CImage.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,18 @@ storiesOf('UI | Image', module)
<CImage
shadow="sm"
htmlWidth="100px"
src="https://bit.ly/chakra-jonathan-bakebwa"
src="https://bit.ly/chakra-jonathan-bakebw3a"
srcset="https://bit.ly/chakra-jonathan-bakebwa"
/>
`
}))
.add('Webpack required image', () => ({
components: { CImage },
template: `
<CImage
shadow="sm"
htmlWidth="100px"
:src="require('@/assets/chakra.png')"
/>
`
}))
Expand Down
13 changes: 11 additions & 2 deletions packages/chakra-ui-core/src/CImage/tests/CImage.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,18 @@ it('fallback src works', async () => {
})
})

it('srcset works', async () => {
renderComponent({ template: '<CImage alt="My Image Description" src="LOAD_SUCCESS_SRC" srcset="LOAD_SUCCESS_SRC 400w" />' })
it('"srcset" should work and be prioritized over "src" if provided to CImage', async () => {
const { asFragment } = renderComponent({ template: '<CImage alt="My Image Description" src="LOAD_SUCCESS_SRC" srcset="LOAD_SUCCESS_SRC 400w" />' })
await wait(() => {
expect(screen.getByAltText(/My Image Description/i)).toHaveAttribute('srcset', 'LOAD_SUCCESS_SRC 400w')
expect(asFragment()).toMatchSnapshot()
})
})

it('should use src if srcset provided is undefined', async () => {
const { asFragment } = renderComponent({ template: '<CImage alt="My Image Description" src="LOAD_SUCCESS_SRC" srcset="LOAD_FAILURE_SRC" />' })
await wait(() => {
expect(screen.getByAltText(/My Image Description/i)).toHaveAttribute('src', 'LOAD_SUCCESS_SRC')
expect(asFragment()).toMatchSnapshot()
})
})
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`"srcset" should work and be prioritized over "src" if provided to CImage 1`] = `
<DocumentFragment>
<img
alt="My Image Description"
class="css-0"
data-chakra-component="CImage"
src="LOAD_SUCCESS_SRC"
srcset="LOAD_SUCCESS_SRC 400w"
/>
</DocumentFragment>
`;

exports[`should render correctly 1`] = `
<DocumentFragment>
<img
Expand All @@ -11,3 +23,15 @@ exports[`should render correctly 1`] = `
/>
</DocumentFragment>
`;

exports[`should use src if srcset provided is undefined 1`] = `
<DocumentFragment>
<img
alt="My Image Description"
class="css-0"
data-chakra-component="CImage"
src="LOAD_SUCCESS_SRC"
srcset="LOAD_FAILURE_SRC"
/>
</DocumentFragment>
`;
1 change: 0 additions & 1 deletion website/static/sw.js

This file was deleted.