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

#9620: Update studio to support variable components (Mailer) #9639

Merged

Conversation

raph90
Copy link
Contributor

@raph90 raph90 commented Dec 7, 2023

Reference to #9620.

Currently Studio supports export function Welcome() syntax for emails. This PR adds support for export const Welcome = () => ...

Also added optional dependencies for SWC to fix an error that I think is architecture related.

@Tobbe Tobbe requested a review from Josh-Walker-GM December 7, 2023 09:52
@raph90 raph90 force-pushed the 9620_mailer_not_recognising_templates branch from 01dbed4 to 6e51aaf Compare December 7, 2023 09:57
@Tobbe
Copy link
Member

Tobbe commented Dec 7, 2023

@raph90 Thanks for your PR. Looks like you need to run yarn install (and possibly follow that up with yarn check) and commit the updated yarn.lock file as well.

@Tobbe Tobbe added the release:feature This PR introduces a new feature label Dec 7, 2023
@Tobbe Tobbe added this to the next-release milestone Dec 7, 2023
@Josh-Walker-GM Josh-Walker-GM self-assigned this Dec 7, 2023
@raph90 raph90 force-pushed the 9620_mailer_not_recognising_templates branch from 6e51aaf to 750240f Compare December 8, 2023 20:33
@raph90
Copy link
Contributor Author

raph90 commented Dec 8, 2023

@raph90 Thanks for your PR. Looks like you need to run yarn install (and possibly follow that up with yarn check) and commit the updated yarn.lock file as well.

Thanks @Tobbe, this is now ready for review I think.

@raph90
Copy link
Contributor Author

raph90 commented Dec 8, 2023

Updated based on your comments @Tobbe

@Tobbe
Copy link
Member

Tobbe commented Dec 11, 2023

@Josh-Walker-GM I'll leave the final review to you

Copy link
Collaborator

@Josh-Walker-GM Josh-Walker-GM left a comment

Choose a reason for hiding this comment

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

I think there a small thing to correct in the AST processing which I've commented explicitly about. Otherwise I'm happy with this and we can get it merge once that's addressed. Thanks!

packages/studio/api/mail/index.ts Outdated Show resolved Hide resolved
@raph90 raph90 force-pushed the 9620_mailer_not_recognising_templates branch from 0bd0e01 to e3a79e5 Compare December 17, 2023 12:33
@raph90 raph90 force-pushed the 9620_mailer_not_recognising_templates branch from e3a79e5 to 648f4df Compare December 18, 2023 09:18
@Josh-Walker-GM Josh-Walker-GM self-requested a review December 23, 2023 22:48
Copy link
Collaborator

@Josh-Walker-GM Josh-Walker-GM left a comment

Choose a reason for hiding this comment

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

@raph90 I pushed up some changes - I hope you don't mind. By changing the way swc was imported it now is typed so that made things easier to work with.

Would you be able to test this out and confirm everything is now working as you'd expect? After that I'll merge.

@raph90
Copy link
Contributor Author

raph90 commented Dec 24, 2023

All looking good to me @Josh-Walker-GM!

Weirdly I am still getting the

Error: Fallback bindings does not support filesystem access
    at Compiler.parseFileSync 

error, but when I actually go into studio and look at the templates everything is working. It might be because the project I'm testing on is running Redwood 6.0.7 rather than canary, I'm not sure. But I think this is good to go if you're happy!

@Josh-Walker-GM Josh-Walker-GM enabled auto-merge (squash) December 24, 2023 19:29
@Josh-Walker-GM Josh-Walker-GM merged commit 2026d79 into redwoodjs:main Dec 24, 2023
31 checks passed
Josh-Walker-GM added a commit that referenced this pull request Dec 24, 2023
**Problem**
#9545 Highlights some compatibility issues with studio on windows.

**Changes**
1. Removes some assumptions of `/` as the path separator.

**Fixes**
Fixes #9545 in combination with #9639
dac09 added a commit to dac09/redwood that referenced this pull request Dec 27, 2023
…redwood into fix/enhance-error-apollo-suspense

* 'fix/enhance-error-apollo-suspense' of github.com:dac09/redwood: (92 commits)
  chore(deps): update dependency @types/yargs to v17.0.32 (redwoodjs#9759)
  Make it easier to find useMatch docs (redwoodjs#9756)
  chore(unit tests): Use side-effect import to fix TS errors (redwoodjs#9754)
  fix(context): Refactor context (redwoodjs#9371)
  docs: Replaced deprecated <Set private> with PrivateSet within router.md (redwoodjs#9749)
  add TS support for storybook preview tsx config extension (redwoodjs#9309)
  fix(studio): Fix windows path issues (redwoodjs#9752)
  redwoodjs#9620: Update studio to support variable components (Mailer) (redwoodjs#9639)
  chore(tasks): Add comparison view to nmHoisting visualisation (redwoodjs#9751)
  chore(cli): make fs modules used in the CLI consistent (redwoodjs#9746)
  chore(tooling): Make sure console boxen print on a new line
  chore(CI): fix publish release candidate
  feat(CLI): add check node version middleware, rm `.nvmrc`, yarn engines (redwoodjs#9728)
  docs: added some clarification on serverless functions getting executed in a non-serverless environment (redwoodjs#9742)
  Fix sshExec() errors not displaying (redwoodjs#9743)
  chore(tooling): Add missing word in release tooling output
  Update Metadata docs (redwoodjs#9744)
  chore(CI): update test project fixture and CRWA for deploy target CI repo (redwoodjs#9730)
  chore(tooling): add script for getting nested dependency data (redwoodjs#9734)
  Trusted Documents docs: Proofreading corrections (redwoodjs#9737)
  ...
dac09 added a commit to dac09/redwood that referenced this pull request Dec 27, 2023
…ath-aliases

* 'main' of github.com:redwoodjs/redwood: (92 commits)
  chore(deps): update dependency @types/yargs to v17.0.32 (redwoodjs#9759)
  Make it easier to find useMatch docs (redwoodjs#9756)
  chore(unit tests): Use side-effect import to fix TS errors (redwoodjs#9754)
  fix(context): Refactor context (redwoodjs#9371)
  docs: Replaced deprecated <Set private> with PrivateSet within router.md (redwoodjs#9749)
  add TS support for storybook preview tsx config extension (redwoodjs#9309)
  fix(studio): Fix windows path issues (redwoodjs#9752)
  redwoodjs#9620: Update studio to support variable components (Mailer) (redwoodjs#9639)
  chore(tasks): Add comparison view to nmHoisting visualisation (redwoodjs#9751)
  chore(cli): make fs modules used in the CLI consistent (redwoodjs#9746)
  chore(tooling): Make sure console boxen print on a new line
  chore(CI): fix publish release candidate
  feat(CLI): add check node version middleware, rm `.nvmrc`, yarn engines (redwoodjs#9728)
  docs: added some clarification on serverless functions getting executed in a non-serverless environment (redwoodjs#9742)
  Fix sshExec() errors not displaying (redwoodjs#9743)
  chore(tooling): Add missing word in release tooling output
  Update Metadata docs (redwoodjs#9744)
  chore(CI): update test project fixture and CRWA for deploy target CI repo (redwoodjs#9730)
  chore(tooling): add script for getting nested dependency data (redwoodjs#9734)
  Trusted Documents docs: Proofreading corrections (redwoodjs#9737)
  ...
Tobbe pushed a commit that referenced this pull request Jan 1, 2024
Reference to #9620. 

Currently Studio supports `export function Welcome()` syntax for emails.
This PR adds support for `export const Welcome = () => ...`

Also added optional dependencies for SWC to fix an error that _I think_
is architecture related.

---------

Co-authored-by: Josh GM Walker <56300765+Josh-Walker-GM@users.noreply.github.com>
Tobbe pushed a commit that referenced this pull request Jan 1, 2024
**Problem**
#9545 Highlights some compatibility issues with studio on windows.

**Changes**
1. Removes some assumptions of `/` as the path separator.

**Fixes**
Fixes #9545 in combination with #9639
Tobbe pushed a commit that referenced this pull request Jan 1, 2024
**Problem**
#9545 Highlights some compatibility issues with studio on windows.

**Changes**
1. Removes some assumptions of `/` as the path separator.

**Fixes**
Fixes #9545 in combination with #9639
@Josh-Walker-GM Josh-Walker-GM mentioned this pull request Jan 7, 2024
1 task
@jtoar jtoar modified the milestones: next-release, v7.0.0 Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:feature This PR introduces a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants