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

chore: support ast-reflection s-expressions #520

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

thantos
Copy link
Collaborator

@thantos thantos commented Sep 23, 2022

Required for: functionless/ast-reflection#32

Maintains backwards compatibility with previous register and bind functions.

AST-Reflection is changing from register and bind methods to using s-expression like sequence expressions.

@netlify
Copy link

netlify bot commented Sep 23, 2022

Deploy Preview for effortless-malabi-1c3e77 ready!

Name Link
🔨 Latest commit 9027a45
🔍 Latest deploy log https://app.netlify.com/sites/effortless-malabi-1c3e77/deploys/6332f8c0a8c6970009dd2b47
😎 Deploy Preview https://deploy-preview-520--effortless-malabi-1c3e77.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Comment on lines +1134 to +1137
throw new SynthError(
ErrorCodes.Unexpected_Error,
"Compilation Error: found an invalid register command. Check the versions of AST-Reflection and Functionless."
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not just make it a no-op?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

My thought was: The user wouldn't know it is an issue until runtime. If we cannot re-construct the command then we should fail.

Copy link
Collaborator

Choose a reason for hiding this comment

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

But how do you know it's not just someone else using similar looking syntax? The compiler should not produce an invalid contract right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We check for our flag on the left first. The chance someone has stash_salt=bind is very low.

That leaves all parsing errors as a bug or mis-matched package version ( with breaking changes)

Signed-off-by: github-actions <github-actions@github.com>
@thantos thantos marked this pull request as ready for review September 25, 2022 16:05
minify: true,
minify: false,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Did you mean to check this in? It can cause problems?

sourceMaps: "inline",
inlineSourcesContent: false,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this has an impact where identifiers that have been renamed cannot be re-mapped.

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.

None yet

2 participants