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(macro): macro for vite #386

Merged
merged 31 commits into from
Mar 15, 2022
Merged

feat(macro): macro for vite #386

merged 31 commits into from
Mar 15, 2022

Conversation

Aslemammad
Copy link
Member

Resolves #299

@vercel
Copy link

vercel bot commented Mar 6, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/pmndrs/valtio/HQdZweX8wfZfk67vUsFYq56FokLJ
✅ Preview: https://valtio-git-fork-aslemammad-feat-vite-macro-pmndrs.vercel.app

@codesandbox-ci
Copy link

codesandbox-ci bot commented Mar 6, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 0588310:

Sandbox Source
React Configuration
React Typescript Configuration
React Browserify Configuration
React Snowpack Configuration
React Parcel Configuration

rollup.config.js Outdated
@@ -162,9 +162,13 @@ export default function (args) {
let c = Object.keys(args).find((key) => key.startsWith('config-'))
if (c) {
c = c.slice('config-'.length).replace(/_/g, '/')
if (c === 'macro-vite') {
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't config-macro_vite work??

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'll try that (I'm having some issues with types/exports, when importing valtio/macro/vite)

Copy link
Member

Choose a reason for hiding this comment

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

I mean L164 does the conversion, no?

Copy link
Member Author

@Aslemammad Aslemammad Mar 7, 2022

Choose a reason for hiding this comment

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

oh, I thought you mean the cli command? yea, it does! in the end, it's valtio/macro/vite.js

Copy link
Member

Choose a reason for hiding this comment

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

Please remove L165-L167,

Copy link
Member

Choose a reason for hiding this comment

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

remove L171 empty line to to remove the changes in this file.

Copy link
Member

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

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

small change request

rollup.config.js Outdated
@@ -162,9 +162,13 @@ export default function (args) {
let c = Object.keys(args).find((key) => key.startsWith('config-'))
if (c) {
c = c.slice('config-'.length).replace(/_/g, '/')
if (c === 'macro-vite') {
Copy link
Member

Choose a reason for hiding this comment

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

Please remove L165-L167,

package.json Outdated Show resolved Hide resolved
rollup.config.js Outdated
@@ -162,9 +162,13 @@ export default function (args) {
let c = Object.keys(args).find((key) => key.startsWith('config-'))
if (c) {
c = c.slice('config-'.length).replace(/_/g, '/')
if (c === 'macro-vite') {
Copy link
Member

Choose a reason for hiding this comment

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

remove L171 empty line to to remove the changes in this file.

Comment on lines 2 to 3
"root": true,
"extends": "next/core-web-vitals"
Copy link
Member

Choose a reason for hiding this comment

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

we shouldn't remove this, right??

Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
Copy link
Member

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

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

Looks cool! We have undocumented convention of specifying versions. Please see comments.

package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
Aslemammad and others added 2 commits March 16, 2022 02:41
Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
Copy link
Member

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

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

Looks good now.

readme.md Show resolved Hide resolved
@dai-shi dai-shi merged commit 0fcb5aa into pmndrs:main Mar 15, 2022
@dai-shi dai-shi changed the title feat: macro for vite feat(macro): macro for vite Mar 15, 2022
@Kaijun
Copy link

Kaijun commented Oct 9, 2022

Hi @Aslemammad

it seems aslemammad-vite-plugin-macro@1.0.0-alpha.1 is not compatible with vite@3.x

could you please upgrade vite peer dep verison for the macro plugin?

npm ERR! While resolving: aslemammad-vite-plugin-macro@1.0.0-alpha.1
npm ERR! Found: vite@3.0.6
npm ERR! node_modules/vite
npm ERR!   dev vite@"^3.0.6" from the root project
npm ERR!   peer vite@"^3.0.0" from @vitejs/plugin-react@2.0.1
npm ERR!   node_modules/@vitejs/plugin-react
npm ERR!     dev @vitejs/plugin-react@"^2.0.1" from the root project
npm ERR!   2 more (valtio, vite-plugin-dts)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vite@"^2.3.0" from aslemammad-vite-plugin-macro@1.0.0-alpha.1
npm ERR! node_modules/aslemammad-vite-plugin-macro
npm ERR!   dev aslemammad-vite-plugin-macro@"^1.0.0-alpha.1" from the root project
npm ERR!   peerOptional aslemammad-vite-plugin-macro@">=1.0.0-alpha.1" from valtio@1.7.0
npm ERR!   node_modules/valtio
npm ERR!     valtio@"^1.7.0" from the root project

@Aslemammad
Copy link
Member Author

I released v1.0.0, I think it would work now. @Kaijun

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.

useProxy macro failing with vite
3 participants