You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fable splitter doesn't put /big.js in output #1751
I'm trying to convert my React Native project from fable 1.x to fable 2.x but fable-splitter doesn't put big.js into my out folder. Any ideas what I can try?
fable-splitter is used to compile the tests and they include decimal tests (which require the big.js dependency). Do you have a small repro of your problem?
now look into out folder. I'd expect BigInt would be copied into fable-library.2.2.0-beta-012 folder. But it's directly in out. Something is weird here.
fable-splitter flattens the folder structure, this is done mainly to avoid issues with folders coming from an external directory. If the import paths within the files are correct (which should be the case) this is not a problem. (However @ncave has "fixed" this for fable-compiler-js, maybe it could be fixed here too.)
I can see out/lib/big.js after running fable-splitter so it seems to work. I cannot run the app though because I don't have Android SDK installed in my machine.
Also, please note big.js is not about BigInts but Decimal.
I mean the BigInt folder - and it's not flattened at all. it's just that the subfolders are now outside of the original folder (and in the work project they aren't copied at all)
@forki Yes, that's what @alfonsogarciacaro means by flattened folder structure - just one level deep, so all the subfolders are brought at top level. That's how the splitter was always working.
If you want to experiment with a different folder structure, the fable-compiler-js (@next) tries to strike a better balance and retain the original folder structure to the extent possible (within reason, as it has to move any external dependencies into the output somehow, so not possible if we don't want to recreate full absolute paths under the output folder, which would work but it will be too deep IMO).
Tbh that folder structure is OK. The problem is that it does not copy it at
all in my real app. I guess I need to turn that one into a repro by
removing all product stuff.
ncave <notifications@github.com> schrieb am Di., 26. Feb. 2019, 17:26:
@forki <https://github.com/forki> Yes, that's what @alfonsogarciacaro
<https://github.com/alfonsogarciacaro> means by flattened folder
structure - just one level deep, so all the subfolders are brought at top
level. That's how the splitter was always working.
If you want to experiment with a different folder structure, the
fable-compiler-js tries to strike a different balance and retain the
original folder structure to the extent possible (within reason, as it has
to move any external dependencies into the output somehow, so not possible
if we don't want to create full absolute paths under the output folder,
which would work but it will be too deep IMO).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1751 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADgNB4RrvbVBE9fmrrFDvvRHucsqwdeks5vRWAwgaJpZM4bHBqG>
.
Apparently the problem was the babel.config.js file. Babel was reading it when parsing JS files so the AST was different from expected, and the import paths couldn't be adjusted. Can you please try with fable-splitter 2.1.6?
Activity
forki commentedon Feb 21, 2019
so that big.js file is correctly copied into
.fablefolder as part offable-library.2.1.12but it's not put intooutforki commentedon Feb 21, 2019
@alfonsogarciacaro I wonder if that's related to TypeScript being involved?
forki commentedon Feb 21, 2019
BigInt folder isn't copied as well. So I assume it's only copying the top-level?
alfonsogarciacaro commentedon Feb 22, 2019
fable-splitter is used to compile the tests and they include decimal tests (which require the big.js dependency). Do you have a small repro of your problem?
forki commentedon Feb 22, 2019
forki commentedon Feb 26, 2019
I think I found a probably related bug:
build.cmd debugnow look into
outfolder. I'd expectBigIntwould be copied intofable-library.2.2.0-beta-012folder. But it's directly inout. Something is weird here.alfonsogarciacaro commentedon Feb 26, 2019
fable-splitter flattens the folder structure, this is done mainly to avoid issues with folders coming from an external directory. If the import paths within the files are correct (which should be the case) this is not a problem. (However @ncave has "fixed" this for fable-compiler-js, maybe it could be fixed here too.)
I can see
out/lib/big.jsafter running fable-splitter so it seems to work. I cannot run the app though because I don't have Android SDK installed in my machine.forki commentedon Feb 26, 2019
I mean the BigInt folder - and it's not flattened at all. it's just that the subfolders are now outside of the original folder (and in the work project they aren't copied at all)
ncave commentedon Feb 26, 2019
@forki Yes, that's what @alfonsogarciacaro means by flattened folder structure - just one level deep, so all the subfolders are brought at top level. That's how the splitter was always working.
If you want to experiment with a different folder structure, the
fable-compiler-js(@next) tries to strike a better balance and retain the original folder structure to the extent possible (within reason, as it has to move any external dependencies into the output somehow, so not possible if we don't want to recreate full absolute paths under the output folder, which would work but it will be too deep IMO).forki commentedon Feb 26, 2019
forki commentedon Feb 27, 2019
getting some warnings about the same lib. is that related?
forki commentedon Feb 27, 2019
I found something in the log output. In the SAFE-Nightwatch it looks ok:
In my own project it forgets about the requires:
forki commentedon Feb 27, 2019
Ok. here is a repro:
msu.Reading.zip
yarn installyarn run fable-splitter -c splitter.config.js --define DEBUGAs you can see it compiles the Decimal.js - which itself has that gnarly require. But the
big.jsis not put intooutfolderforki commentedon Feb 28, 2019
@alfonsogarciacaro I updated to 2.2.0-beta-014 in my production app and it seems to be fixed. Is there something that might have caused that?
alfonsogarciacaro commentedon Feb 28, 2019
In principle I'd say no, unless this commit had something to with adding an import to Decimal.ts: 53fcc7a
In any case, if it's fixed let's call it a day :)
forki commentedon Feb 28, 2019
;-)
forki commentedon Mar 12, 2019
ok with 2.2.0-beta-016 I see that issue again
alfonsogarciacaro commentedon Mar 14, 2019
Apparently the problem was the babel.config.js file. Babel was reading it when parsing JS files so the AST was different from expected, and the import paths couldn't be adjusted. Can you please try with fable-splitter 2.1.6?
forki commentedon Mar 15, 2019
cool, seems to work! thanks a lot!