Sami Jaber
Sami Jaber
@simongeau Thanks for adding this fix! If you can follow the steps outlined here: https://github.com/BuilderIO/mitosis/blob/main/developer/README.md#developing-for-core--testing Essentially: add tests that highlight this change, and format your PR to pass the CI...
This was recently introduced in #1206, and is being improved incrementally to cover more cases. https://mitosis.builder.io/?outputTab=G4VwpkA%3D&code=JYWwDg9gTgLgBAbzgVwM4FMDKNroDQoYAqAhlAObrwC%2BcAZlBCHAEQACARssADYAm6KADpgEAPQhgOVMFQsA3AChF6AB6RYcAXRLIe8OsgB2AYxiijcALIBPAMJNIR9EZgAKMIzCoAlIkVwcCYQRqjwYSQw6HAAvIRYOFDobggBgXBGJCDJfqnp6cGh8Kqx8aQUVClp%2BYFJJGYAXHAA5HVmALSoWcDNeNU1AG7I6ABMTc1Do53dvf35kwDM44vTkrM16dq6%2BuNbejCrPXNw1D7KG0kwyFCWJQDULRwkAF7N%2FdTn6Wmnn5fXlm5%2BgAePjAAYAPmOQOARjAyBgx0CJlQqBiCDyGwKEB40CaLCSfBYfUxJw%2BJIGJB4wzRESiQky2TcPjJNTEkI2AAl0DwcQBCOAASSCJEsUGMcBhcAASuh6jACAA1YYETDY4B8AjQOAAGWAAEduHxecCxKCIWkfEpqEA%3D%3D%3D Currently it only supports assignments, but in an upcoming PR it will handle many...
This is related to https://github.com/BuilderIO/mitosis/issues/310 as well.
Closing this as we have already implemented https://github.com/changesets/changesets in another PR
cc @raymondmuller might have a better idea of where in the Sveltosis parser this lives.
can you handle the conflicts in this branch and merge main so we see a cleaner diff?
Agreed! We should improve the error handling of code generation, and maybe output a banner or modal with the error that occurred. https://github.com/BuilderIO/mitosis/blob/afdb648f30214e9bc1a3262096628831ee3616d5/packages/fiddle/src/components/Fiddle/Fiddle.tsx#L338-L357 This is where we call the generator,...
Looking at the generated JSON: ```json "rows": { "code": "get rows() {\n return state.textareaContent.split(\"\\n\").filter(row => row != \"\")}", "type": "getter" } ``` I do see the `\n` is escaped correctly....
Confirming that `dedent` does not respect the escaped `\n`:
I think we solve both by removing all usage of `dedent` and `stripNewLinesInStrings`. That should be OK.