-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Convert tailwind to ESM from CJS #2998
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
base: main
Are you sure you want to change the base?
Conversation
Deploying wasp-docs-on-main with
|
Latest commit: |
bd65575
|
Status: | ✅ Deploy successful! |
Preview URL: | https://b7341ce1.wasp-docs-on-main.pages.dev |
Branch Preview URL: | https://franjo-tailwind-ems.wasp-docs-on-main.pages.dev |
@FranjoMindek heads up, maybe we move Tailwind to user-land with 0.18.0 already. After we migrate the Vite version, I think it will 100% doable. |
Yes, I asked this question specifically during the last meeting. |
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.
This makes sense.
I haven't tested it and I haven't verified you got all occurences. I thought you all the tricks I know for finding stuff, so I trust you used them :)
The only real problem is the changelog mistake.
waspc/ChangeLog.md
Outdated
|
||
### ⚠️ Breaking Changes | ||
|
||
- Wasp now uses CommonJS (CJS) instead of ECMAScript Modules (ESM) for Tailwind configuration files. ([#2998](https://github.com/wasp-lang/wasp/pull/2998)) |
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.
The opposite I think.
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.
Oh man.
|
||
### 1. Rename Tailwind Configuration Files | ||
|
||
Update the file extensions from `.cjs` to `.js`: |
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.
Update the file extensions from `.cjs` to `.js`: | |
Update the Tailwind configuration files' extensions from `.cjs` to `.js`: |
|
||
### 2. Convert CJS Syntax to ESM | ||
|
||
Update your `tailwind.config.cjs` file to use ESM. |
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.
But they already updated the extension, so it's no longer cjs
. Perhaps this should be step 1?
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.
True. I wrote steps independently, but didn't catch this out of order mistake.
I'll leave the order, but fix this.
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 switched them in the end, so there is less confusion.
<Tabs> | ||
<TabItem value="before" label="Before"> |
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.
Oh, this is the final product, with both steps? Then I'd separate it into its own section.
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.
This was meant to show only the cjs -> esm change, but since we already did step 1 i also changed the name.
Hm.
Maybe then I should switch the steps after all so there is less confusion.
And have this be tailwind.config.cjs
for both instances.
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.
Switched them, makes sense now.
waspc/waspc.cabal
Outdated
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.
Should we bump the version too? Probably not, just double checking.
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 had this discussion once during initial onboarding, I think the answer was that it doesn't really matter, since we always do it on release. Or something like that. But the answer was that it doesn't really matter.
I my initial search I did miss |
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.
Looks good, but please check the last two comments
@@ -10,4 +10,4 @@ module.exports = { | |||
extend: {}, | |||
}, | |||
plugins: [], | |||
}; | |||
}; |
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.
Many of these files are missing newlines at the end. Can prettier take care of that?
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.
Description
Makes Wasp use ESM for Tailwind configuration files.
Fixes #2996 .
Select what type of change this PR introduces:
Update Waspc ChangeLog and version if needed
If you did a bug fix, new feature, or breaking change, that affects
waspc
, make sure you satisfy the following:ChangeLog.md
with description of the change this PR introduces.waspc
version inwaspc.cabal
to reflect changes I introduced, with regards to the version of the latest wasp release, if the bump was needed.Update example apps if needed
If you did code changes and updated an existing feature, make sure you satisfy the following:
waspc/examples/todoApp
and its e2e tests as needed and manually checked it works correctly.Update starter apps if needed
If you did code changes and updated an existing feature, make sure you satisfy the following:
basic
starter as needed and manually checked it works correctly.todo-ts
starter as needed and manually checked it works correctly.embeddings
starter as needed and manually checked it works correctly.saas
starter as needed and manually checked it works correctly.Update e2e tests if needed
If you did code changes and changed Wasp's code generation logic, make sure you satisfy the following: