question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"SourceType" should not be used to version the transforms

See original GitHub issue

Currently, the transform creates the equivalent of a static record, with sourceType member: https://github.com/Agoric/transform-module/blob/master/src/index.js#L87

This is needs to be equal to “module”, “script”, or “expression”: https://github.com/Agoric/transform-module/blob/master/src/index.js#L211 https://github.com/Agoric/transform-module/blob/master/src/index.js#L224

And is wired to derive which transforms to enable: https://github.com/Agoric/transform-module/blob/master/src/babelPlugin.js#L469

In other words, sourceType is really about the type of the source.

However, changes in Babel or in how our Babel plugin work could introduce incompatible changes that need to be detected by the consumers. If sourceType is used, then we would need to include then we would need to include three versions for every change, “module-v2”, “script-v3”, AND “expression-v3” because changes will most likely impact all three types at the same time.

It would be much better to keep version orthogonal to type, so a new version affects all types at the same time.

@michaelfig, following our discussion today, does this clarifies my position?

@erights @warner

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
jfparadiscommented, Feb 19, 2020

Hmm, I don’t think that cuts it.

  • That URL refers to a separate package, agoric-sdk
  • agoric-sdk has no dependency on transform-module

In other words, there is no relation between those two packages: moduleFormat isn’t part of the importer system.

In addition:

Basically, module format used to decide whether or not to put a wrapper around a module. Its use is completely internal to agoric-sdk.

Bottom-line:

  • sourceType: do we have a module, a script, an expression.
  • moduleFormat: do we have a cjs module, or an agoric functor.
  • version: which version of the functor do we have.

All three values need to evolve independently. The version needs to be tied to the output of the module transform, and needs to take into account the type of functor, etc. The importer then must decide what to do with a given version. Most likely agoric-sdk doesn’t need to be aware in involved with the version.

0reactions
michaelfigcommented, Sep 15, 2020

No longer relevant.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved: transforms.conf won't let me change the sourcetype
Solved: Hi all, I've got a small problem here.. Here is the scenario: I am receiving a file from a UF which has...
Read more >
Splunk Blog - Overall Best Practice Data Onboarding Process
Splunk can onboard all data, so why do we need to discuss this? Here are the top best practice tips for the Data...
Read more >
puppet-splunk/props.conf at master - GitHub
# Any fs_notification event indicates a successful change; vendor_status in the lookup is overloaded to accommodate this. LOOKUP- ...
Read more >
'import' and 'export' may appear only with 'sourceType: module ...
So, I updated my packages and then used global option to run babelify as a global transform excluding all node modules but the...
Read more >
Splunk Best Practices - Aplura
Use sourcetypes to group data by their similarity. If the events are generated by the same device and are in the same format,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found