Skip to content

Update Decap so PKCE works - #56

Open
paulnicholsen27 wants to merge 7 commits into
CodeStitchOfficial:mainfrom
paulnicholsen27:main
Open

Update Decap so PKCE works#56
paulnicholsen27 wants to merge 7 commits into
CodeStitchOfficial:mainfrom
paulnicholsen27:main

Conversation

@paulnicholsen27

Copy link
Copy Markdown
Contributor

In order to get PKCE login to work, I needed to update the Decap version. This caused a React conflict, so now Decap uses its own React.

@BuckyBuck135

Copy link
Copy Markdown
Contributor

Thanks @paulnicholsen27,
It would be a useful change, but I need to take the time to check for breaking changes (lots of version changes since 3.0.0 to today), and make sure that people are comfortable with that React syntax to create the preview.

One thing you can do in the meantime is to get rid of these changes in the package-lock.json because they don't seem related to your issue.

@BuckyBuck135

Copy link
Copy Markdown
Contributor

@ItsEthanH
What do you think about this? I know you added that Babel stuff when I ported the preview changes from Astro.

@BuckyBuck135
BuckyBuck135 requested a review from ItsEthanH August 10, 2026 14:17
@paulnicholsen27

Copy link
Copy Markdown
Contributor Author

Thanks @paulnicholsen27, It would be a useful change, but I need to take the time to check for breaking changes (lots of version changes since 3.0.0 to today), and make sure that people are comfortable with that React syntax to create the preview.

One thing you can do in the meantime is to get rid of these changes in the package-lock.json because they don't seem related to your issue.

I figured--maybe mention this in the docs somewhere? Would save a lot of head-banging time trying to get the Google login to work, unless I'm missing something

@CodeStitchOfficial CodeStitchOfficial deleted a comment from netlify Bot Aug 11, 2026
ItsEthanH and others added 2 commits August 11, 2026 13:03
Only incidental npm metadata, no dependency changes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ItsEthanH

Copy link
Copy Markdown
Member

So I agree with a lot of what @BuckyBuck135 says about the syntax. Using the h() syntax is incredibly unfriendly, and we're already pushing the definition of "Intermediate" when dealing with this part of the kit.

Therefore any issue should be approached with the best DX in mind, while also keeping everything as up to date as possible.

In order to respect this, my changes propose:

  1. Updating the DecapCMS script to be the most stable version
  2. Moving all preview-related code to a JSX file that we load with Babel to keep things a little cleaner
  3. Using /** @jsx h */ to convert our syntax to the same h() syntax that Decap uses.

I wasn't aware of @jsx h when this was originally implemented, but thanks for some LLM-assisted searching, this seems to be the best fit. We don't need to render two versions of React and can instead just compile directly to the same thing the latest versions of Decap use.

@paulnicholsen27 (and others!), any complaints against me merging this in it's current state?

@BuckyBuck135

Copy link
Copy Markdown
Contributor

@ItsEthanH
Looks good to me. Agree with pinning Decap version to 3.15.x for stability

After going through the breaking changes, I only found a small one: date doesn't default to anything anymore, so I reintroduced it with 5fd1d20

@BuckyBuck135

Copy link
Copy Markdown
Contributor

I figured--maybe mention this in the docs somewhere? Would save a lot of head-banging time trying to get the Google login to work, unless I'm missing something

@paulnicholsen27
What changes would you like to see in the readme?

@paulnicholsen27

Copy link
Copy Markdown
Contributor Author

If you're updating Decap, I don't think you need to change the README. I just thought mentioning that PKCE wouldn't work without the updated version would be helpful, but this is better!

@ItsEthanH

Copy link
Copy Markdown
Member

LGTM

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.

3 participants