Why you try to do this way for changing text?
You can do this simply by translation.
Create a i18n/en_US.csv inside your theme
OR
Inside your module create i18n/en_US.csv, In that case make sure your module load after Magento_Checkout module. So module.xml looks like:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Vendor_Module" setup_version="2.0.0">
<sequence>
<module name="Magento_Checkout"/>
</sequence>
</module>
</config>
Your csv content should be
"Place Order","Do you like Place Order?"
Clear all cache.
XML Checkout. Should think about XML first.
1) A standard practice
Most of the developer will take a look the XML first to check the XML layout.
2) Maintenance
If you're familiar with checkout XML, you will see that it's easy to change. On the other hand, LayoutProcessor::process()
will be "messy" if there are one more changes from different extensions.
When do we need to use LayoutProcessor::process()
plugin?
1) Complex logic
It's hard to say in this case. But for example:
\Magento\Checkout\Block\Checkout\LayoutProcessor::process($jsLayout)
......
['payment']['children'] = $this->processPaymentChildrenComponents(
$jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
['payment']['children'],
$elements
);
......
We need to assign the billing info to each payment. As we can see, it's impossible to use XML.
2) Remove component completely
We can use XML to disable a component, but component still is rendered. We can remove this component completely.
XML:
<item name="%the_component_to_be_disabled%" xsi:type="array">
<item name="config" xsi:type="array">
<item name="componentDisabled" xsi:type="boolean">true</item>
</item>
</item>
LayoutProcessor::process()
unset($jsLayout['components']['checkout']['children']['steps'][%path_to_target_node%]); //%path_to_target_node% is the path to the component's node in checkout_index_index.xml
return $jsLayout;
3) Can do what XML cannot do...
Don't need to explain more here.
Best Answer
The code you described is not in magento 2 anymore. Checkout has been modified.
You can substitute any action (and any requireJs component) using requireJs map configuration (http://requirejs.org/docs/api.html#config-map) in magento requireJs config files.
Interception (or mixins) feature is not yet implemented for JS) but it's in development right now and will be delivered pretty soon.